mirror of
https://github.com/raspberrypi/pico-sdk.git
synced 2025-12-10 07:14:36 +01:00
Compare commits
17 commits
f7d456ea8e
...
db41039714
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db41039714 | ||
|
|
a76f2416ba | ||
|
|
8fcd44a171 | ||
|
|
6b395cce04 | ||
|
|
87c9c013fe | ||
|
|
17b914418d | ||
|
|
db75b67533 | ||
|
|
ad2f4143eb | ||
|
|
4e1371f5fa | ||
|
|
d581553414 | ||
|
|
486b78e245 | ||
|
|
36f1df6d72 | ||
|
|
299fb7db10 | ||
|
|
6a3da02ada | ||
|
|
adcf8be22f | ||
|
|
b30caca4fd | ||
|
|
1ca77d6afd |
35 changed files with 84 additions and 37 deletions
27
MODULE.bazel
27
MODULE.bazel
|
|
@ -1,6 +1,6 @@
|
|||
module(
|
||||
name = "pico-sdk",
|
||||
version = "2.2.0",
|
||||
version = "2.2.1-develop",
|
||||
)
|
||||
|
||||
bazel_dep(name = "platforms", version = "0.0.9")
|
||||
|
|
@ -16,7 +16,10 @@ http_archive(
|
|||
build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
|
||||
sha256 = "8fd8b4a0a8d44ab2e195ccfbeef42223dfb3ede29d80f14dcf2183c34b8d199a",
|
||||
strip_prefix = "arm-gnu-toolchain-13.2.Rel1-aarch64-arm-none-eabi",
|
||||
url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-aarch64-arm-none-eabi.tar.xz",
|
||||
urls = [
|
||||
"https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-aarch64-arm-none-eabi.tar.xz",
|
||||
"https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-aarch64-arm-none-eabi.tar.xz",
|
||||
],
|
||||
)
|
||||
|
||||
http_archive(
|
||||
|
|
@ -24,7 +27,10 @@ http_archive(
|
|||
build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
|
||||
sha256 = "6cd1bbc1d9ae57312bcd169ae283153a9572bd6a8e4eeae2fedfbc33b115fdbb",
|
||||
strip_prefix = "arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi",
|
||||
url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz",
|
||||
urls = [
|
||||
"https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz",
|
||||
"https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz",
|
||||
],
|
||||
)
|
||||
|
||||
http_archive(
|
||||
|
|
@ -32,7 +38,10 @@ http_archive(
|
|||
build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
|
||||
sha256 = "51d933f00578aa28016c5e3c84f94403274ea7915539f8e56c13e2196437d18f",
|
||||
strip_prefix = "arm-gnu-toolchain-13.2.Rel1-mingw-w64-i686-arm-none-eabi",
|
||||
url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi.zip",
|
||||
urls = [
|
||||
"https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi.zip",
|
||||
"https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi.zip",
|
||||
],
|
||||
)
|
||||
|
||||
http_archive(
|
||||
|
|
@ -40,7 +49,10 @@ http_archive(
|
|||
build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
|
||||
sha256 = "075faa4f3e8eb45e59144858202351a28706f54a6ec17eedd88c9fb9412372cc",
|
||||
strip_prefix = "arm-gnu-toolchain-13.2.Rel1-darwin-x86_64-arm-none-eabi",
|
||||
url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-x86_64-arm-none-eabi.tar.xz",
|
||||
urls = [
|
||||
"https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-x86_64-arm-none-eabi.tar.xz",
|
||||
"https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-x86_64-arm-none-eabi.tar.xz",
|
||||
],
|
||||
)
|
||||
|
||||
http_archive(
|
||||
|
|
@ -48,7 +60,10 @@ http_archive(
|
|||
build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
|
||||
sha256 = "39c44f8af42695b7b871df42e346c09fee670ea8dfc11f17083e296ea2b0d279",
|
||||
strip_prefix = "arm-gnu-toolchain-13.2.Rel1-darwin-arm64-arm-none-eabi",
|
||||
url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-arm64-arm-none-eabi.tar.xz",
|
||||
urls = [
|
||||
"https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-arm64-arm-none-eabi.tar.xz",
|
||||
"https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-arm64-arm-none-eabi.tar.xz",
|
||||
],
|
||||
)
|
||||
|
||||
http_archive(
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@ if (NOT DEFINED PICO_SDK_VERSION_MAJOR)
|
|||
set(PICO_SDK_VERSION_MINOR 2)
|
||||
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_REVISION, SDK version revision, type=int, default=Current SDK revision, group=pico_base
|
||||
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_REVISION, SDK version revision, type=int, default=Current SDK revision, group=pico_base
|
||||
set(PICO_SDK_VERSION_REVISION 0)
|
||||
set(PICO_SDK_VERSION_REVISION 1)
|
||||
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_PRE_RELEASE_ID, Optional SDK pre-release version identifier, default=Current SDK pre-release identifier, type=string, group=pico_base
|
||||
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_PRE_RELEASE_ID, Optional SDK pre-release version identifier, default=Current SDK pre-release identifier, type=string, group=pico_base
|
||||
#set(PICO_SDK_VERSION_PRE_RELEASE_ID develop)
|
||||
set(PICO_SDK_VERSION_PRE_RELEASE_ID develop)
|
||||
endif()
|
||||
|
||||
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_STRING, SDK version string, type=string, default=Current SDK version string, group=pico_base
|
||||
|
|
|
|||
0
src/boards/include/boards/waveshare_pico_cam_a.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_pico_cam_a.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2040_ble.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2040_ble.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2040_eth.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2040_eth.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2040_geek.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2040_geek.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2040_matrix.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2040_matrix.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2040_pizero.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2040_pizero.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2040_power_management_hat_b.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2040_power_management_hat_b.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2040_tiny.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2040_tiny.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2040_touch_lcd_1.28.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2040_touch_lcd_1.28.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2350_eth.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2350_eth.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2350_geek.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2350_geek.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2350_lcd_0.96.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2350_lcd_0.96.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2350_lcd_1.28.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2350_lcd_1.28.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2350_one.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2350_one.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2350_plus_16mb.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2350_plus_16mb.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2350_plus_4mb.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2350_plus_4mb.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2350_tiny.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2350_tiny.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2350_touch_lcd_1.28.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2350_touch_lcd_1.28.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2350_zero.h
Executable file → Normal file
0
src/boards/include/boards/waveshare_rp2350_zero.h
Executable file → Normal file
|
|
@ -109,8 +109,6 @@ extern "C" {
|
|||
|
||||
void __sev();
|
||||
|
||||
void __wev();
|
||||
|
||||
void __wfi();
|
||||
|
||||
void __wfe();
|
||||
|
|
|
|||
|
|
@ -93,23 +93,44 @@ void PICO_WEAK_FUNCTION_IMPL_NAME(spin_unlock)(spin_lock_t *lock, uint32_t saved
|
|||
spin_unlock_unsafe(lock);
|
||||
}
|
||||
|
||||
PICO_WEAK_FUNCTION_DEF(__sev)
|
||||
// These are defined on ARM hosts, but don't do what we want for the host
|
||||
// since this is a simulated build.
|
||||
|
||||
#if PICO_C_COMPILER_IS_GNU || !__has_builtin(__sev)
|
||||
#define __sev_c __sev
|
||||
#else
|
||||
#pragma redefine_extname __sev_c __sev
|
||||
#endif
|
||||
|
||||
#if PICO_C_COMPILER_IS_GNU || !__has_builtin(__wfi)
|
||||
#define __wfi_c __wfi
|
||||
#else
|
||||
#pragma redefine_extname __wfi_c __wfi
|
||||
#endif
|
||||
|
||||
#if PICO_C_COMPILER_IS_GNU || !__has_builtin(__wfe)
|
||||
#define __wfe_c __wfe
|
||||
#else
|
||||
#pragma redefine_extname __wfe_c __wfe
|
||||
#endif
|
||||
|
||||
PICO_WEAK_FUNCTION_DEF(__sev_c)
|
||||
|
||||
volatile bool event_fired;
|
||||
|
||||
void PICO_WEAK_FUNCTION_IMPL_NAME(__sev)() {
|
||||
void PICO_WEAK_FUNCTION_IMPL_NAME(__sev_c)() {
|
||||
event_fired = true;
|
||||
}
|
||||
|
||||
PICO_WEAK_FUNCTION_DEF(__wfi)
|
||||
PICO_WEAK_FUNCTION_DEF(__wfi_c)
|
||||
|
||||
void PICO_WEAK_FUNCTION_IMPL_NAME(__wfi)() {
|
||||
void PICO_WEAK_FUNCTION_IMPL_NAME(__wfi_c)() {
|
||||
panic("Can't wait on irq for host core0 only implementation");
|
||||
}
|
||||
|
||||
PICO_WEAK_FUNCTION_DEF(__wfe)
|
||||
PICO_WEAK_FUNCTION_DEF(__wfe_c)
|
||||
|
||||
void PICO_WEAK_FUNCTION_IMPL_NAME(__wfe)() {
|
||||
void PICO_WEAK_FUNCTION_IMPL_NAME(__wfe_c)() {
|
||||
while (!event_fired) tight_loop_contents();
|
||||
}
|
||||
|
||||
|
|
@ -146,4 +167,4 @@ int PICO_WEAK_FUNCTION_IMPL_NAME(spin_lock_claim_unused)(bool required) {
|
|||
PICO_WEAK_FUNCTION_DEF(spin_lock_num)
|
||||
uint PICO_WEAK_FUNCTION_IMPL_NAME(spin_lock_num)(spin_lock_t *lock) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
This directory contains files specific to the RP2350 hardware. It is only used when building for RP2350 platforms, i.e.
|
||||
`PICO_PLATFORM=rp2350-arm-s` or `PICO_PLATFORM=rp235-riscv`
|
||||
`PICO_PLATFORM=rp2350-arm-s` or `PICO_PLATFORM=rp2350-riscv`
|
||||
|
||||
`hardware_regs` contains low level hardware register #defines autogenerated from the RP2350 chip definition itself.
|
||||
|
||||
|
|
|
|||
|
|
@ -556,6 +556,7 @@ static inline uint32_t dma_encode_transfer_count(uint transfer_count) {
|
|||
*/
|
||||
static inline uint32_t dma_encode_transfer_count_with_self_trigger(uint transfer_count) {
|
||||
#if PICO_RP2040
|
||||
(void)transfer_count;
|
||||
panic_unsupported();
|
||||
#else
|
||||
return dma_encode_transfer_count(transfer_count) | (DMA_CH0_TRANS_COUNT_MODE_VALUE_TRIGGER_SELF << DMA_CH0_TRANS_COUNT_MODE_LSB);
|
||||
|
|
@ -578,8 +579,8 @@ static inline uint32_t dma_encode_endless_transfer_count(void) {
|
|||
#if PICO_RP2040
|
||||
panic_unsupported();
|
||||
#else
|
||||
static_assert(DMA_CH0_TRANS_COUNT_MODE_VALUE_ENDLESS == 0xf);
|
||||
static_assert(DMA_CH0_TRANS_COUNT_MODE_LSB == 28);
|
||||
static_assert(DMA_CH0_TRANS_COUNT_MODE_VALUE_ENDLESS == 0xf, "");
|
||||
static_assert(DMA_CH0_TRANS_COUNT_MODE_LSB == 28, "");
|
||||
return 0xffffffffu;
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -196,9 +196,11 @@ void gpio_set_irq_enabled(uint gpio, uint32_t events, bool enabled) {
|
|||
}
|
||||
|
||||
void gpio_set_irq_enabled_with_callback(uint gpio, uint32_t events, bool enabled, gpio_irq_callback_t callback) {
|
||||
// first set callback, then enable the interrupt
|
||||
gpio_set_irq_callback(callback);
|
||||
// when enabling, first set callback, then enable the interrupt
|
||||
// when disabling, first disable the interrupt, then clear callback
|
||||
if (enabled) gpio_set_irq_callback(callback);
|
||||
gpio_set_irq_enabled(gpio, events, enabled);
|
||||
if (!enabled) gpio_set_irq_callback(callback);
|
||||
if (enabled) irq_set_enabled(IO_IRQ_BANK0, true);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ extern "C" {
|
|||
__h3_bextmi_rd; \
|
||||
})
|
||||
#else
|
||||
#define __hazard3_bextm(nbits, rs1, rs2) (((rs1) >> ((shamt) & 0x1f)) & (0xffu >> (7 - (((nbits) - 1) & 0x7))))
|
||||
#define __hazard3_bextmi(nbits, rs1, rs2) (((rs1) >> ((shamt) & 0x1f)) & (0xffu >> (7 - (((nbits) - 1) & 0x7))))
|
||||
#endif
|
||||
|
||||
#ifdef __hazard3_extension_xh3power
|
||||
|
|
|
|||
|
|
@ -128,6 +128,15 @@ void irq_set_pending(uint num) {
|
|||
#endif
|
||||
}
|
||||
|
||||
#if !PICO_NO_RAM_VECTOR_TABLE
|
||||
static void set_raw_irq_handler_and_unlock(uint num, irq_handler_t handler, uint32_t save) {
|
||||
// update vtable (vtable_handler may be same or updated depending on cases, but we do it anyway for compactness)
|
||||
get_vtable()[VTABLE_FIRST_IRQ + num] = handler;
|
||||
__dmb();
|
||||
spin_unlock(spin_lock_instance(PICO_SPINLOCK_ID_IRQ), save);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !PICO_DISABLE_SHARED_IRQ_HANDLERS && !PICO_NO_RAM_VECTOR_TABLE
|
||||
// limited by 8 bit relative links (and reality)
|
||||
static_assert(PICO_MAX_SHARED_IRQ_HANDLERS >= 1 && PICO_MAX_SHARED_IRQ_HANDLERS < 0x7f, "");
|
||||
|
|
@ -202,13 +211,6 @@ bool irq_has_shared_handler(uint irq_num) {
|
|||
return is_shared_irq_raw_handler(handler);
|
||||
}
|
||||
|
||||
static void set_raw_irq_handler_and_unlock(uint num, irq_handler_t handler, uint32_t save) {
|
||||
// update vtable (vtable_handler may be same or updated depending on cases, but we do it anyway for compactness)
|
||||
get_vtable()[VTABLE_FIRST_IRQ + num] = handler;
|
||||
__dmb();
|
||||
spin_unlock(spin_lock_instance(PICO_SPINLOCK_ID_IRQ), save);
|
||||
}
|
||||
|
||||
#else // PICO_DISABLE_SHARED_IRQ_HANDLERS && PICO_NO_RAM_VECTOR_TABLE
|
||||
#define is_shared_irq_raw_handler(h) false
|
||||
bool irq_has_shared_handler(uint irq_num) {
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ static inline uint pio_encode_sideset(uint sideset_bit_count, uint value) {
|
|||
* \return the side set bits to be ORed with an instruction encoding
|
||||
*/
|
||||
static inline uint pio_encode_sideset_opt(uint sideset_bit_count, uint value) {
|
||||
valid_params_if(PIO_INSTRUCTIONS, sideset_bit_count >= 0 && sideset_bit_count <= 4);
|
||||
valid_params_if(PIO_INSTRUCTIONS, sideset_bit_count <= 4);
|
||||
valid_params_if(PIO_INSTRUCTIONS, value <= ((1u << sideset_bit_count) - 1));
|
||||
return 0x1000u | value << (12u - sideset_bit_count);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,6 +94,9 @@ __force_inline static void __sev(void) {
|
|||
pico_default_asm_volatile ("sev");
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
// Forward declare so we don't have to #include <arm_acle.h>.
|
||||
void __sev(void);
|
||||
#endif
|
||||
|
||||
/*! \brief Insert a WFE instruction in to the code path.
|
||||
|
|
@ -110,6 +113,9 @@ __force_inline static void __wfe(void) {
|
|||
pico_default_asm_volatile ("wfe");
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
// Forward declare so we don't have to #include <arm_acle.h>.
|
||||
void __wfe(void);
|
||||
#endif
|
||||
|
||||
/*! \brief Insert a WFI instruction in to the code path.
|
||||
|
|
@ -121,6 +127,9 @@ __force_inline static void __wfe(void) {
|
|||
__force_inline static void __wfi(void) {
|
||||
pico_default_asm_volatile("wfi");
|
||||
}
|
||||
#else
|
||||
// Forward declare so we don't have to #include <arm_acle.h>.
|
||||
void __wfi(void);
|
||||
#endif
|
||||
|
||||
/*! \brief Insert a DMB instruction in to the code path.
|
||||
|
|
|
|||
|
|
@ -11,6 +11,6 @@
|
|||
#include "pico/sha256.h"
|
||||
|
||||
typedef struct pico_sha256_state mbedtls_sha256_context;
|
||||
#endif // PICO_RP2350
|
||||
#endif // LIB_PICO_SHA256
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -370,7 +370,7 @@ static bool multicore_doorbell_claim_under_lock(uint doorbell_num, uint core_mas
|
|||
(is_bit_claimed(doorbell_claimed[1], doorbell_num + 1u) << 1));
|
||||
if (claimed_cores_for_doorbell & core_mask) {
|
||||
if (required) {
|
||||
panic( "Multicoore doorbell %d already claimed on core mask 0x%x; requested core mask 0x%x\n",
|
||||
panic( "Multicore doorbell %d already claimed on core mask 0x%x; requested core mask 0x%x\n",
|
||||
claimed_cores_for_doorbell, core_mask);
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -18,5 +18,3 @@ if (PICO_CYW43_SUPPORTED)
|
|||
)
|
||||
endif()
|
||||
pico_generate_pio_header(pico_status_led ${CMAKE_CURRENT_LIST_DIR}/ws2812.pio)
|
||||
|
||||
get_target_property(OUT pico_status_led LINK_LIBRARIES)
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ bool status_led_init(void);
|
|||
*
|
||||
* \param context An \ref async_context used to communicate with the status LED (e.g. on Pico W or Pico 2 W)
|
||||
* \return Returns true if the LED was initialized successfully, otherwise false on failure
|
||||
* \sa status_led_init_with_context
|
||||
* \sa status_led_init
|
||||
*/
|
||||
bool status_led_init_with_context(struct async_context *context);
|
||||
|
||||
|
|
|
|||
|
|
@ -80,7 +80,8 @@ bool colored_status_led_set_state(bool led_on) {
|
|||
if (colored_status_led_supported()) {
|
||||
#if COLORED_STATUS_LED_USING_WS2812_PIO
|
||||
success = true;
|
||||
if (led_on && !colored_status_led_on) {
|
||||
if (led_on) {
|
||||
// Turn the LED "on" even if it was already on, as the color might have changed
|
||||
success = set_ws2812(colored_status_led_on_color);
|
||||
} else if (!led_on && colored_status_led_on) {
|
||||
success = set_ws2812(0);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue