finalizing cdc host, has a working read/write
TODO: first character seems not to get echoed. set control line state seems to failed with LOG < 2
This commit is contained in:
@@ -61,24 +61,6 @@ int main(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// USB CDC
|
||||
//--------------------------------------------------------------------+
|
||||
CFG_TUSB_MEM_SECTION static char serial_in_buffer[64] = { 0 };
|
||||
|
||||
// invoked ISR context
|
||||
void tuh_cdc_xfer_isr(uint8_t dev_addr, xfer_result_t event, cdc_pipeid_t pipe_id, uint32_t xferred_bytes)
|
||||
{
|
||||
(void) event;
|
||||
(void) pipe_id;
|
||||
(void) xferred_bytes;
|
||||
|
||||
printf(serial_in_buffer);
|
||||
tu_memclr(serial_in_buffer, sizeof(serial_in_buffer));
|
||||
|
||||
tuh_cdc_receive(dev_addr, serial_in_buffer, sizeof(serial_in_buffer), true); // waiting for next data
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// TinyUSB Callbacks
|
||||
//--------------------------------------------------------------------+
|
||||
|
Reference in New Issue
Block a user