From b95af34bfde20fb3db4aa2ce8c1e329ab2ded6ab Mon Sep 17 00:00:00 2001 From: DashyFox Date: Sun, 22 Sep 2024 23:21:44 +0300 Subject: [PATCH] fix program infinity mod --- Core/Inc/RobotFunctions.h | 1 - Core/Src/RobotFunctions.c | 8 +++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Core/Inc/RobotFunctions.h b/Core/Inc/RobotFunctions.h index 4f6c8f8..c8aed5d 100644 --- a/Core/Inc/RobotFunctions.h +++ b/Core/Inc/RobotFunctions.h @@ -16,7 +16,6 @@ #define PRE_RUN_DELAY_MODE 0 #define NOBALL_TIMEOUT_MULTIPLIER 4.2 - typedef enum ServoMap{ SERVO_AXIAL = 0, SERVO_HORIZONTAL = 1, diff --git a/Core/Src/RobotFunctions.c b/Core/Src/RobotFunctions.c index 11a3995..9adb4d3 100644 --- a/Core/Src/RobotFunctions.c +++ b/Core/Src/RobotFunctions.c @@ -168,7 +168,8 @@ void BallEXT_Handler() { } if (currentInfo.program.currentBallCount + 1 - < currentInfo.program.program.header.countRepeat) { + < currentInfo.program.program.header.countRepeat + || currentInfo.program.program.header.countRepeat == 0) { currentInfo.program.currentBallCount++; } else { stopShooting(); @@ -266,8 +267,9 @@ void shotApply(Shot *shot) { shot->rotationVertical); setRollersSpeed(shot->speedRollerTop, shot->speedRollerBottom); setScrewkSpeed(shot->speedScrew); - noBallTimeout = MIN(calculatePeriod( - shot->speedScrew) * NOBALL_TIMEOUT_MULTIPLIER, 30000); + noBallTimeout = MIN( + calculatePeriod( shot->speedScrew) * NOBALL_TIMEOUT_MULTIPLIER, + 30000); noBallTimer = millis(); print("Fire!\n"); print("isExist ");