move to espidf + arduino, this reduces flash size a shitload

This commit is contained in:
2026-01-16 12:08:11 +01:00
parent 86181c1439
commit f8c7e2a36d
6 changed files with 78 additions and 4 deletions

2
.gitignore vendored
View File

@@ -3,3 +3,5 @@
.vscode/c_cpp_properties.json .vscode/c_cpp_properties.json
.vscode/launch.json .vscode/launch.json
.vscode/ipch .vscode/ipch
sdkconfig**
!sdkconfig.defaults

3
CMakeLists.txt Normal file
View File

@@ -0,0 +1,3 @@
cmake_minimum_required(VERSION 3.16.0)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(TEF6686_ESP32)

View File

@@ -6,7 +6,8 @@ platform = espressif32
upload_speed = 921600 upload_speed = 921600
monitor_speed = 115200 monitor_speed = 115200
board = esp32dev board = esp32dev
framework = arduino framework = arduino, espidf
board_build.f_flash = 80000000L
board_build.partitions = maxapp.csv board_build.partitions = maxapp.csv
build_flags = build_flags =
-Wall -Wall
@@ -18,8 +19,8 @@ build_flags =
-ffunction-sections -ffunction-sections
-fdata-sections -fdata-sections
-Wl,--gc-sections -Wl,--gc-sections
-DARDUINO_LOOP_STACK_SIZE=4096
-Werror -Werror
-Wno-error=missing-field-initializers
monitor_filters = monitor_filters =
esp32_exception_decoder esp32_exception_decoder
default default

50
sdkconfig.defaults Normal file
View File

@@ -0,0 +1,50 @@
CONFIG_APP_EXCLUDE_PROJECT_VER_VAR=y
CONFIG_APP_EXCLUDE_PROJECT_NAME_VAR=y
CONFIG_BOOTLOADER_LOG_LEVEL_ERROR=y
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_ESPTOOLPY_BEFORE_NORESET=y
CONFIG_ESPTOOLPY_AFTER_NORESET=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="maxapp.csv"
CONFIG_ARDUINO_RUN_CORE0=y
CONFIG_ARDUINO_SELECTIVE_COMPILATION=y
# CONFIG_ARDUINO_SELECTIVE_AsyncUDP is not set
# CONFIG_ARDUINO_SELECTIVE_AzureIoT is not set
# CONFIG_ARDUINO_SELECTIVE_BLE is not set
# CONFIG_ARDUINO_SELECTIVE_BluetoothSerial is not set
# CONFIG_ARDUINO_SELECTIVE_EEPROM is not set
# CONFIG_ARDUINO_SELECTIVE_FFat is not set
# CONFIG_ARDUINO_SELECTIVE_HTTPClient is not set
# CONFIG_ARDUINO_SELECTIVE_LITTLEFS is not set
# CONFIG_ARDUINO_SELECTIVE_NetBIOS is not set
# CONFIG_ARDUINO_SELECTIVE_Preferences is not set
# CONFIG_ARDUINO_SELECTIVE_SD is not set
# CONFIG_ARDUINO_SELECTIVE_SD_MMC is not set
# CONFIG_ARDUINO_SELECTIVE_SimpleBLE is not set
# CONFIG_ARDUINO_SELECTIVE_Ticker is not set
# CONFIG_ARDUINO_SELECTIVE_Update is not set
# CONFIG_ARDUINO_SELECTIVE_WiFiClientSecure is not set
# CONFIG_ARDUINO_SELECTIVE_WiFiProv is not set
CONFIG_COMPILER_OPTIMIZATION_SIZE=y
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE=y
CONFIG_ESP32_REV_MIN_1=y
# CONFIG_ETH_USE_ESP32_EMAC is not set
# CONFIG_ETH_USE_SPI_ETHERNET is not set
# CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS is not set
# CONFIG_ESP_HTTP_CLIENT_ENABLE_DIGEST_AUTH is not set
CONFIG_FREERTOS_HZ=1000
CONFIG_HAL_ASSERTION_DISABLE=y
CONFIG_LOG_DEFAULT_LEVEL_ERROR=y
# CONFIG_LOG_COLORS is not set
CONFIG_MBEDTLS_PSK_MODES=y
CONFIG_MBEDTLS_KEY_EXCHANGE_PSK=y
# CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_PSK is not set
# CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_PSK is not set
# CONFIG_MBEDTLS_KEY_EXCHANGE_RSA_PSK is not set
# CONFIG_MQTT_PROTOCOL_311 is not set
# CONFIG_MQTT_TRANSPORT_SSL is not set
CONFIG_SPIFFS_MAX_PARTITIONS=1
# CONFIG_SPIFFS_USE_MTIME is not set
# CONFIG_WS_TRANSPORT is not set
# CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER is not set

6
src/CMakeLists.txt Normal file
View File

@@ -0,0 +1,6 @@
# This file was automatically generated for projects
# without default 'CMakeLists.txt' file.
FILE(GLOB_RECURSE app_sources ${CMAKE_SOURCE_DIR}/src/*.*)
idf_component_register(SRCS ${app_sources})

View File

@@ -21,6 +21,9 @@ using fs::FS;
#include "nonvolatile.h" #include "nonvolatile.h"
#include "utils.h" #include "utils.h"
#include "system_console.h" #include "system_console.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_task_wdt.h"
#pragma endregion #pragma endregion
Console console(&tft); Console console(&tft);
@@ -846,7 +849,7 @@ int GetNum() {
// According to the docs, register 0 contains pins IO0_x where x is equal to the bit from the right (x = 7, is MSB) // According to the docs, register 0 contains pins IO0_x where x is equal to the bit from the right (x = 7, is MSB)
int cnt = 0; int cnt = 0;
int16_t temp; uint16_t temp;
unsigned int num; unsigned int num;
if(Wire.available() == 2) { if(Wire.available() == 2) {
keypadtimer = millis(); keypadtimer = millis();
@@ -3958,4 +3961,13 @@ uint8_t doAutoMemory(uint16_t startfreq, uint16_t stopfreq, uint8_t startmem, ui
SQ = false; SQ = false;
return error; return error;
} }
extern "C" void app_main() {
initArduino();
setup();
while(true) {
loop();
esp_task_wdt_reset();
}
}