diff --git a/libraries/MySensors/core/MyLeds.cpp b/libraries/MySensors/core/MyLeds.cpp index fd0a541..2974c18 100644 --- a/libraries/MySensors/core/MyLeds.cpp +++ b/libraries/MySensors/core/MyLeds.cpp @@ -26,7 +26,7 @@ static uint8_t countRx; static uint8_t countTx; static uint8_t countErr; -static unsigned long prevTime = millis() - LED_PROCESS_INTERVAL_MS; // Substract some, to make sure leds gets updated on first run. +static unsigned long prevTime = hwMillis() - LED_PROCESS_INTERVAL_MS; // Substract some, to make sure leds gets updated on first run. inline void ledsInit() diff --git a/libraries/MySensors/core/MyOTAFirmwareUpdate.cpp b/libraries/MySensors/core/MyOTAFirmwareUpdate.cpp index 419802f..73f7488 100644 --- a/libraries/MySensors/core/MyOTAFirmwareUpdate.cpp +++ b/libraries/MySensors/core/MyOTAFirmwareUpdate.cpp @@ -38,7 +38,6 @@ inline void firmwareOTAUpdateRequest() { debug(PSTR("fw upd fail\n")); // Give up. We have requested MY_OTA_RETRY times without any packet in return. _fwUpdateOngoing = false; - ledBlinkErr(1); return; } _fwRetry--; @@ -58,7 +57,7 @@ inline bool firmwareOTAUpdateProcess() { NodeFirmwareConfig *firmwareConfigResponse = (NodeFirmwareConfig *)_msg.data; // compare with current node configuration, if they differ, start fw fetch process if (memcmp(&_fc,firmwareConfigResponse,sizeof(NodeFirmwareConfig))) { - setIndication(INDICATION_FW_START); + setIndication(INDICATION_FW_UPDATE_START); debug(PSTR("fw update\n")); // copy new FW config memcpy(&_fc,firmwareConfigResponse,sizeof(NodeFirmwareConfig)); @@ -84,7 +83,7 @@ inline bool firmwareOTAUpdateProcess() { } else if (_msg.type == ST_FIRMWARE_RESPONSE) { if (_fwUpdateOngoing) { // Save block to flash - setIndication(INDICATION_FW_RX); + setIndication(INDICATION_FW_UPDATE_RX); debug(PSTR("fw block %d\n"), _fwBlock); // extract FW block ReplyFWBlock *firmwareResponse = (ReplyFWBlock *)_msg.data; diff --git a/libraries/MySensors/examples/BinarySwitchSensorIndication/BinarySwitchSensorIndication.ino b/libraries/MySensors/examples/BinarySwitchSensorIndication/BinarySwitchSensorIndication.ino index 1c1eb63..e5cd08d 100644 --- a/libraries/MySensors/examples/BinarySwitchSensorIndication/BinarySwitchSensorIndication.ino +++ b/libraries/MySensors/examples/BinarySwitchSensorIndication/BinarySwitchSensorIndication.ino @@ -54,13 +54,13 @@ static Adafruit_NeoPixel pixels = Adafruit_NeoPixel(1, NEO_PIN, NEO_GRB + NEO_KH // Change to V_LIGHT if you use S_LIGHT in presentation below MyMessage msg(CHILD_ID,V_TRIPPED); -#define BLINK_TIMES(x) (x<<4) +#define BLINK_TIMES(x) ((x)<<4) static uint8_t ledR = 0; static uint8_t ledG = 0; static uint8_t ledB = 0; -static void updateLed(void) +void updateLed(void) { // Update the pattern (setting leds). if (ledR > 0) --ledR; diff --git a/libraries/MySensors/examples/GatewayW5100/GatewayW5100.ino b/libraries/MySensors/examples/GatewayW5100/GatewayW5100.ino index d634db9..9ea570e 100644 --- a/libraries/MySensors/examples/GatewayW5100/GatewayW5100.ino +++ b/libraries/MySensors/examples/GatewayW5100/GatewayW5100.ino @@ -65,8 +65,12 @@ #endif // When W5100 is connected we have to move CE/CSN pins for NRF radio -#define MY_RF24_CE_PIN 5 -#define MY_RF24_CS_PIN 6 +#ifndef MY_RF24_CE_PIN + #define MY_RF24_CE_PIN 5 +#endif +#ifndef MY_RF24_CS_PIN + #define MY_RF24_CS_PIN 6 +#endif // Enable to UDP //#define MY_USE_UDP diff --git a/libraries/MySensors/examples/GatewayW5100MQTTClient/GatewayW5100MQTTClient.ino b/libraries/MySensors/examples/GatewayW5100MQTTClient/GatewayW5100MQTTClient.ino index 37c8f26..8ab8fae 100644 --- a/libraries/MySensors/examples/GatewayW5100MQTTClient/GatewayW5100MQTTClient.ino +++ b/libraries/MySensors/examples/GatewayW5100MQTTClient/GatewayW5100MQTTClient.ino @@ -89,8 +89,12 @@ #endif // When W5100 is connected we have to move CE/CSN pins for NRF radio -#define MY_RF24_CE_PIN 5 -#define MY_RF24_CS_PIN 6 +#ifndef MY_RF24_CE_PIN + #define MY_RF24_CE_PIN 5 +#endif +#ifndef MY_RF24_CS_PIN + #define MY_RF24_CS_PIN 6 +#endif // Enable these if your MQTT broker requires usenrame/password //#define MY_MQTT_USER "username"