From 1064bf28f7d7f0194b11e89693d2f14e89ccce0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Cab=C3=A9?= Date: Tue, 13 Oct 2026 21:17:50 +0000 Subject: [PATCH] fix(safety_button): blink the 16 bits of each safety LED pattern MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The driver runs at 30 Hz and shows each bit of the 16-bit LED pattern for 3 runs, as the PX4IO firmware shows one per run at 10 Hz, but it restarted the pattern after 46 runs instead of 48: the last bit lasted one run instead of three, and each pattern 1.52 s instead of 1.58 s. Assisted-by: Claude:opus-5.5 Signed-off-by: Benjamin Cabé --- src/drivers/safety_button/SafetyButton.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers/safety_button/SafetyButton.cpp b/src/drivers/safety_button/SafetyButton.cpp index 48673154923..c13aee3c0e4 100644 --- a/src/drivers/safety_button/SafetyButton.cpp +++ b/src/drivers/safety_button/SafetyButton.cpp @@ -146,7 +146,7 @@ SafetyButton::FlashButton() // Turn the LED on if we have a 1 at the current bit position px4_arch_gpiowrite(GPIO_LED_SAFETY, !((uint16_t)pattern & (1 << (_blink_counter++ / 3)))); - if (_blink_counter > 45) { + if (_blink_counter >= 48) { _blink_counter = 0; } }