Added production SensebenderGW sketch

preHwInit also added to hook into core startup
before hwInit is called
This commit is contained in:
Thomas Mørch
2016-08-02 23:39:18 +02:00
parent b293f47a7f
commit 3ba13f1c8c
3 changed files with 263 additions and 3 deletions
+4 -1
View File
@@ -66,8 +66,11 @@ void _infiniteLoop() {
void _begin() {
if (preHwInit)
preHwInit();
#if !defined(MY_DISABLED_SERIAL)
hwInit();
hwInit();
#endif
debug(PSTR("MCO:BGN:INIT " MY_NODE_TYPE ",CP=" MY_CAPABILITIES ",VER=" MYSENSORS_LIBRARY_VERSION "\n"));
+6 -2
View File
@@ -65,9 +65,9 @@
#include <stddef.h>
#include <stdarg.h>
#define GATEWAY_ADDRESS ((uint8_t)0) //!< Node ID for GW sketch
#define GATEWAY_ADDRESS ((uint8_t)0) //!< Node ID for GW sketch
#define NODE_SENSOR_ID 0xFF //!< Node child is always created/presented when a node is started
#define MY_CORE_VERSION ((uint8_t)2) //!< core version
#define MY_CORE_VERSION ((uint8_t)2) //!< core version
#define MY_CORE_MIN_VERSION ((uint8_t)2) //!< min core version required for compatibility
#ifdef MY_DEBUG
@@ -345,6 +345,10 @@ void presentation() __attribute__((weak));
*/
void before() __attribute__((weak));
/**
* @brief Called before any hwInitialization is done
*/
void preHwInit() __attribute__((weak));
/**
* @brief Called after node initialises but before main loop
*/
void setup() __attribute__((weak));