mirror of
https://github.com/hathach/tinyusb.git
synced 2026-02-05 07:35:44 +00:00
hil stress test cdc
This commit is contained in:
@ -513,7 +513,7 @@ bool cdcd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_
|
||||
for (uint32_t i = 0; i < xferred_bytes; i++) {
|
||||
if (p_cdc->wanted_char == (char)*ptr) {
|
||||
tud_cdc_rx_wanted_cb(itf, p_cdc->wanted_char);
|
||||
break; // only invoke once per transfer, even multiple wanted chars are present
|
||||
break; // only invoke once per transfer, even if multiple wanted chars are present
|
||||
}
|
||||
|
||||
if (ptr == buf_info.ptr_wrap) {
|
||||
|
||||
@ -400,7 +400,7 @@ uint16_t tu_fifo_write_n_access(tu_fifo_t *f, const void *data, uint16_t n, tu_f
|
||||
const uint8_t *buf8 = (const uint8_t *)data;
|
||||
|
||||
TU_LOG(TU_FIFO_DBG, "rd = %3u, wr = %3u, count = %3u, remain = %3u, n = %3u: ", rd_idx, wr_idx,
|
||||
_ff_count(f->depth, wr_idx, rd_idx), _ff_remaining(f->depth, wr_idx, rd_idx), n);
|
||||
tu_ff_overflow_count(f->depth, wr_idx, rd_idx), tu_ff_remaining_local(f->depth, wr_idx, rd_idx), n);
|
||||
|
||||
if (!f->overwritable) {
|
||||
// limit up to full
|
||||
|
||||
@ -437,7 +437,7 @@ def test_device_cdc_msc(board):
|
||||
ser.write(test_str)
|
||||
ser.flush()
|
||||
rd_str = ser.read(len(test_str))
|
||||
assert rd_str == test_str, f'CDC wrong data ({size} bytes): expected: {test_str[:16]}... was {rd_str[:16]}'
|
||||
assert rd_str == test_str, f'CDC wrong data ({size} bytes):\n expected: {test_str}\n was: {rd_str}'
|
||||
|
||||
ser.close()
|
||||
|
||||
|
||||
@ -182,10 +182,10 @@ static uint16_t help_write(uint16_t total, uint16_t n) {
|
||||
}
|
||||
|
||||
void test_write_overwritable2(void) {
|
||||
tu_fifo_set_overwritable(ff, true);
|
||||
tu_fifo_set_overwritable(ff, true);
|
||||
|
||||
// based on actual crash tests detected by fuzzing
|
||||
uint16_t total = 0;
|
||||
// based on actual crash tests detected by fuzzing
|
||||
uint16_t total = 0;
|
||||
|
||||
total = help_write(total, 12);
|
||||
total = help_write(total, 55);
|
||||
|
||||
Reference in New Issue
Block a user