diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-06-18 14:51:43 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-06-18 14:51:43 +0200 |
commit | 573ee2dd6790c00c9e0f709f222bc2a68f015d6d (patch) | |
tree | a37e81ced097ec04dc6bf36efaf072ff69e8efc3 /puzzle | |
parent | 681107dde23e19b0a14e09a59f687cf9978b50ed (diff) |
WIP losing my mind
Diffstat (limited to 'puzzle')
-rw-r--r-- | puzzle/dummy/CMakeLists.txt | 1 | ||||
-rw-r--r-- | puzzle/dummy/FreeRTOSConfig.h | 2 | ||||
-rw-r--r-- | puzzle/dummy/main.cpp | 16 |
3 files changed, 17 insertions, 2 deletions
diff --git a/puzzle/dummy/CMakeLists.txt b/puzzle/dummy/CMakeLists.txt index bcbab88..0d5e1bd 100644 --- a/puzzle/dummy/CMakeLists.txt +++ b/puzzle/dummy/CMakeLists.txt @@ -7,6 +7,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS 1) # enable debug features set(CMAKE_BUILD_TYPE Debug) add_compile_definitions(DEBUG) +# add_compile_options(-O0) # no optimizations # arduino set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/lib/Arduino-CMake-Toolchain/Arduino-toolchain.cmake) diff --git a/puzzle/dummy/FreeRTOSConfig.h b/puzzle/dummy/FreeRTOSConfig.h index 1cfdd71..f398db9 100644 --- a/puzzle/dummy/FreeRTOSConfig.h +++ b/puzzle/dummy/FreeRTOSConfig.h @@ -20,7 +20,7 @@ // #define configTOTAL_HEAP_SIZE (1024) #define configTOTAL_HEAP_SIZE (7 * 1024) #define configCHECK_FOR_STACK_OVERFLOW 0 -#define configUSE_MALLOC_FAILED_HOOK 0 +#define configUSE_MALLOC_FAILED_HOOK 1 #define configUSE_DAEMON_TASK_STARTUP_HOOK 0 #define configGENERATE_RUN_TIME_STATS 0 #define configUSE_TRACE_FACILITY 0 diff --git a/puzzle/dummy/main.cpp b/puzzle/dummy/main.cpp index 06f7569..217ce94 100644 --- a/puzzle/dummy/main.cpp +++ b/puzzle/dummy/main.cpp @@ -5,16 +5,30 @@ #include "pb-mod.h" #include "pb-route.h" +#include "pb-send.h" const char * PB_MOD_NAME = "dummy"; const i2c_addr_t PB_MOD_ADDR = 0x69; void setup() { Serial.begin(115200); + + pb_buf_t buf = pb_send_magic_res(); + Serial.print("response bytes:"); + for (size_t i = 0; i < buf.size; i++) { + Serial.print(" "); + Serial.print(buf.data[i]); + } + Serial.print("\r\n"); + pb_buf_free(&buf); } void loop() { - Serial.write("Hello world!\r\n"); + Serial.write("."); vTaskDelay(1000 / portTICK_PERIOD_MS); } +void vApplicationMallocFailedHook(void) { + Serial.println("malloc failed!"); +} + |