mirror of
https://github.com/DashyFox/StackSport.git
synced 2025-05-04 07:10:17 +00:00
fix programm
This commit is contained in:
parent
9b94fd12d6
commit
1564f38ff3
@ -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);
|
||||
|
@ -65,7 +65,7 @@ void UART3_SaveProgram(uint8_t *dataPtr, uint8_t len) {
|
||||
prog.header.countRepeat = dataPtr[2];
|
||||
prog.header.options = dataPtr[3];
|
||||
|
||||
if (dataPtr[4] != 0xFF && dataPtr[5]) {
|
||||
if (dataPtr[4] != 0xFF && dataPtr[5] != 0xFF) {
|
||||
for (uint8_t i = 0; i < prog.header.shotCount; i++) {
|
||||
uint8_t pos = 4 + i * sizeof(ProgramShot);
|
||||
prog.shots[i].id = dataPtr[pos + 0];
|
||||
|
Loading…
x
Reference in New Issue
Block a user