Fix debug prints - The reset pin must move otherwise uart0 tx is squashed - Don't preempt printf, it doesn't like it - Set up the UART by default
diff --git a/include/board_pico_config.h b/include/board_pico_config.h index d013d4c..4c90080 100644 --- a/include/board_pico_config.h +++ b/include/board_pico_config.h
@@ -35,7 +35,7 @@ #define PROBE_PIN_SWCLK (PROBE_PIN_OFFSET + 0) // 2 #define PROBE_PIN_SWDIO (PROBE_PIN_OFFSET + 1) // 3 // Target reset config -#define PROBE_PIN_RESET 0 +#define PROBE_PIN_RESET 1 // UART config #define PICOPROBE_UART_TX 4
diff --git a/src/cdc_uart.c b/src/cdc_uart.c index bec467b..525b012 100644 --- a/src/cdc_uart.c +++ b/src/cdc_uart.c
@@ -139,7 +139,7 @@ vTaskSuspend(uart_taskhandle); interval = MAX(1, micros / ((1000 * 1000) / configTICK_RATE_HZ)); debounce_ticks = MAX(1, configTICK_RATE_HZ / (interval * DEBOUNCE_MS)); - picoprobe_info("New baud rate %d micros %d interval %u\n", + picoprobe_info("New baud rate %ld micros %ld interval %lu\n", line_coding->bit_rate, micros, interval); uart_deinit(PICOPROBE_UART_INTERFACE); tud_cdc_write_clear();
diff --git a/src/main.c b/src/main.c index daf3a51..ac09011 100644 --- a/src/main.c +++ b/src/main.c
@@ -99,6 +99,7 @@ tusb_init(); DAP_Setup(); + stdio_uart_init(); led_init();
diff --git a/src/picoprobe_config.h b/src/picoprobe_config.h index dd5d7b3..fd46f31 100644 --- a/src/picoprobe_config.h +++ b/src/picoprobe_config.h
@@ -26,21 +26,39 @@ #ifndef PICOPROBE_H_ #define PICOPROBE_H_ +#include "FreeRTOS.h" +#include "task.h" + #if false -#define picoprobe_info(format,args...) printf(format, ## args) +#define picoprobe_info(format,args...) \ +do { \ + vTaskSuspendAll(); \ + printf(format, ## args); \ + xTaskResumeAll(); \ +} while (0) #else #define picoprobe_info(format,...) ((void)0) #endif #if false -#define picoprobe_debug(format,args...) printf(format, ## args) +#define picoprobe_debug(format,args...) \ +do { \ + vTaskSuspendAll(); \ + printf(format, ## args); \ + xTaskResumeAll(); \ +} while (0) #else #define picoprobe_debug(format,...) ((void)0) #endif #if false -#define picoprobe_dump(format,args...) printf(format, ## args) +#define picoprobe_dump(format,args...)\ +do { \ + vTaskSuspendAll(); \ + printf(format, ## args); \ + xTaskResumeAll(); \ +} while (0) #else #define picoprobe_dump(format,...) ((void)0) #endif