Skip to content

Commit b98127f

Browse files
committed
hil stress test cdc
1 parent b7bf1d9 commit b98127f

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/class/cdc/cdc_device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ bool cdcd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_
513513
for (uint32_t i = 0; i < xferred_bytes; i++) {
514514
if (p_cdc->wanted_char == (char)*ptr) {
515515
tud_cdc_rx_wanted_cb(itf, p_cdc->wanted_char);
516-
break; // only invoke once per transfer, even multiple wanted chars are present
516+
break; // only invoke once per transfer, even if multiple wanted chars are present
517517
}
518518

519519
if (ptr == buf_info.ptr_wrap) {

src/common/tusb_fifo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ uint16_t tu_fifo_write_n_access(tu_fifo_t *f, const void *data, uint16_t n, tu_f
400400
const uint8_t *buf8 = (const uint8_t *)data;
401401

402402
TU_LOG(TU_FIFO_DBG, "rd = %3u, wr = %3u, count = %3u, remain = %3u, n = %3u: ", rd_idx, wr_idx,
403-
_ff_count(f->depth, wr_idx, rd_idx), _ff_remaining(f->depth, wr_idx, rd_idx), n);
403+
tu_ff_overflow_count(f->depth, wr_idx, rd_idx), tu_ff_remaining_local(f->depth, wr_idx, rd_idx), n);
404404

405405
if (!f->overwritable) {
406406
// limit up to full

test/hil/hil_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ def rand_ascii(length):
437437
ser.write(test_str)
438438
ser.flush()
439439
rd_str = ser.read(len(test_str))
440-
assert rd_str == test_str, f'CDC wrong data ({size} bytes): expected: {test_str[:16]}... was {rd_str[:16]}'
440+
assert rd_str == test_str, f'CDC wrong data ({size} bytes):\n expected: {test_str}\n was: {rd_str}'
441441

442442
ser.close()
443443

test/unit-test/test/test_fifo.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,10 @@ static uint16_t help_write(uint16_t total, uint16_t n) {
182182
}
183183

184184
void test_write_overwritable2(void) {
185-
tu_fifo_set_overwritable(ff, true);
185+
tu_fifo_set_overwritable(ff, true);
186186

187-
// based on actual crash tests detected by fuzzing
188-
uint16_t total = 0;
187+
// based on actual crash tests detected by fuzzing
188+
uint16_t total = 0;
189189

190190
total = help_write(total, 12);
191191
total = help_write(total, 55);

0 commit comments

Comments
 (0)