LED color change
This commit is contained in:
parent
ec024b4676
commit
ebfc16219b
11
src/led.cpp
11
src/led.cpp
@ -122,7 +122,18 @@ void ledLoop(void *parameter) {
|
|||||||
LEDState =
|
LEDState =
|
||||||
((millis() % 200) < 20) ? LED_ON : LED_OFF; // TX data pending
|
((millis() % 200) < 20) ? LED_ON : LED_OFF; // TX data pending
|
||||||
} else if (LMIC.opmode & (OP_TXDATA | OP_TXRXPEND)) {
|
} else if (LMIC.opmode & (OP_TXDATA | OP_TXRXPEND)) {
|
||||||
|
// select color to blink by message port
|
||||||
|
switch (LMIC.pendTxPort) {
|
||||||
|
case STATUSPORT:
|
||||||
|
LEDColor = COLOR_RED;
|
||||||
|
break;
|
||||||
|
case CONFIGPORT:
|
||||||
|
LEDColor = COLOR_CYAN;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
LEDColor = COLOR_BLUE;
|
LEDColor = COLOR_BLUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
// small blink 10ms on each 1/2sec (not when joining)
|
// small blink 10ms on each 1/2sec (not when joining)
|
||||||
LEDState = ((millis() % 500) < 10) ? LED_ON : LED_OFF;
|
LEDState = ((millis() % 500) < 10) ? LED_ON : LED_OFF;
|
||||||
// This should not happen so indicate a problem
|
// This should not happen so indicate a problem
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
#define COUNTERPORT 1 // Port on which device sends counts
|
#define COUNTERPORT 1 // Port on which device sends counts
|
||||||
#define RCMDPORT 2 // Port on which device listenes for remote commands
|
#define RCMDPORT 2 // Port on which device listenes for remote commands
|
||||||
#define STATUSPORT 2 // Port on which device sends remote command results
|
#define STATUSPORT 2 // Port on which device sends remote command results
|
||||||
#define CONFIGPORT 3 // Port on which device sends gps query results
|
#define CONFIGPORT 3 // Port on which device sends config query results
|
||||||
#define GPSPORT 4 // Port on which device sends gps query results
|
#define GPSPORT 4 // Port on which device sends gps query results
|
||||||
#define BUTTONPORT 5 // Port on which device sends button pressed signal
|
#define BUTTONPORT 5 // Port on which device sends button pressed signal
|
||||||
#define LPP1PORT 1 // Port for Cayenne LPP 1.0 dynamic sensor encoding
|
#define LPP1PORT 1 // Port for Cayenne LPP 1.0 dynamic sensor encoding
|
||||||
|
Loading…
Reference in New Issue
Block a user