1
.clang-format
Normal file
1
.clang-format
Normal file
@@ -0,0 +1 @@
|
||||
BasedOnStyle: Chromium
|
20
.github/workflows/esp32_build.yml
vendored
20
.github/workflows/esp32_build.yml
vendored
@@ -6,6 +6,12 @@ on:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
idf_ver:
|
||||
[release-v4.4.6, release-v5.0.5, release-v5.1.3, release-v5.2.1]
|
||||
idf_target: [esp32, esp32s3, esp32c3]
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
@@ -13,16 +19,8 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: "recursive"
|
||||
- name: esp-idf build
|
||||
- name: ESP-IDF build
|
||||
uses: espressif/esp-idf-ci-action@v1
|
||||
with:
|
||||
esp_idf_version: v5.2.1
|
||||
target: esp32s3
|
||||
- name: Archive build output artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: build
|
||||
path: |
|
||||
build/bootloader/bootloader.bin
|
||||
build/partition_table/partition-table.bin
|
||||
build/${{ github.event.repository.name }}.bin
|
||||
esp_idf_version: ${{ matrix.idf_ver }}
|
||||
target: ${{ matrix.idf_target }}
|
||||
|
@@ -7,4 +7,5 @@ cmake_minimum_required(VERSION 3.16)
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(firmware_thomas_the_tank_engine)
|
||||
|
||||
# idf_build_set_property(COMPILE_OPTIONS "-Wno-error" APPEND)
|
||||
idf_build_set_property(COMPILE_OPTIONS "-Werror" APPEND)
|
||||
spiffs_create_partition_image(spiffs data FLASH_IN_PROJECT)
|
||||
|
@@ -1,3 +1,3 @@
|
||||
idf_component_register(SRCS "osr_ble.c"
|
||||
INCLUDE_DIRS "."
|
||||
REQUIRES "nvs_flash")
|
||||
PRIV_REQUIRES "nvs_flash")
|
||||
|
@@ -3,18 +3,16 @@
|
||||
#include <nvs.h>
|
||||
#include <nvs_flash.h>
|
||||
|
||||
void nvs_init()
|
||||
{
|
||||
esp_err_t ret = nvs_flash_init();
|
||||
if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND)
|
||||
{
|
||||
ESP_ERROR_CHECK(nvs_flash_erase());
|
||||
ret = nvs_flash_init();
|
||||
}
|
||||
ESP_ERROR_CHECK(ret);
|
||||
void nvs_init() {
|
||||
esp_err_t ret = nvs_flash_init();
|
||||
if (ret == ESP_ERR_NVS_NO_FREE_PAGES ||
|
||||
ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
|
||||
ESP_ERROR_CHECK(nvs_flash_erase());
|
||||
ret = nvs_flash_init();
|
||||
}
|
||||
ESP_ERROR_CHECK(ret);
|
||||
}
|
||||
|
||||
void osr_ble_init()
|
||||
{
|
||||
nvs_init();
|
||||
void osr_ble_init() {
|
||||
nvs_init();
|
||||
}
|
||||
|
1
data/dummy.txt
Normal file
1
data/dummy.txt
Normal file
@@ -0,0 +1 @@
|
||||
This is just a dummy file.
|
24
main/main.c
24
main/main.c
@@ -1,23 +1,19 @@
|
||||
#include <stdio.h>
|
||||
#include <esp_task_wdt.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "osr_ble.h"
|
||||
|
||||
void setup()
|
||||
{
|
||||
osr_ble_init();
|
||||
void setup() {
|
||||
osr_ble_init();
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
ESP_ERROR_CHECK(esp_task_wdt_reset());
|
||||
void loop() {
|
||||
ESP_ERROR_CHECK(esp_task_wdt_reset());
|
||||
}
|
||||
|
||||
void app_main()
|
||||
{
|
||||
setup();
|
||||
while (1)
|
||||
{
|
||||
loop();
|
||||
}
|
||||
void app_main() {
|
||||
setup();
|
||||
while (1) {
|
||||
loop();
|
||||
}
|
||||
}
|
||||
|
7
partitions.csv
Normal file
7
partitions.csv
Normal file
@@ -0,0 +1,7 @@
|
||||
# Name, Type, SubType, Offset, Size, Flags
|
||||
nvs, data, nvs, 0x9000, 0x5000,
|
||||
otadata, data, ota, 0xe000, 0x2000,
|
||||
app0, app, ota_0, 0x10000, 0x140000,
|
||||
app1, app, ota_1, 0x150000,0x140000,
|
||||
spiffs, data, spiffs, 0x290000,0x160000,
|
||||
coredump, data, coredump,0x3F0000,0x10000,
|
|
@@ -1,6 +1,3 @@
|
||||
# default ESP target
|
||||
CONFIG_IDF_TARGET="esp32s3"
|
||||
|
||||
# activate Bluetooth Low Energy (BLE)
|
||||
CONFIG_BT_ENABLED=y
|
||||
CONFIG_BT_NIMBLE_ENABLED=y
|
||||
@@ -9,3 +6,14 @@ CONFIG_BT_NIMBLE_ENABLED=y
|
||||
CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y
|
||||
CONFIG_LOG_DEFAULT_LEVEL=4
|
||||
CONFIG_LOG_MAXIMUM_LEVEL=4
|
||||
|
||||
# Flash Size
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE="4MB"
|
||||
|
||||
# Partitions
|
||||
CONFIG_PARTITION_TABLE_CUSTOM=y
|
||||
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
||||
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
||||
CONFIG_PARTITION_TABLE_OFFSET=0x8000
|
||||
CONFIG_PARTITION_TABLE_MD5=y
|
||||
|
2
sdkconfig.defaults linux
Normal file
2
sdkconfig.defaults linux
Normal file
@@ -0,0 +1,2 @@
|
||||
# FreeRTOS Linux Simulator
|
||||
CONFIG_IDF_TARGET="linux"
|
2
sdkconfig.defaults.esp32s3
Normal file
2
sdkconfig.defaults.esp32s3
Normal file
@@ -0,0 +1,2 @@
|
||||
# default ESP target
|
||||
CONFIG_IDF_TARGET="esp32s3"
|
1
version.txt
Normal file
1
version.txt
Normal file
@@ -0,0 +1 @@
|
||||
0.0.1
|
Reference in New Issue
Block a user