Skip to content

Commit 8580d77

Browse files
committed
imxrt10xx: fix LED blinking
The LED write routine is meant to take a value between 0 for off and 255 for full brightness. the current 10xx port treats 0 as off, and anything else as on. This creates a case where the LED is on virtually all the time, except for a tiny blink off every 256 timer intervals. (this is for non-pwm, simple LEDs) This fix makes (value >= 128) is ON and (value < 128) off, and the LED looks right.
1 parent d25c462 commit 8580d77

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

ports/mimxrt10xx/boards.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,6 @@ void SysTick_Handler(void)
262262

263263
void board_led_write(uint32_t value)
264264
{
265-
(void) value;
266-
267265
#ifdef LED_PINMUX
268266
#ifdef LED_PWM_PINMUX
269267
if (_dfu_mode)
@@ -274,6 +272,7 @@ void board_led_write(uint32_t value)
274272
}else
275273
#endif
276274
{
275+
value = (value >= 128) ? 1 : 0;
277276
GPIO_PinWrite(LED_PORT, LED_PIN, value ? LED_STATE_ON : (1-LED_STATE_ON));
278277
}
279278
#endif

0 commit comments

Comments
 (0)