Skip to content

Commit

Permalink
AP_Periph: fix LED_CONNECTED_BRIGHTNESS
Browse files Browse the repository at this point in the history
  • Loading branch information
bugobliterator committed Nov 1, 2023
1 parent de78bde commit 01cac75
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion AP_Periph/AP_Periph.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion AP_Periph/GPS_Base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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; i<periph.notify.get_led_len(); i++) {
Expand Down
2 changes: 1 addition & 1 deletion AP_Periph/notify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void AP_Periph_FW::update_rainbow()
last_update_ms = now;
static uint8_t step;
const uint8_t nsteps = ARRAY_SIZE(rgb_rainbow);
float brightness = hal.gpio->usb_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,
Expand Down

0 comments on commit 01cac75

Please sign in to comment.