From 4b7c0ba6c67c4b46279d5274a40631e0df66ca6d Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Wed, 14 Feb 2024 18:13:09 +0100 Subject: [PATCH] runs, but unable to debug --- CMakeLists.txt | 2 +- src/raspi_keyer.cpp | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 72fb7c2..430e256 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,7 @@ pico_set_program_name(raspi_keyer "raspi_keyer") pico_set_program_version(raspi_keyer "0.0.1") pico_enable_stdio_uart(raspi_keyer 1) -pico_enable_stdio_usb(raspi_keyer 0) +pico_enable_stdio_usb(raspi_keyer 1) target_compile_options(raspi_keyer PRIVATE -Wall -Wextra -Werror) diff --git a/src/raspi_keyer.cpp b/src/raspi_keyer.cpp index 34c283f..d206760 100644 --- a/src/raspi_keyer.cpp +++ b/src/raspi_keyer.cpp @@ -49,12 +49,13 @@ void setup() gpio_set_dir(RIGHT_PADDLE_PIN, GPIO_IN); gpio_pull_up(RIGHT_PADDLE_PIN); - sleep_ms(1000); + //sleep_ms(1000); } /* Let's do all the keying stuff in the second core, so there are no timing problems. */ void core1_main() { + printf("Hello from core1!\n"); KeyerQueueData data; queue_remove_blocking(&keyerQueue, &data); @@ -88,20 +89,25 @@ void core1_main() int main() { - timer_hw->dbgpause = 0; // workaround for problem with debug and sleep_ms + //timer_hw->dbgpause = 0; // workaround for problem with debug and sleep_ms // https://github.com/raspberrypi/pico-sdk/issues/1152#issuecomment-1418248639 setup(); + printf("Hello from core0!\n"); + Settings settings{read_settings()}; + queue_init(&keyerQueue, sizeof(KeyerQueueData), 2); + multicore_launch_core1(core1_main); + KeyerQueueData keyerQueueData{KeyerQueueCommand::Run, settings.wpm, settings.mode}; queue_add_blocking(&keyerQueue, &keyerQueueData); while (true) { // Currently there's nothing to do on core0 - sleep_ms(1000); + //sleep_ms(1000); } return 0;