Skip to content

Commit 6498354

Browse files
authored
Merge pull request #470 from tekka007/FixIndication
Fix MyIndication definitions
2 parents 4509df4 + 2d3b945 commit 6498354

File tree

5 files changed

+17
-10
lines changed

5 files changed

+17
-10
lines changed

libraries/MySensors/core/MyLeds.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
static uint8_t countRx;
2727
static uint8_t countTx;
2828
static uint8_t countErr;
29-
static unsigned long prevTime = millis() - LED_PROCESS_INTERVAL_MS; // Substract some, to make sure leds gets updated on first run.
29+
static unsigned long prevTime = hwMillis() - LED_PROCESS_INTERVAL_MS; // Substract some, to make sure leds gets updated on first run.
3030

3131

3232
inline void ledsInit()

libraries/MySensors/core/MyOTAFirmwareUpdate.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ inline void firmwareOTAUpdateRequest() {
3838
debug(PSTR("fw upd fail\n"));
3939
// Give up. We have requested MY_OTA_RETRY times without any packet in return.
4040
_fwUpdateOngoing = false;
41-
ledBlinkErr(1);
4241
return;
4342
}
4443
_fwRetry--;
@@ -58,7 +57,7 @@ inline bool firmwareOTAUpdateProcess() {
5857
NodeFirmwareConfig *firmwareConfigResponse = (NodeFirmwareConfig *)_msg.data;
5958
// compare with current node configuration, if they differ, start fw fetch process
6059
if (memcmp(&_fc,firmwareConfigResponse,sizeof(NodeFirmwareConfig))) {
61-
setIndication(INDICATION_FW_START);
60+
setIndication(INDICATION_FW_UPDATE_START);
6261
debug(PSTR("fw update\n"));
6362
// copy new FW config
6463
memcpy(&_fc,firmwareConfigResponse,sizeof(NodeFirmwareConfig));
@@ -84,7 +83,7 @@ inline bool firmwareOTAUpdateProcess() {
8483
} else if (_msg.type == ST_FIRMWARE_RESPONSE) {
8584
if (_fwUpdateOngoing) {
8685
// Save block to flash
87-
setIndication(INDICATION_FW_RX);
86+
setIndication(INDICATION_FW_UPDATE_RX);
8887
debug(PSTR("fw block %d\n"), _fwBlock);
8988
// extract FW block
9089
ReplyFWBlock *firmwareResponse = (ReplyFWBlock *)_msg.data;

libraries/MySensors/examples/BinarySwitchSensorIndication/BinarySwitchSensorIndication.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ static Adafruit_NeoPixel pixels = Adafruit_NeoPixel(1, NEO_PIN, NEO_GRB + NEO_KH
5454
// Change to V_LIGHT if you use S_LIGHT in presentation below
5555
MyMessage msg(CHILD_ID,V_TRIPPED);
5656

57-
#define BLINK_TIMES(x) (x<<4)
57+
#define BLINK_TIMES(x) ((x)<<4)
5858

5959
static uint8_t ledR = 0;
6060
static uint8_t ledG = 0;
6161
static uint8_t ledB = 0;
6262

63-
static void updateLed(void)
63+
void updateLed(void)
6464
{
6565
// Update the pattern (setting leds).
6666
if (ledR > 0) --ledR;

libraries/MySensors/examples/GatewayW5100/GatewayW5100.ino

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,12 @@
6565
#endif
6666

6767
// When W5100 is connected we have to move CE/CSN pins for NRF radio
68-
#define MY_RF24_CE_PIN 5
69-
#define MY_RF24_CS_PIN 6
68+
#ifndef MY_RF24_CE_PIN
69+
#define MY_RF24_CE_PIN 5
70+
#endif
71+
#ifndef MY_RF24_CS_PIN
72+
#define MY_RF24_CS_PIN 6
73+
#endif
7074

7175
// Enable to UDP
7276
//#define MY_USE_UDP

libraries/MySensors/examples/GatewayW5100MQTTClient/GatewayW5100MQTTClient.ino

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,12 @@
8989
#endif
9090

9191
// When W5100 is connected we have to move CE/CSN pins for NRF radio
92-
#define MY_RF24_CE_PIN 5
93-
#define MY_RF24_CS_PIN 6
92+
#ifndef MY_RF24_CE_PIN
93+
#define MY_RF24_CE_PIN 5
94+
#endif
95+
#ifndef MY_RF24_CS_PIN
96+
#define MY_RF24_CS_PIN 6
97+
#endif
9498

9599
// Enable these if your MQTT broker requires usenrame/password
96100
//#define MY_MQTT_USER "username"

0 commit comments

Comments
 (0)