From d8b8facdd0462c280d92bae7b792924cd6647c48 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 24 Jul 2021 17:07:30 +1000 Subject: [PATCH] HAL_ChibiOS: fixed off by 1 bug in GPIO check --- libraries/AP_HAL_ChibiOS/GPIO.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_HAL_ChibiOS/GPIO.cpp b/libraries/AP_HAL_ChibiOS/GPIO.cpp index 39be31eb3b..e24c24729a 100644 --- a/libraries/AP_HAL_ChibiOS/GPIO.cpp +++ b/libraries/AP_HAL_ChibiOS/GPIO.cpp @@ -80,7 +80,7 @@ void GPIO::init() for (uint8_t i=0; ipwm_num != 0) { - g->enabled = SRV_Channels::is_GPIO(g->pwm_num+chan_offset); + g->enabled = SRV_Channels::is_GPIO((g->pwm_num-1)+chan_offset); } } #endif // HAL_BOOTLOADER_BUILD