Skip to content

Commit d4830d7

Browse files
committed
RTS/DTR dance like Espressif for reboot and boot to programming
1 parent e042d2c commit d4830d7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

build/devices/pico/base/debugger.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,18 @@
3737
#define MODDEF_DEBUGGER_BAUDRATE NRF_UART_BAUDRATE_115200
3838
#endif
3939

40+
#if mxDebug
41+
void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts)
42+
{
43+
static int8_t lastRTS = -1;
44+
if (-1 != lastRTS) {
45+
if (lastRTS && !rts)
46+
pico_reboot(dtr);
47+
}
48+
lastRTS = rts;
49+
}
50+
#endif
51+
4052
//---------
4153
void setupDebugger()
4254
{

0 commit comments

Comments
 (0)