Let the SEGFAULTS begin!

Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
2025-05-16 21:55:25 +02:00
commit ed7a23256c
18 changed files with 200 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
idf_component_register(SRCS "led_matrix.c"
INCLUDE_DIRS "include"
PRIV_REQUIRES
led_strip
)

View File

@@ -0,0 +1,17 @@
## IDF Component Manager Manifest File
dependencies:
## Required IDF version
idf:
version: '>=4.1.0'
# # Put list of dependencies here
# # For components maintained by Espressif:
# component: "~1.0.0"
# # For 3rd party components:
# username/component: ">=1.0.0,<2.0.0"
# username2/component2:
# version: "~1.0.0"
# # For transient dependencies `public` flag can be set.
# # `public` flag doesn't have an effect dependencies of the `main` component.
# # All dependencies of `main` are public by default.
# public: true
espressif/led_strip: '~3.0.0'

View File

@@ -0,0 +1,3 @@
#pragma once
void init_led(void);

View File

@@ -0,0 +1,39 @@
#include <stdio.h>
#include "led_matrix.h"
#include "led_strip.h"
#define LED_STRIP_RMT_RES_HZ (10 * 1000 * 1000)
led_strip_handle_t led_strip_init(uint8_t gpio_pin, uint32_t width, uint32_t height)
{
led_strip_config_t strip_config = {
.strip_gpio_num = gpio_pin,
.max_leds = width * height,
.led_model = LED_MODEL_WS2812,
.color_component_format = LED_STRIP_COLOR_COMPONENT_FMT_RGB,
.flags = {
.invert_out = false,
}};
led_strip_rmt_config_t rmt_config = {
.clk_src = RMT_CLK_SRC_DEFAULT,
.resolution_hz = LED_STRIP_RMT_RES_HZ,
.mem_block_symbols = 64,
.flags = {
.with_dma = true,
}};
led_strip_handle_t led_strip;
ESP_ERROR_CHECK(led_strip_new_rmt_device(&strip_config, &rmt_config, &led_strip));
return led_strip;
}
void init_led(void)
{
led_strip_handle_t led = led_strip_init(14, 8, 8);
// led_strip_set_pixel(led, 0, 255, 0, 0);
// led_strip_set_pixel(led, 1, 0, 255, 0);
// led_strip_set_pixel(led, 2, 0, 0, 255);
led_strip_refresh(led);
}

View File

@@ -0,0 +1,2 @@
idf_component_register(SRCS "remote_control.c"
INCLUDE_DIRS "include")

View File

@@ -0,0 +1 @@
void func(void);

View File

@@ -0,0 +1,7 @@
#include <stdio.h>
#include "remote_control.h"
void func(void)
{
}