Skip to content

Commit

Permalink
Fix missing initialization in getCurrentSpeedInTicks() from issue #262
Browse files Browse the repository at this point in the history
  • Loading branch information
gin66 committed Jun 15, 2024
1 parent 5a11338 commit 490e293
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 23 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ TODO:
- rename RampConstAcceleration to e.g. RampControl
- merge the two esp32 rmt drivers as soon as esp32c3 works

0.30.15:
- Fix missing initialization in `getCurrentSpeedInTicks()` (#262)

0.30.14:
- Fix typo in library.properties. No functional changes

Expand Down
14 changes: 7 additions & 7 deletions extras/tests/simavr_based/test_issue208/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
DirB: 1*L->H, 0*H->L
EnableA: 0*L->H, 0*H->L
EnableB: 0*L->H, 0*H->L
StepA: 235908*L->H, 235908*H->L, Max High=11us Total High=927312us
StepB: 2*L->H, 2*H->L, Max High=12us Total High=17us
Position[A]=37462
StepA: 235907*L->H, 235907*H->L, Max High=11us Total High=927410us
StepB: 2*L->H, 2*H->L, Max High=14us Total High=19us
Position[A]=37463

Position[B]=2

Time in FillISR max=767 us, total=1211908 us
Time in FillISR max=772 us, total=1218907 us

Time in StepA max=11 us, total=927312 us
Time in StepA max=11 us, total=927410 us

Time in StepB max=12 us, total=17 us
Time in StepB max=14 us, total=19 us

Time in StepISR max=6 us, total=897842 us
Time in StepISR max=6 us, total=897838 us

14 changes: 7 additions & 7 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=25us Total High=311049us
StepB: 64000*L->H, 64000*H->L, Max High=31us Total High=364986us
StepC: 64000*L->H, 64000*H->L, Max High=38us Total High=530547us
StepA: 64000*L->H, 64000*H->L, Max High=23us Total High=310838us
StepB: 64000*L->H, 64000*H->L, Max High=30us Total High=364986us
StepC: 64000*L->H, 64000*H->L, Max High=38us Total High=533749us
Position[A]=64000

Position[B]=64000
Expand All @@ -19,11 +19,11 @@ Time in EnableB max=246080 us, total=246080 us

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

Time in FillISR max=2740 us, total=2116523 us
Time in FillISR max=2740 us, total=2116404 us

Time in StepA max=25 us, total=311049 us
Time in StepA max=23 us, total=310838 us

Time in StepB max=31 us, total=364986 us
Time in StepB max=30 us, total=364986 us

Time in StepC max=38 us, total=530547 us
Time in StepC max=38 us, total=533749 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=4231us
StepB: 1000*L->H, 1000*H->L, Max High=15us Total High=5045us
StepA: 1000*L->H, 1000*H->L, Max High=13us Total High=4221us
StepB: 1000*L->H, 1000*H->L, Max High=15us Total High=5050us
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=238118 us, total=238118 us

Time in FillISR max=2651 us, total=47806 us
Time in FillISR max=2651 us, total=47814 us

Time in StepA max=13 us, total=4231 us
Time in StepA max=13 us, total=4221 us

Time in StepB max=15 us, total=5045 us
Time in StepB max=15 us, total=5050 us

Time in StepISR max=6 us, total=8566 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=10us Total High=3948us
StepA: 1000*L->H, 1000*H->L, Max High=9us Total High=3944us
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=2023 us, total=27615 us
Time in FillISR max=2023 us, total=27600 us

Time in StepA max=10 us, total=3948 us
Time in StepA max=9 us, total=3944 us

Time in StepISR max=5 us, total=3975 us

2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=FastAccelStepper
version=0.30.14
version=0.30.15
license=MIT
author=Jochen Kiemes <[email protected]>
maintainer=Jochen Kiemes <[email protected]>
Expand Down
3 changes: 3 additions & 0 deletions src/FastAccelStepper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,9 @@ void FastAccelStepper::getCurrentSpeedInTicks(struct actual_ticks_s* speed,
if (_rg.isRampGeneratorActive()) {
_rg.getCurrentSpeedInTicks(speed);
}
else {
speed->ticks = 0;
}
}
}
int32_t FastAccelStepper::getCurrentSpeedInUs(bool realtime) {
Expand Down

0 comments on commit 490e293

Please sign in to comment.