update cdc_msc/cdc_msc_freertos to also support notification
This commit is contained in:
@@ -119,6 +119,16 @@ void cdc_task(void) {
|
||||
tud_cdc_write(buf, count);
|
||||
tud_cdc_write_flush();
|
||||
}
|
||||
|
||||
// Press on-board button to send Uart status notification
|
||||
static uint32_t btn_prev = 0;
|
||||
static cdc_notify_uart_state_t uart_state = { .value = 0 };
|
||||
const uint32_t btn = board_button_read();
|
||||
if (!btn_prev && btn) {
|
||||
uart_state.dsr ^= 1;
|
||||
tud_cdc_notify_uart_state(&uart_state);
|
||||
}
|
||||
btn_prev = btn;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user