feat: disable pico led real time

This commit is contained in:
awalol
2026-05-05 18:53:24 +08:00
parent a887c6fb39
commit 5c815299ad
+6
View File
@@ -10,6 +10,7 @@
#include "utils.h" #include "utils.h"
#include "hardware/flash.h" #include "hardware/flash.h"
#include "hardware/sync.h" #include "hardware/sync.h"
#include "pico/cyw43_arch.h"
constexpr uint32_t CONFIG_MAGIC = 0x66ccff00; constexpr uint32_t CONFIG_MAGIC = 0x66ccff00;
constexpr uint16_t CONFIG_VERSION = 1; constexpr uint16_t CONFIG_VERSION = 1;
@@ -115,4 +116,9 @@ void set_config(const uint8_t *new_config, const uint16_t len) {
const auto copy_len = len < sizeof(Config_body) ? len : sizeof(Config_body); const auto copy_len = len < sizeof(Config_body) ? len : sizeof(Config_body);
memcpy(&config.body, new_config, copy_len); memcpy(&config.body, new_config, copy_len);
config_valid(); config_valid();
if (config.body.disable_pico_led) {
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, false);
}else {
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, true);
}
} }