Skip to content

Commit

Permalink
adjust test expectation and add esp32c3 to automatic build
Browse files Browse the repository at this point in the history
  • Loading branch information
gin66 committed Oct 14, 2023
1 parent dfad0dd commit 2f2727e
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 25 deletions.
3 changes: 2 additions & 1 deletion examples/StepperDemo/generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
#error "Unsupported derivate"
#endif

#if defined(CONFIG_IDF_TARGET_ESP32C3)
#if defined(CONFIG_TINYUSB_CDC_ENABLED)
USBCDC USBSerial;
#define SerialInterface USBSerial
#else
#define SerialInterface Serial
Expand Down
16 changes: 8 additions & 8 deletions extras/tests/simavr_based/test_sd_04_timing_2560/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
EnableA: 1*L->H, 1*H->L
EnableB: 2*L->H, 1*H->L
EnableC: 2*L->H, 1*H->L
StepA: 64000*L->H, 64000*H->L, Max High=24us Total High=391242us
StepB: 64000*L->H, 64000*H->L, Max High=33us Total High=394815us
StepC: 64000*L->H, 64000*H->L, Max High=34us Total High=477571us
StepA: 64000*L->H, 64000*H->L, Max High=28us Total High=521130us
StepB: 64000*L->H, 64000*H->L, Max High=36us Total High=393609us
StepC: 64000*L->H, 64000*H->L, Max High=40us Total High=485360us
Position[A]=64000

Position[B]=64000
Expand All @@ -15,15 +15,15 @@ Position[C]=64000

Time in EnableA max=233598 us, total=233598 us

Time in EnableB max=246086 us, total=246086 us
Time in EnableB max=246080 us, total=246080 us

Time in EnableC max=254235 us, total=254235 us

Time in FillISR max=3140 us, total=2095013 us
Time in FillISR max=2686 us, total=2092886 us

Time in StepA max=24 us, total=391242 us
Time in StepA max=28 us, total=521130 us

Time in StepB max=33 us, total=394815 us
Time in StepB max=36 us, total=393609 us

Time in StepC max=34 us, total=477571 us
Time in StepC max=40 us, total=485360 us

10 changes: 5 additions & 5 deletions extras/tests/simavr_based/test_sd_04_timing_328p/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
DirB: 1*L->H, 0*H->L
EnableA: 1*L->H, 1*H->L
EnableB: 2*L->H, 1*H->L
StepA: 1000*L->H, 1000*H->L, Max High=13us Total High=5548us
StepB: 1000*L->H, 1000*H->L, Max High=18us Total High=5547us
StepA: 1000*L->H, 1000*H->L, Max High=13us Total High=5545us
StepB: 1000*L->H, 1000*H->L, Max High=16us Total High=5514us
Position[A]=1000

Position[B]=1000
Expand All @@ -12,11 +12,11 @@ Time in EnableA max=225398 us, total=225398 us

Time in EnableB max=238116 us, total=238116 us

Time in FillISR max=2644 us, total=47713 us
Time in FillISR max=2644 us, total=47660 us

Time in StepA max=13 us, total=5548 us
Time in StepA max=13 us, total=5545 us

Time in StepB max=18 us, total=5547 us
Time in StepB max=16 us, total=5514 us

Time in StepISR max=7 us, total=9224 us

Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
DirB: 1*L->H, 0*H->L
EnableA: 1*L->H, 1*H->L
EnableB: 1*L->H, 0*H->L
StepA: 1000*L->H, 1000*H->L, Max High=11us Total High=5281us
StepA: 1000*L->H, 1000*H->L, Max High=11us Total High=5268us
StepB: 0*L->H, 0*H->L, Max High=0us Total High=0us
Position[A]=1000

Time in EnableA max=225399 us, total=225399 us

Time in FillISR max=2015 us, total=27776 us
Time in FillISR max=2015 us, total=27549 us

Time in StepA max=11 us, total=5281 us
Time in StepA max=11 us, total=5268 us

Time in StepISR max=7 us, total=4581 us

6 changes: 3 additions & 3 deletions extras/tests/simavr_based/test_sd_11_328p/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
DirB: 1*L->H, 0*H->L
EnableA: 1*L->H, 1*H->L
EnableB: 1*L->H, 0*H->L
StepA: 99808*L->H, 99808*H->L, Max High=13us Total High=513811us
StepA: 99808*L->H, 99808*H->L, Max High=13us Total High=514436us
StepB: 0*L->H, 0*H->L, Max High=0us Total High=0us
Position[A]=50736
Position[A]=50536

Time in EnableA max=225395 us, total=225395 us

Time in StepA max=13 us, total=513811 us
Time in StepA max=13 us, total=514436 us

10 changes: 5 additions & 5 deletions src/StepperISR_esp32c3_rmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
//
#ifdef SUPPORT_ESP32C3_RMT
#define PART_SIZE 23
#define MEM_SIZE 48
#define RMT_MEM_SIZE 48
#else
#error
#define PART_SIZE 31
#define MEM_SIZE 64
#define RMT_MEM_SIZE 64
#endif

// In order to avoid threshold/end interrupt on end, add one
Expand Down Expand Up @@ -563,7 +563,7 @@ void StepperQueue::startQueue_rmt() {
USBSerial.print(read_idx);
USBSerial.print('/');
USBSerial.println(next_write_idx);
for (uint8_t i = 0; i < MEM_SIZE; i++) {
for (uint8_t i = 0; i < RMT_MEM_SIZE; i++) {
USBSerial.print(i);
USBSerial.print(' ');
USBSerial.println(mem[i], HEX);
Expand Down Expand Up @@ -591,7 +591,7 @@ void StepperQueue::startQueue_rmt() {
USBSerial.println(' ');
USBSerial.print(RMT.tx_conf[channel].mem_tx_wrap_en);
USBSerial.println(' ');
for (uint8_t i = 0; i < MEM_SIZE; i++) {
for (uint8_t i = 0; i < RMT_MEM_SIZE; i++) {
USBSerial.print(i);
USBSerial.print(' ');
USBSerial.println(mem[i], HEX);
Expand All @@ -609,7 +609,7 @@ void StepperQueue::startQueue_rmt() {
USBSerial.print(RMT.tx_conf[channel].mem_tx_wrap_en);
USBSerial.println(' ');

for (uint8_t i = 0; i < MEM_SIZE; i++) {
for (uint8_t i = 0; i < RMT_MEM_SIZE; i++) {
USBSerial.print(i);
USBSerial.print(' ');
USBSerial.println(mem[i], HEX);
Expand Down

0 comments on commit 2f2727e

Please sign in to comment.