Merge branch 'refs/heads/master' into fork/BrentK-ADI/max32_port

This commit is contained in:
hathach
2024-08-14 06:33:42 +07:00
195 changed files with 7726 additions and 4671 deletions

View File

@@ -119,6 +119,26 @@ static void cdc_task(void) {
}
}
// Invoked when cdc when line state changed e.g connected/disconnected
// Use to reset to DFU when disconnect with 1200 bps
void tud_cdc_line_state_cb(uint8_t instance, bool dtr, bool rts) {
(void)rts;
// DTR = false is counted as disconnected
if (!dtr) {
// touch1200 only with first CDC instance (Serial)
if (instance == 0) {
cdc_line_coding_t coding;
tud_cdc_get_line_coding(&coding);
if (coding.bit_rate == 1200) {
if (board_reset_to_bootloader) {
board_reset_to_bootloader();
}
}
}
}
}
//--------------------------------------------------------------------+
// BLINKING TASK
//--------------------------------------------------------------------+