switch to ESP32-H2
Signed-off-by: Peter Siegmund <mars3142@users.noreply.github.com>
This commit is contained in:
2
.vscode/c_cpp_properties.json
vendored
2
.vscode/c_cpp_properties.json
vendored
@@ -2,7 +2,7 @@
|
|||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
{
|
||||||
"name": "ESP-IDF",
|
"name": "ESP-IDF",
|
||||||
"compilerPath": "${config:idf.toolsPath}/tools/xtensa-esp-elf/esp-14.2.0_20241119/xtensa-esp-elf/bin/xtensa-esp32s3-elf-gcc",
|
"compilerPath": "${config:idf.toolsPath}/tools/riscv32-esp-elf/esp-14.2.0_20241119/riscv32-esp-elf/bin/riscv32-esp-elf-gcc",
|
||||||
"compileCommands": "${config:idf.buildPath}/compile_commands.json",
|
"compileCommands": "${config:idf.buildPath}/compile_commands.json",
|
||||||
"includePath": [
|
"includePath": [
|
||||||
"${config:idf.espIdfPath}/components/**",
|
"${config:idf.espIdfPath}/components/**",
|
||||||
|
@@ -14,8 +14,7 @@ static const char *TAG = "beacon";
|
|||||||
static SemaphoreHandle_t timer_semaphore;
|
static SemaphoreHandle_t timer_semaphore;
|
||||||
gptimer_handle_t gptimer = NULL;
|
gptimer_handle_t gptimer = NULL;
|
||||||
|
|
||||||
static const uint32_t value = 10;
|
static const uint32_t value = 200;
|
||||||
static const uint32_t mod = 2;
|
|
||||||
|
|
||||||
static bool IRAM_ATTR beacon_timer_callback(gptimer_handle_t timer, const gptimer_alarm_event_data_t *edata,
|
static bool IRAM_ATTR beacon_timer_callback(gptimer_handle_t timer, const gptimer_alarm_event_data_t *edata,
|
||||||
void *userCtx)
|
void *userCtx)
|
||||||
@@ -43,10 +42,7 @@ static void beacon_timer_event_task(void *arg)
|
|||||||
{
|
{
|
||||||
for (uint32_t i = 0; i < led_matrix.size; i++)
|
for (uint32_t i = 0; i < led_matrix.size; i++)
|
||||||
{
|
{
|
||||||
if (i % mod == 0)
|
led_strip_set_pixel(led_matrix.led_strip, i, 0, (level) ? value : 0, 0);
|
||||||
{
|
|
||||||
led_strip_set_pixel(led_matrix.led_strip, i, 0, (level) ? value : 0, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
led_strip_refresh(led_matrix.led_strip);
|
led_strip_refresh(led_matrix.led_strip);
|
||||||
}
|
}
|
||||||
|
@@ -2,10 +2,7 @@
|
|||||||
|
|
||||||
#include "sdkconfig.h"
|
#include "sdkconfig.h"
|
||||||
|
|
||||||
static LedMatrix_t led_matrix = {.size = 64};
|
static LedMatrix_t led_matrix = {.size = 1};
|
||||||
|
|
||||||
static const uint32_t value = 10;
|
|
||||||
static const uint32_t mod = 2;
|
|
||||||
|
|
||||||
LedMatrix_t get_led_matrix(void)
|
LedMatrix_t get_led_matrix(void)
|
||||||
{
|
{
|
||||||
@@ -17,7 +14,7 @@ esp_err_t wled_init(void)
|
|||||||
led_strip_config_t strip_config = {.strip_gpio_num = CONFIG_WLED_DIN_PIN,
|
led_strip_config_t strip_config = {.strip_gpio_num = CONFIG_WLED_DIN_PIN,
|
||||||
.max_leds = led_matrix.size,
|
.max_leds = led_matrix.size,
|
||||||
.led_model = LED_MODEL_WS2812,
|
.led_model = LED_MODEL_WS2812,
|
||||||
.color_component_format = LED_STRIP_COLOR_COMPONENT_FMT_RGB,
|
.color_component_format = LED_STRIP_COLOR_COMPONENT_FMT_GRB,
|
||||||
.flags = {
|
.flags = {
|
||||||
.invert_out = false,
|
.invert_out = false,
|
||||||
}};
|
}};
|
||||||
@@ -26,17 +23,14 @@ esp_err_t wled_init(void)
|
|||||||
.resolution_hz = 0,
|
.resolution_hz = 0,
|
||||||
.mem_block_symbols = 0,
|
.mem_block_symbols = 0,
|
||||||
.flags = {
|
.flags = {
|
||||||
.with_dma = true,
|
.with_dma = CONFIG_WLED_DMA_USAGE,
|
||||||
}};
|
}};
|
||||||
|
|
||||||
ESP_ERROR_CHECK(led_strip_new_rmt_device(&strip_config, &rmt_config, &led_matrix.led_strip));
|
ESP_ERROR_CHECK(led_strip_new_rmt_device(&strip_config, &rmt_config, &led_matrix.led_strip));
|
||||||
|
|
||||||
for (uint32_t i = 0; i < led_matrix.size; i++)
|
for (uint32_t i = 0; i < led_matrix.size; i++)
|
||||||
{
|
{
|
||||||
if (i % mod != 0)
|
led_strip_set_pixel(led_matrix.led_strip, i, 0, 0, 0);
|
||||||
{
|
|
||||||
led_strip_set_pixel(led_matrix.led_strip, i, value, value, value);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
led_strip_refresh(led_matrix.led_strip);
|
led_strip_refresh(led_matrix.led_strip);
|
||||||
|
|
||||||
|
@@ -1,10 +1,21 @@
|
|||||||
menu "Warnemuende Lighthouse"
|
menu "Warnemuende Lighthouse"
|
||||||
config WLED_DIN_PIN
|
config WLED_DIN_PIN
|
||||||
int "WLED Data In Pin"
|
int "WLED Data In Pin"
|
||||||
default 14
|
default 8
|
||||||
help
|
help
|
||||||
The number of the WLED data in pin.
|
The number of the WLED data in pin.
|
||||||
|
|
||||||
|
config WLED_USE_DMA
|
||||||
|
bool "Use DMA for WLED"
|
||||||
|
default n
|
||||||
|
help
|
||||||
|
Use DMA to drive the WLED strip. This is more efficient and allows for smoother animations.
|
||||||
|
|
||||||
|
config WLED_DMA_USAGE
|
||||||
|
int
|
||||||
|
default 1 if WLED_USE_DMA
|
||||||
|
default 0 if !WLED_USE_DMA
|
||||||
|
|
||||||
choice LIGHT_CHARACTERISTIC_CHOICE
|
choice LIGHT_CHARACTERISTIC_CHOICE
|
||||||
prompt "Light characteristic"
|
prompt "Light characteristic"
|
||||||
default LIGHT_CHARACTERISTIC_GREEN
|
default LIGHT_CHARACTERISTIC_GREEN
|
||||||
|
@@ -1,2 +1,3 @@
|
|||||||
# default ESP target
|
# default ESP target
|
||||||
CONFIG_IDF_TARGET="esp32s3"
|
CONFIG_IDF_TARGET="esp32s3"
|
||||||
|
CONFIG_WLED_USE_DMA=y
|
||||||
|
Reference in New Issue
Block a user