aboutsummaryrefslogtreecommitdiff
path: root/puzzle
diff options
context:
space:
mode:
Diffstat (limited to 'puzzle')
-rw-r--r--puzzle/dummy/CMakeLists.txt1
-rw-r--r--puzzle/dummy/FreeRTOSConfig.h2
-rw-r--r--puzzle/dummy/main.cpp16
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!");
+}
+