TeensyNanoExoCode
Loading...
Searching...
No Matches
ErrorManager.h
Go to the documentation of this file.
1#ifndef ERRORMANAGER_H
2#define ERRORMANAGER_H
3
4#if defined(ARDUINO_TEENSY36) || defined(ARDUINO_TEENSY41)
5
6#include "error_types.h"
7
8
14class ErrorManager
15{
16 public:
17 ErrorManager(Exo* exo, ExoData* exo_data);
23 bool check();
31 void assign_handlers(error_handler_t soft, error_handler_t hard, error_handler_t fatal);
39 void assign_triggers(error_trigger_t soft, error_trigger_t hard, error_trigger_t fatal);
45 int get_error();
51 static void set_system_error(int to_code);
52
53 private:
60 bool _new_error(int working_error_code);
61
62 Exo* _exo;
63 ExoData* _data;
64
65 bool _set_handlers;
66 bool _set_triggers;
67
68 error_handler_t _soft_handler = NULL;
69 error_handler_t _hard_handler = NULL;
70 error_handler_t _fatal_handler = NULL;
71
72 error_trigger_t _soft_trigger = NULL;
73 error_trigger_t _hard_trigger = NULL;
74 error_trigger_t _fatal_trigger = NULL;
75
76 static int _system_error_code; /* Used to pass errors from other system modules*/
77 static int _reported_error_code; /* Used to pass errors from other system modules*/
78};
79
80#endif
81
82#endif // defined(ARDUINO_TEENSY36) || defined(ARDUINO_TEENSY41)
Class to store all the data related to the exo.
Definition ExoData.h:38