fix programm

This commit is contained in:
2024-09-22 23:02:30 +03:00
parent 9b94fd12d6
commit 1564f38ff3
2 changed files with 10 additions and 6 deletions

View File

@ -13,7 +13,7 @@
#include "Print.h"
#include "SimpleTimer.h"
#define ballReact_value 10
#define ballReact_value 10 // время реакции на вылет мяча
CurrentInfo currentInfo;
@ -266,8 +266,8 @@ void shotApply(Shot *shot) {
shot->rotationVertical);
setRollersSpeed(shot->speedRollerTop, shot->speedRollerBottom);
setScrewkSpeed(shot->speedScrew);
noBallTimeout = calculatePeriod(
shot->speedScrew) * NOBALL_TIMEOUT_MULTIPLIER;
noBallTimeout = MIN(calculatePeriod(
shot->speedScrew) * NOBALL_TIMEOUT_MULTIPLIER, 30000);
noBallTimer = millis();
print("Fire!\n");
print("isExist ");
@ -308,8 +308,13 @@ uint8_t loadShotFromProgram(CurrentProgram *currentProg) {
// TODO: sound_ERR(); ledFX_ERR();
return 0;
}
shot_.speedScrew =
uint8_t overridenSpeedScrew =
currentProg->program.shots[currentProgramShotId].speedScrew;
if (overridenSpeedScrew != 0) {
shot_.speedScrew = overridenSpeedScrew;
}
uint8_t repeatCountFromShot = currentProg->program.header.options & 2U;
if (!repeatCountFromShot) {
print("Repeat Count Override\n");
@ -410,7 +415,6 @@ uint8_t prepareShot(uint8_t number) {
return 0;
}
}
uint8_t prepareProgramm(uint8_t number) {
Program program;
getProg(number, &program);