fix: led on esp32c2 devkit

This commit is contained in:
YuanMingFu
2025-05-08 11:30:39 +08:00
committed by InfiniteYuan
parent 7aa49f7325
commit 873e72abb2
3 changed files with 3 additions and 0 deletions
@@ -28,6 +28,7 @@ led_driver_config_t led_driver_get_config()
led_driver_config_t config = {
.gpio = LED_GPIO_PIN,
.channel = LED_CHANNEL,
.output_invert = 1,
};
return config;
}
+1
View File
@@ -47,6 +47,7 @@ led_driver_handle_t led_driver_init(led_driver_config_t *config)
.timer_sel = LEDC_TIMER_1,
.duty = 0,
.hpoint = 0,
.flags.output_invert = config->output_invert,
};
err = ledc_channel_config(&ledc_channel);
if (err != ESP_OK) {
@@ -23,6 +23,7 @@ extern "C" {
typedef struct {
int gpio;
int channel;
bool output_invert;
} led_driver_config_t;
typedef void *led_driver_handle_t;