Skip to content

Commit

Permalink
test for issue #250 fails faster
Browse files Browse the repository at this point in the history
  • Loading branch information
gin66 committed Apr 26, 2024
1 parent 22fd7ab commit 2d3cecc
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions examples/Issue250/Issue250.ino
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,24 @@ void loop() {
loopcnt++;
Serial.print("Loop=");
Serial.println(loopcnt);
uint32_t start_ms;
uint32_t delayForward = (rand() % 50) + 50;
uint32_t delayBackward = (rand() % 50) + 50;
stepper->runForward();
delay(delayForward);
start_ms = millis();
while (millis() < delayForward + start_ms) {
noInterrupts();
_delay_us(25);
interrupts();
}
stepper->runBackward();
uint32_t start_ms = millis();
start_ms = millis();
while (millis() < delayBackward + start_ms) {
noInterrupts();
_delay_us(25);
interrupts();
}
if (loopcnt == 1000) {
if (loopcnt == 200) {
#ifdef SIMULATOR
stepper->moveTo(0, true);
noInterrupts();
Expand Down

0 comments on commit 2d3cecc

Please sign in to comment.