From 5d36c90331e8c78a2d08602c7df4f499c71c5aef Mon Sep 17 00:00:00 2001 From: Peter Harper <77111776+peterharperuk@users.noreply.github.com> Date: Fri, 21 Jun 2024 20:31:52 +0100 Subject: [PATCH] Make it easier to configure default baud rate (#1648) To make stdio logging quicker it's probably a good idea to set the default uart speed 921600, but it's only configurable by adding this define to your project. Make it configurable from the cmake command line. --- src/rp2_common/hardware_uart/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/rp2_common/hardware_uart/CMakeLists.txt b/src/rp2_common/hardware_uart/CMakeLists.txt index f3de8fb4d..85edd9420 100644 --- a/src/rp2_common/hardware_uart/CMakeLists.txt +++ b/src/rp2_common/hardware_uart/CMakeLists.txt @@ -1,3 +1,9 @@ pico_simple_hardware_target(uart) -pico_mirrored_target_link_libraries(hardware_uart INTERFACE hardware_resets hardware_clocks) \ No newline at end of file +pico_mirrored_target_link_libraries(hardware_uart INTERFACE hardware_resets hardware_clocks) + +# PICO_CONFIG: PICO_DEFAULT_UART_BAUD_RATE, Define the default UART baudrate, max=921600, default=115200, group=hardware_uart +if (PICO_DEFAULT_UART_BAUD_RATE) +target_compile_definitions(hardware_uart INTERFACE + PICO_DEFAULT_UART_BAUD_RATE=${PICO_DEFAULT_UART_BAUD_RATE}) +endif()