Skip to content

Commit ff9f228

Browse files
FreeRTOS compilation fix when no LED present (earlephilhower#1413)
Fixes earlephilhower#1412
1 parent f33dfd2 commit ff9f228

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

libraries/FreeRTOS/keywords.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# https://arduino.github.io/arduino-cli/library-specification/#keywords
33
# Formatted by a single true tab (not spaces)
44

5+
FreeRTOS KEYWORD1
6+
57
# Datatypes (KEYWORD1)
68
StackType_t KEYWORD1
79
BaseType_t KEYWORD1

libraries/FreeRTOS/src/variantHooks.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,16 +216,20 @@ void vApplicationTickHook(void) {
216216
Private function to enable board led to use it in application hooks
217217
*/
218218
void prvSetMainLedOn(void) {
219+
#ifdef LED_BUILTIN
219220
gpio_init(LED_BUILTIN);
220221
gpio_set_dir(LED_BUILTIN, true);
221222
gpio_put(LED_BUILTIN, true);
223+
#endif
222224
}
223225

224226
/**
225227
Private function to blink board led to use it in application hooks
226228
*/
227229
void prvBlinkMainLed(void) {
230+
#ifdef LED_BUILTIN
228231
gpio_put(LED_BUILTIN, !gpio_get(LED_BUILTIN));
232+
#endif
229233
}
230234

231235
#endif

variants/generic/common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
#define NUM_ANALOG_OUTPUTS (0u)
77
#define ADC_RESOLUTION (12u)
88

9+
#ifdef PIN_LED
910
#define LED_BUILTIN PIN_LED
11+
#endif
1012

1113
static const uint8_t D0 = (0u);
1214
static const uint8_t D1 = (1u);

0 commit comments

Comments
 (0)