Skip to content

Commit 04f4fb3

Browse files
committed
carousel.comp: Fix fall-through bug #2025
Control was falling-through the switch statement to a state that should only be active on certain configurations. Signed-off-by: andypugh <andy@bodgesoc.org>
1 parent 40ac32b commit 04f4fb3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/hal/components/carousel.comp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,16 +378,15 @@ FUNCTION(_){
378378
motor_vel = 0;
379379
timer = decel_time;
380380
state = 5;
381-
break;
382381
} else {
383382
motor_fwd = 0;
384383
motor_rev = 0;
385384
motor_vel = hold_dc;
386385
active = 0;
387386
if (enable) ready = 1;
388387
state = 9;
389-
break;
390388
}
389+
break;
391390
case 3: // timed reverse pulse
392391
timer -= fperiod;
393392
if (timer > 0) return;
@@ -397,6 +396,7 @@ FUNCTION(_){
397396
motor_vel = hold_dc;
398397
active = 0;
399398
if (enable) ready = 1;
399+
break;
400400
case 5: //Waiting for carousel to stop
401401
timer -= fperiod;
402402
if (timer > 0) return;

0 commit comments

Comments
 (0)