Add debug output for before() and setup()

This commit is contained in:
tekka007
2016-08-09 21:03:18 +02:00
parent 67e720394e
commit e9b1ab287c
2 changed files with 6 additions and 1 deletions
+4 -1
View File
@@ -76,8 +76,10 @@ void _begin() {
debug(PSTR("MCO:BGN:INIT " MY_NODE_TYPE ",CP=" MY_CAPABILITIES ",VER=" MYSENSORS_LIBRARY_VERSION "\n")); debug(PSTR("MCO:BGN:INIT " MY_NODE_TYPE ",CP=" MY_CAPABILITIES ",VER=" MYSENSORS_LIBRARY_VERSION "\n"));
// Call before() in sketch (if it exists) // Call before() in sketch (if it exists)
if (before) if (before) {
debug(PSTR("MCO:BGN:BFR\n")); // before callback
before(); before();
}
#if defined(MY_LEDS_BLINKING_FEATURE) #if defined(MY_LEDS_BLINKING_FEATURE)
ledsInit(); ledsInit();
@@ -158,6 +160,7 @@ void _begin() {
// Call sketch setup // Call sketch setup
if (setup) { if (setup) {
debug(PSTR("MCO:BGN:STP\n")); // setup callback
setup(); setup();
} }
+2
View File
@@ -40,6 +40,8 @@
* |E| SYS | SUB | Message | Comment * |E| SYS | SUB | Message | Comment
* |-|------|-------|-------------------------------------------|---------------------------------------------------------------------------- * |-|------|-------|-------------------------------------------|----------------------------------------------------------------------------
* | | MCO | BGN | INIT %%s,CP=%%s,LIB=%%s | Core initialization, capabilities (CP), library version (VER) * | | MCO | BGN | INIT %%s,CP=%%s,LIB=%%s | Core initialization, capabilities (CP), library version (VER)
* | | MCO | BGN | BFR | Callback before()
* | | MCO | BGN | STP | Callback setup()
* | | MCO | BGN | INIT OK,ID=%%d,PAR=%%d,DIS=%%d,REG=%%d | Core initialized, parent ID (PAR), distance to GW (DIS), registration (REG) * | | MCO | BGN | INIT OK,ID=%%d,PAR=%%d,DIS=%%d,REG=%%d | Core initialized, parent ID (PAR), distance to GW (DIS), registration (REG)
* | | MCO | BGN | NODE UNLOCKED | Node successfully unlocked (see signing chapter) * | | MCO | BGN | NODE UNLOCKED | Node successfully unlocked (see signing chapter)
* |!| MCO | BGN | TSP FAIL | Transport initialization failed * |!| MCO | BGN | TSP FAIL | Transport initialization failed