diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..ed629c9 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.16.0) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(TEF6686_ESP32) diff --git a/User_Manual_TEF6686.pdf b/docs/User_Manual_TEF6686.pdf similarity index 100% rename from User_Manual_TEF6686.pdf rename to docs/User_Manual_TEF6686.pdf diff --git a/extra_script.py b/extra_script.py new file mode 100644 index 0000000..02725a0 --- /dev/null +++ b/extra_script.py @@ -0,0 +1,9 @@ +Import("env") + +# Apply C++-only flags +env.Append( + CXXFLAGS=[ + "-fno-exceptions", + "-fno-rtti" + ] +) \ No newline at end of file diff --git a/platformio.ini b/platformio.ini index 8783d3e..eaad620 100644 --- a/platformio.ini +++ b/platformio.ini @@ -16,4 +16,17 @@ board_build.partitions = huge_app.csv build_flags = -Wall -Wextra - -Wno-unknown-pragmas \ No newline at end of file + -Wno-unknown-pragmas + -Os + -DCORE_DEBUG_LEVEL=0 + -DBOARD_HAS_PSRAM=0 + -ffunction-sections + -fdata-sections + -Wl,--gc-sections + -DARDUINO_LOOP_STACK_SIZE=4096 + +build_unflags = + -fexceptions + -frtti + +extra_scripts = pre:extra_script.py \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..483bc0c --- /dev/null +++ b/src/CMakeLists.txt @@ -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}) diff --git a/src/logbook.cpp b/src/logbook.cpp index a31dc6d..9005ce7 100644 --- a/src/logbook.cpp +++ b/src/logbook.cpp @@ -320,7 +320,6 @@ bool isDST(time_t t) { } if (month > 3 && month < 10) return true; - return false; } @@ -390,9 +389,7 @@ void sendUDPlog() { String AF = ""; if (radio.rds.hasAF && radio.af_counter > 0) { - for (byte i = 0; i < radio.af_counter; i++) { - AF += String(radio.af[i].frequency / 100) + "." + String((radio.af[i].frequency % 100) / 10) + (i == radio.af_counter - 1 ? "" : ";"); - } + for (byte i = 0; i < radio.af_counter; i++) AF += String(radio.af[i].frequency / 100) + "." + String((radio.af[i].frequency % 100) / 10) + (i == radio.af_counter - 1 ? "" : ";"); } String EON = ""; @@ -419,24 +416,12 @@ void sendUDPlog() { if (radio.rds.hasRTplus) RTPLUS += radio.rds.RTContent1 + ";" + radio.rds.RTContent2; // Construct the data row to send via UDP - String row = CHIP + "," + - VERSION + "," + - String(scandxmode) + "," + - currentDateTime + "," + - frequencyFormatted + "," + - String(radio.rds.picode).substring(0, 4) + "," + - signal + "," + - String(radio.getStereoStatus()) + "," + - String(radio.rds.hasTA) + "," + - String(radio.rds.TP) + "," + - String(radio.rds.hasTMC) + "," + - String(radio.rds.PTY) + "," + - ECC + "," + - stationName + "," + - radioTextModified + "," + - AF + "," + - EON + "," + - RTPLUS + "\n"; + String row = CHIP + "," + VERSION + "," + String(scandxmode) + "," + + currentDateTime + "," + frequencyFormatted + "," + String(radio.rds.picode).substring(0, 4) + "," + + signal + "," + String(radio.getStereoStatus()) + "," + String(radio.rds.hasTA) + "," + + String(radio.rds.TP) + "," + String(radio.rds.hasTMC) + "," + String(radio.rds.PTY) + "," + + ECC + "," + stationName + "," + radioTextModified + "," + + AF + "," + EON + "," + RTPLUS + "\n"; // Send the data via UDP if it's new if (UDPlogold != row) {