feat(pl18): Power LED charge status animation (#4503)
This commit is contained in:
@@ -50,9 +50,12 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
// common ADC driver
|
||||
// Common ADC driver
|
||||
extern const etx_hal_adc_driver_t _adc_driver;
|
||||
|
||||
// Common LED driver
|
||||
extern const stm32_pulse_timer_t _led_timer;
|
||||
|
||||
#if defined(SEMIHOSTING)
|
||||
extern "C" void initialise_monitor_handles();
|
||||
#endif
|
||||
@@ -88,6 +91,14 @@ void delay_self(int count)
|
||||
#define RCC_APB2PeriphMinimum (LCD_RCC_APB2Periph)
|
||||
#define RCC_APB2PeriphOther (HAPTIC_RCC_APB2Periph)
|
||||
|
||||
void ledStripOff()
|
||||
{
|
||||
for (uint8_t i = 0; i < LED_STRIP_LENGTH; i++) {
|
||||
ws2812_set_color(i, 0, 0, 0);
|
||||
}
|
||||
ws2812_update(&_led_timer);
|
||||
}
|
||||
|
||||
void boardInit()
|
||||
{
|
||||
#if defined(SEMIHOSTING)
|
||||
@@ -123,13 +134,8 @@ void boardInit()
|
||||
touchPanelInit();
|
||||
usbInit();
|
||||
|
||||
extern const stm32_pulse_timer_t _led_timer;
|
||||
|
||||
ws2812_init(&_led_timer, LED_STRIP_LENGTH);
|
||||
for (uint8_t i = 0; i < LED_STRIP_LENGTH; i++) {
|
||||
ws2812_set_color(i, 0, 0, 0);
|
||||
}
|
||||
ws2812_update(&_led_timer);
|
||||
ledStripOff();
|
||||
|
||||
uint32_t press_start = 0;
|
||||
uint32_t press_end = 0;
|
||||
@@ -204,6 +210,7 @@ void boardOff()
|
||||
rtcDisableBackupReg();
|
||||
|
||||
#if !defined(BOOT)
|
||||
ledStripOff();
|
||||
if (isChargerActive())
|
||||
{
|
||||
delay_ms(100); // Add a delay to wait for lcdOff
|
||||
|
||||
Reference in New Issue
Block a user