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

5
.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
build/**
managed_components/**
sdkconfig
sdkconfig.old
.vscode/settings.json

23
.vscode/c_cpp_properties.json vendored Normal file
View File

@@ -0,0 +1,23 @@
{
"configurations": [
{
"name": "ESP-IDF",
"compilerPath": "${config:idf.toolsPath}/tools/xtensa-esp-elf/esp-14.2.0_20241119/xtensa-esp-elf/bin/xtensa-esp32s3-elf-gcc",
"compileCommands": "${config:idf.buildPath}/compile_commands.json",
"includePath": [
"${config:idf.espIdfPath}/components/**",
"${config:idf.espIdfPathWin}/components/**",
"${workspaceFolder}/**"
],
"browse": {
"path": [
"${config:idf.espIdfPath}/components",
"${config:idf.espIdfPathWin}/components",
"${workspaceFolder}"
],
"limitSymbolsToIncludedHeaders": true
}
}
],
"version": 4
}

15
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,15 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "gdbtarget",
"request": "attach",
"name": "Eclipse CDT GDB Adapter"
},
{
"type": "espidf",
"name": "Launch",
"request": "launch"
}
]
}

6
CMakeLists.txt Normal file
View File

@@ -0,0 +1,6 @@
# The following five lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.16)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(miniature_town)

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)
{
}

21
dependencies.lock Normal file
View File

@@ -0,0 +1,21 @@
dependencies:
espressif/led_strip:
component_hash: b578eb926d9f6402fd45398b53c9bd5d1b7a15c1b2974d25aa3088e6c79b0b4c
dependencies:
- name: idf
require: private
version: '>=5.0'
source:
registry_url: https://components.espressif.com/
type: service
version: 3.0.1
idf:
source:
type: idf
version: 5.4.1
direct_dependencies:
- espressif/led_strip
- idf
manifest_hash: f4b6d767929ac18eaac7f04ecb838dbd4eeadcf88f73554cdf3fb35996942f18
target: esp32s3
version: 2.0.0

6
main/CMakeLists.txt Normal file
View File

@@ -0,0 +1,6 @@
idf_component_register(SRCS "main.c"
INCLUDE_DIRS "."
PRIV_REQUIRES
led_matrix
remote_control
)

16
main/idf_component.yml Normal file
View File

@@ -0,0 +1,16 @@
## IDF Component Manager Manifest File
dependencies:
## Required IDF version
idf:
version: '>=5.4.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

6
main/main.c Normal file
View File

@@ -0,0 +1,6 @@
#include "led_matrix.h"
void app_main(void)
{
init_led();
}

7
partitions.csv Normal file
View File

@@ -0,0 +1,7 @@
# Name , Type , SubType , Offset , Size , Flags
nvs , data , nvs , 0x9000 , 20k ,
otadata , data , ota , 0xe000 , 8k ,
app0 , app , ota_0 , 0x10000 , 1024k ,
app1 , app , ota_1 , , 1024k ,
spiffs , data , spiffs , , 1536k ,
coredump , data , coredump , , 64k ,
1 # Name Type SubType Offset Size Flags
2 nvs data nvs 0x9000 20k
3 otadata data ota 0xe000 8k
4 app0 app ota_0 0x10000 1024k
5 app1 app ota_1 1024k
6 spiffs data spiffs 1536k
7 coredump data coredump 64k

19
sdkconfig.defaults Executable file
View File

@@ -0,0 +1,19 @@
# activate Bluetooth Low Energy (BLE)
CONFIG_BT_ENABLED=y
CONFIG_BT_NIMBLE_ENABLED=y
# nimble options
CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME="miniature"
# Logging
CONFIG_LOG_DEFAULT_LEVEL_INFO=y
CONFIG_LOG_DEFAULT_LEVEL=3
CONFIG_LOG_MAXIMUM_LEVEL=3
# Flash Size
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_ESPTOOLPY_FLASHSIZE="4MB"
# Partitions
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"

View File

@@ -0,0 +1,2 @@
# default ESP target
CONFIG_IDF_TARGET="esp32s3"