From 01cac75c76cbf1899834ef17eb2245bed856f633 Mon Sep 17 00:00:00 2001 From: bugobliterator Date: Wed, 1 Nov 2023 12:39:45 +1100 Subject: [PATCH] AP_Periph: fix LED_CONNECTED_BRIGHTNESS --- AP_Periph/AP_Periph.h | 2 +- AP_Periph/GPS_Base.cpp | 2 +- AP_Periph/notify.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/AP_Periph/AP_Periph.h b/AP_Periph/AP_Periph.h index 61af51f..7ff63d1 100644 --- a/AP_Periph/AP_Periph.h +++ b/AP_Periph/AP_Periph.h @@ -42,7 +42,7 @@ #include "Parameters.h" -#define LED_CONNECTED_BRIGHTNESS 0.1f +#define LED_CONNECTED_BRIGHTNESS 10 // 10% #if CONFIG_HAL_BOARD == HAL_BOARD_SITL void stm32_watchdog_init(); diff --git a/AP_Periph/GPS_Base.cpp b/AP_Periph/GPS_Base.cpp index 8c4b8b7..1d4838b 100644 --- a/AP_Periph/GPS_Base.cpp +++ b/AP_Periph/GPS_Base.cpp @@ -586,7 +586,7 @@ void GPS_Base::update_leds() } auto serial_led = AP_SerialLED::get_singleton(); bool no_lock = !_ppk_config_finished || _start_mean_acc == 0; - const float brightness = hal.gpio->usb_connected() ? LED_CONNECTED_BRIGHTNESS : periph.notify.get_rgb_led_brightness_percent() * 0.01f; + const float brightness = (hal.gpio->usb_connected() ? LED_CONNECTED_BRIGHTNESS : periph.notify.get_rgb_led_brightness_percent()) * 0.01f; if (no_lock && !curr_svin.valid) { // set all the leds to yellow while configuring for (uint8_t i=0; iusb_connected() ? LED_CONNECTED_BRIGHTNESS : notify.get_rgb_led_brightness_percent() * 0.01f; + float brightness = (hal.gpio->usb_connected() ? LED_CONNECTED_BRIGHTNESS : notify.get_rgb_led_brightness_percent()) * 0.01f; for (uint8_t n=0; n<4; n++) { uint8_t i = (step + n) % nsteps; notify.handle_rgb(rgb_rainbow[i].red*brightness,