aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorConfuSomu2021-03-28 13:40:25 -0400
committerConfuSomu2021-03-28 13:42:05 -0400
commit1d4608796a66ac5ad641eaec6b141a18cc30594a (patch)
tree53039b1e30b7a52ac86302ced7a563ab6954d0a2
parent1f47cd65a4c155d69575e8c3114f408f0f1ce8e8 (diff)
downloadpico-watch-1d4608796a66ac5ad641eaec6b141a18cc30594a.tar
pico-watch-1d4608796a66ac5ad641eaec6b141a18cc30594a.tar.gz
pico-watch-1d4608796a66ac5ad641eaec6b141a18cc30594a.zip
Enable malloc debugging
This might help in debugging problems related to memory and malloc-ing.
-rw-r--r--CMakeLists.txt2
-rw-r--r--pico-watch.cpp1
2 files changed, 3 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5ba1f5e..486b58e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,6 +13,7 @@ set(PICO_SDK_PATH "/home/pi/pico/pico-sdk")
include(pico_sdk_import.cmake)
project(pico-watch C CXX)
+add_compile_definitions(PICO_DEBUG_MALLOC PICO_DEBUG_MALLOC_LOW_WATER=1)# PICO_MALLOC_PANIC)
# Initialise the Pico SDK
pico_sdk_init()
@@ -43,6 +44,7 @@ add_executable(pico-watch
pico_set_program_name(pico-watch "pico-watch")
pico_set_program_version(pico-watch "0.1")
+# To access uart on a Pico connected directly to a Raspberry Pi (4 B): `minicom -b 115200 -o -D /dev/ttyS0`
pico_enable_stdio_uart(pico-watch 1)
# Add the standard library to the build
diff --git a/pico-watch.cpp b/pico-watch.cpp
index 1dee093..1469856 100644
--- a/pico-watch.cpp
+++ b/pico-watch.cpp
@@ -87,6 +87,7 @@ void app_switch(int old_appid, int new_appid) {
int main() {
init_all();
+ printf("~~~==~~~");
init_buttons();
app_api.init();
struct repeating_timer timer;