cdc_uart: add RTS and DTR pins
diff --git a/include/board_example_config.h b/include/board_example_config.h
index 74c8535..32c0908 100644
--- a/include/board_example_config.h
+++ b/include/board_example_config.h
@@ -68,6 +68,9 @@
 #define PICOPROBE_UART_RX 5
 #define PICOPROBE_UART_INTERFACE uart1
 #define PICOPROBE_UART_BAUDRATE 115200
+/* Flow control - some or all of these can be omitted if not used */
+#define PICOPROBE_UART_RTS 9
+#define PICOPROBE_UART_DTR 10
 #endif
 
 /* LED config - some or all of these can be omitted if not used */
diff --git a/src/cdc_uart.c b/src/cdc_uart.c
index 417b50c..3e7afa2 100644
--- a/src/cdc_uart.c
+++ b/src/cdc_uart.c
@@ -55,6 +55,17 @@
     gpio_set_pulls(PICOPROBE_UART_TX, 1, 0);
     gpio_set_pulls(PICOPROBE_UART_RX, 1, 0);
     uart_init(PICOPROBE_UART_INTERFACE, PICOPROBE_UART_BAUDRATE);
+
+#ifdef PICOPROBE_UART_RTS
+    gpio_init(PICOPROBE_UART_RTS);
+    gpio_set_dir(PICOPROBE_UART_RTS, GPIO_OUT);
+    gpio_put(PICOPROBE_UART_RTS, 1);
+#endif
+#ifdef PICOPROBE_UART_DTR
+    gpio_init(PICOPROBE_UART_DTR);
+    gpio_set_dir(PICOPROBE_UART_DTR, GPIO_OUT);
+    gpio_put(PICOPROBE_UART_DTR, 1);
+#endif
 }
 
 void cdc_task(void)
@@ -203,6 +214,13 @@
 
 void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts)
 {
+#ifdef PICOPROBE_UART_RTS
+  gpio_put(PICOPROBE_UART_RTS, !rts);
+#endif
+#ifdef PICOPROBE_UART_DTR
+  gpio_put(PICOPROBE_UART_DTR, !dtr);
+#endif
+
   /* CDC drivers use linestate as a bodge to activate/deactivate the interface.
    * Resume our UART polling on activate, stop on deactivate */
   if (!dtr && !rts) {