add vendor peek, change cdc peek signature, change cdc read_char() return from signed char to int32_t

This commit is contained in:
hathach
2019-08-01 10:46:27 +07:00
parent 2c2db31b09
commit bd08d0edc9
5 changed files with 86 additions and 69 deletions

View File

@@ -62,7 +62,6 @@ CFG_TUSB_MEM_SECTION static vendord_interface_t _vendord_itf[CFG_TUD_VENDOR];
#define ITF_MEM_RESET_SIZE offsetof(vendord_interface_t, rx_ff)
bool tud_vendor_n_mounted (uint8_t itf)
{
return _vendord_itf[itf].ep_in && _vendord_itf[itf].ep_out;
@@ -73,6 +72,11 @@ uint32_t tud_vendor_n_available (uint8_t itf)
return tu_fifo_count(&_vendord_itf[itf].rx_ff);
}
bool tud_vendor_n_peek(uint8_t itf, int pos, uint8_t* u8)
{
return tu_fifo_peek_at(&_vendord_itf[itf].rx_ff, pos, u8);
}
//--------------------------------------------------------------------+
// Read API
//--------------------------------------------------------------------+