remove desktop build (for now)

Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
2025-09-11 10:47:43 +02:00
parent 9612e53ca4
commit 37c75f3785
13 changed files with 44 additions and 646 deletions

View File

@@ -1,30 +1,10 @@
if (DEFINED ENV{IDF_PATH})
idf_component_register(SRCS
src/hal_esp32/led_manager.cpp
src/hal_esp32/led_status.cpp
INCLUDE_DIRS "include"
PRIV_REQUIRES
u8g2
esp_event
esp_timer
persistence-manager
)
return()
endif ()
cmake_minimum_required(VERSION 3.30)
project(led-manager)
add_library(${PROJECT_NAME} STATIC
src/hal_native/led_manager.cpp
src/hal_native/Matrix.cpp
)
include_directories(include)
target_include_directories(${PROJECT_NAME} PUBLIC include)
target_link_libraries(${PROJECT_NAME} PRIVATE
SDL3::SDL3
persistence-manager
idf_component_register(SRCS
src/led_manager.cpp
src/led_status.cpp
INCLUDE_DIRS "include"
PRIV_REQUIRES
u8g2
esp_event
esp_timer
persistence-manager
)

View File

@@ -1,64 +0,0 @@
#include "Matrix.h"
#include "SDL3/SDL.h"
Matrix::Matrix(uint32_t windowID, SDL_Renderer *renderer, const uint8_t cols, const uint8_t rows)
: m_windowId(windowID), m_renderer(renderer), m_cols(cols), m_rows(rows)
{
}
SDL_Renderer *Matrix::renderer() const
{
return m_renderer;
}
SDL_WindowID Matrix::windowId() const
{
return m_windowId;
}
void Matrix::DrawColoredGrid() const
{
int i = 0;
for (int w = 0; w < m_cols; w++)
{
const auto phase = w % (2 * m_rows);
for (int h_raw = 0; h_raw < m_rows; h_raw++)
{
int h;
if (phase < m_rows)
{
h = h_raw;
}
else
{
h = m_rows - 1 - h_raw;
}
constexpr auto rectSize = cellSize - 2.0f * spacing;
const auto x = static_cast<float>(w) * cellSize + spacing;
const auto y = static_cast<float>(h) * cellSize + spacing;
auto rect = SDL_FRect{x, y, rectSize, rectSize};
i++;
const auto red = static_cast<Uint8>(static_cast<float>(i) * 255.0f);
const auto green = static_cast<Uint8>(static_cast<float>(i) * 255.0f);
const auto blue = static_cast<Uint8>(static_cast<float>(i) * 255.0f);
SDL_SetRenderDrawColor(m_renderer, red, green, blue, 255);
SDL_RenderFillRect(m_renderer, &rect);
}
}
}
void Matrix::Render() const
{
SDL_SetRenderDrawColor(m_renderer, 0, 0, 0, 255);
SDL_RenderClear(m_renderer);
DrawColoredGrid();
SDL_RenderPresent(m_renderer);
}

View File

@@ -1,16 +0,0 @@
#include "led_manager.h"
uint64_t wled_init(void)
{
return 0;
}
uint64_t register_handler(void)
{
return 0;
}
uint64_t send_event(uint32_t event, led_event_data_t *payload)
{
return 0;
}

View File

@@ -1,7 +0,0 @@
#include "led_status.h"
void led_status_init()
{
// This function is intentionally left empty for the native implementation.
// It serves as a placeholder to maintain compatibility with the HAL interface.
}

View File

@@ -20,7 +20,7 @@ uint64_t wled_init(void)
{
led_strip_config_t strip_config = {
.strip_gpio_num = CONFIG_WLED_DIN_PIN,
.max_leds = 64,
.max_leds = 500,
.led_model = LED_MODEL_WS2812,
.color_component_format = LED_STRIP_COLOR_COMPONENT_FMT_GRB,
.flags =
@@ -55,7 +55,7 @@ void event_handler(void *arg, esp_event_base_t base, int32_t id, void *event_dat
if (id == EVENT_LED_ON || id == EVENT_LED_OFF)
{
auto brightness = (id == EVENT_LED_ON) ? value : 0;
for (uint32_t i = 0; i < 64; i++)
for (uint32_t i = 0; i < 500; i++)
{
led_strip_set_pixel(led_strip, i, brightness, brightness, brightness);
}