--- /dev/null
+#ifndef __ERRORS_H__
+#define __ERRORS_H__
+
+enum ErrorIds_t {
+ ERROR_Application_Starting = 0
+ ,ERROR_Eeprom_Read_Invalid_Length = 1
+ ,ERROR_Eeprom_Read_Invalid_Address = 2
+ ,ERROR_Eeprom_Write_Invalid_Length = 3
+ ,ERROR_Eeprom_Write_Invalid_Address = 4
+ ,ERROR_MAX = 5
+};
+#endif
-#ifndef POWERSWITCHPARAMETERTABLE_H__
-#define POWERSWITCHPARAMETERTABLE_H__
+#ifndef __PARAMETERTABLE_H__
+#define __PARAMETERTABLE_H__
#include "Metadata/Metadata.h"
+#ifdef POWERSWITCH_PARAMETERS
+#include <Metadata/PowerswitchParamIds.h>
+#elif defined(WORKMETER_PARAMETERS)
+#include <Metadata/WorkMeterParamIds.h>
+#elif defined(DCMOTOR_PARAMETERS)
+#include <Metadata/DCMotorParamIds.h>
+#elif defined(SHUTTERCTRL_PARAMETERS)
+#include <Metadata/ShutterCtrlParamIds.h>
+#endif
+
extern
ParameterValue m_Values[PID_MAX];
#endif
ParameterHandler.cpp
PersistentStorage.cpp
RFIDReader/RFIDReaderHandler.cpp
+ ErrorHandler/ErrorHandler.cpp
)
set_target_properties(
+++ /dev/null
-#ifndef __ERROR_HANDLER_H__
-#define __ERROR_HANDLER_H__
-
-/**
- * \brief good, lets implement basic error handler
- * that reports the error through the serial communication
- * May be I have to got through the communication handler
- *
- *
- */
-class ErrorHandler : public IErrorHandler , public ITask
-{
- public:
- ErrorHandler();
- /// Method available to modules so that errors can be reported
- virtual void setError(Uint16_t _error);
- /// Alright process some stuff in case an errors has been raised
- virtual void run();
-};
-
-#endif
--- /dev/null
+#include <Utils/StdTypes.h>
+
+#include <Platform/IParameterHandler.h>
+
+#include <Metadata/ParameterTable.h>
+
+#include "IErrorHandler.h"
+#include "ErrorHandler.h"
+
+static Uint8_t m_PID_Errors[ERROR_VECTORS] = {PID_LowLevelError1,PID_LowLevelError2};
+static Uint32_t m_LowLevelErrors[ERROR_VECTORS] {0,0};
+
+
+void ErrorHandler::ErrorHandler()
+{
+}
+
+void ErrorHandler::run()
+{
+ updateErrors();
+}
+
+void ErrorHandler::setError(Error_t _err)
+{
+ Uint16_t _offset = 0;
+ Uint8_t _vect = 0;
+ Bool_t _found = false;
+ while (!_found && (_vect < ERROR_VECTOR) )
+ {
+ if (_err < (offset + 32))
+ {
+ Uint32_t _errorBit = static_cast<Uin32_t>(1)<<(_err - ofsset);
+ m_LowLevelErrors[_vect] |=
+ _found = true;
+ }
+ offset+=32;
+ _vect++;
+ };
+}
+
+void ErrorHandler::updateErrors()
+{
+ for (Uint8_t i = 0; i < ERROR_VECTOR ; ++i)
+ {
+ m_Params->writeValue(m_PID_Errors[i],m_LowLevelErrors[i]);
+ m_LowLevelErrors[i] = 0L;
+ }
+}
+
--- /dev/null
+#ifndef __ERROR_HANDLER_H__
+#define __ERROR_HANDLER_H__
+
+#define ERROR_VECTORS 2
+/**
+ * \brief good, lets implement basic error handler
+ * that reports the error through the serial communication
+ * May be I have to got through the communication handler
+ *
+ *
+ */
+
+class ErrorHandler : public IErrorHandler , public ITask
+{
+ public:
+ ErrorHandler(IParameterHandler *argParams);
+ /// Method available to modules so that errors can be reported
+ virtual void setError(Uint16_t _error);
+ /// Alright process some stuff in case an errors has been raised
+ virtual void run();
+ private:
+ void updateErrors();
+ private:
+ static Uint8_t m_PID_Errors[ERROR_VECTORS];
+ static Uint32_t m_LowLevelErrors[ERROR_VECTORS];
+};
+
+#endif
--- /dev/null
+#ifndef __IERROR_HANDLER_H__
+#define __IERROR_HANDLER_H__
+
+/**
+ * \brief well, except setting an error, there is not mutch to be
+ * done there. The handler might eventually trigger the communication
+ * handler to report the error or what ever.
+ */
+class IErrorHandler
+{
+ public:
+ IErrorHandler() {};
+ ///
+ virtual setError(Uint16_t error_id) = 0 ;
+};
+#endif
+++ /dev/null
-#ifndef __ERRORS_H__
-#define __ERRORS_H__
-
-enum ErrorIds_t {
- ERROR_Application_Starting = 0
- ,ERROR_Eeprom_Read_Invalid_Length = 1
- ,ERROR_Eeprom_Read_Invalid_Address = 2
- ,ERROR_Eeprom_Write_Invalid_Length = 3
- ,ERROR_Eeprom_Write_Invalid_Address = 4
- ,ERROR_MAX = 5
-};
-#endif
+++ /dev/null
-#ifndef __IERROR_HANDLER_H__
-#define __IERROR_HANDLER_H__
-
-/**
- * \brief well, except setting an error, there is not mutch to be
- * done there. The handler might eventually trigger the communication
- * handler to report the error or what ever.
- */
-class IErrorHandler
-{
- public:
- IErrorHandler() {};
- ///
- virtual setError(Uint16_t error_id) = 0 ;
-};
-#endif