runs, but unable to debug

This commit is contained in:
Martin Brodbeck 2024-02-14 18:13:09 +01:00
parent 251c365095
commit 4b7c0ba6c6
2 changed files with 10 additions and 4 deletions

View file

@ -32,7 +32,7 @@ pico_set_program_name(raspi_keyer "raspi_keyer")
pico_set_program_version(raspi_keyer "0.0.1") pico_set_program_version(raspi_keyer "0.0.1")
pico_enable_stdio_uart(raspi_keyer 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) target_compile_options(raspi_keyer PRIVATE -Wall -Wextra -Werror)

View file

@ -49,12 +49,13 @@ void setup()
gpio_set_dir(RIGHT_PADDLE_PIN, GPIO_IN); gpio_set_dir(RIGHT_PADDLE_PIN, GPIO_IN);
gpio_pull_up(RIGHT_PADDLE_PIN); 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. */ /* Let's do all the keying stuff in the second core, so there are no timing problems. */
void core1_main() void core1_main()
{ {
printf("Hello from core1!\n");
KeyerQueueData data; KeyerQueueData data;
queue_remove_blocking(&keyerQueue, &data); queue_remove_blocking(&keyerQueue, &data);
@ -88,20 +89,25 @@ void core1_main()
int 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 // https://github.com/raspberrypi/pico-sdk/issues/1152#issuecomment-1418248639
setup(); setup();
printf("Hello from core0!\n");
Settings settings{read_settings()}; Settings settings{read_settings()};
queue_init(&keyerQueue, sizeof(KeyerQueueData), 2);
multicore_launch_core1(core1_main);
KeyerQueueData keyerQueueData{KeyerQueueCommand::Run, settings.wpm, settings.mode}; KeyerQueueData keyerQueueData{KeyerQueueCommand::Run, settings.wpm, settings.mode};
queue_add_blocking(&keyerQueue, &keyerQueueData); queue_add_blocking(&keyerQueue, &keyerQueueData);
while (true) while (true)
{ {
// Currently there's nothing to do on core0 // Currently there's nothing to do on core0
sleep_ms(1000); //sleep_ms(1000);
} }
return 0; return 0;