mirror of
https://github.com/DashyFox/StackSport.git
synced 2025-05-04 15:20:16 +00:00
screw speed change protection
This commit is contained in:
parent
195d6ef021
commit
ea5770e9f7
@ -154,20 +154,61 @@ void IR_Home_Process() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case IR_TEMPO_INC:
|
case IR_TEMPO_INC:
|
||||||
if (isshotRcOverride && currentInfo.shot.shot.speedScrew < 100) {
|
{
|
||||||
currentInfo.shot.shot.speedScrew++;
|
switch(currentInfo.mode){
|
||||||
shotApply(¤tInfo.shot);
|
case NoneMode:
|
||||||
// led_progressbar(10, 19, currentInfo.shot.shot.speedScrew); //todo: led_progressbarTMP
|
break;
|
||||||
onHoldRepeat = IR_Home_Process;
|
case DebugShot:
|
||||||
|
case ShotMode:{
|
||||||
|
if (currentInfo.state == RUN && currentInfo.shot.shot.speedScrew < 100) {
|
||||||
|
currentInfo.shot.shot.speedScrew++;
|
||||||
|
shotApply(¤tInfo.shot);
|
||||||
|
// led_progressbar(10, 19, currentInfo.shot.shot.speedScrew); //todo: led_progressbarTMP
|
||||||
|
onHoldRepeat = IR_Home_Process;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ProgramMode:{
|
||||||
|
//
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case MacroMode:{
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IR_TEMPO_DEC:
|
case IR_TEMPO_DEC:
|
||||||
if (isshotRcOverride && currentInfo.shot.shot.speedScrew > 0) {
|
switch(currentInfo.mode){
|
||||||
currentInfo.shot.shot.speedScrew--;
|
case NoneMode:
|
||||||
shotApply(¤tInfo.shot);
|
break;
|
||||||
onHoldRepeat = IR_Home_Process;
|
case DebugShot:
|
||||||
}
|
case ShotMode:{
|
||||||
|
if (currentInfo.state == RUN && currentInfo.shot.shot.speedScrew > 0) {
|
||||||
|
currentInfo.shot.shot.speedScrew--;
|
||||||
|
shotApply(¤tInfo.shot);
|
||||||
|
onHoldRepeat = IR_Home_Process;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ProgramMode:{
|
||||||
|
// изменить переменную оверрайда
|
||||||
|
// выставить флаг
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case MacroMode:{
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IR_ENGINE_UP_INC:
|
case IR_ENGINE_UP_INC:
|
||||||
@ -482,7 +523,7 @@ void IR_ShootingStart() {
|
|||||||
InputHandler = IR_Home_Process;
|
InputHandler = IR_Home_Process;
|
||||||
IR_Home_Process();
|
IR_Home_Process();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,6 +47,10 @@ uint8_t loadShotFromProgram(CurrentProgram *currentProg);
|
|||||||
uint8_t loadNextProgramInMacro(CurrentMacro *currentMacro);
|
uint8_t loadNextProgramInMacro(CurrentMacro *currentMacro);
|
||||||
uint8_t loadProgramFromMacro(CurrentMacro *currentMacro);
|
uint8_t loadProgramFromMacro(CurrentMacro *currentMacro);
|
||||||
|
|
||||||
|
uint8_t overridenSpeedScrew_Shot;
|
||||||
|
uint8_t overridenSpeedScrew_Program;
|
||||||
|
uint8_t overridenSpeedScrew_Macro;
|
||||||
|
|
||||||
void setPosOffDelay(uint16_t ms){
|
void setPosOffDelay(uint16_t ms){
|
||||||
stop_timer = millis();
|
stop_timer = millis();
|
||||||
stop_timer_TIMEOUT = ms;
|
stop_timer_TIMEOUT = ms;
|
||||||
@ -374,10 +378,10 @@ uint8_t loadShotFromProgram(CurrentProgram *currentProg) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t overridenSpeedScrew =
|
overridenSpeedScrew_Program =
|
||||||
currentProg->program.shots[currentShotIndexLocal].speedScrew;
|
currentProg->program.shots[currentShotIndexLocal].speedScrew;
|
||||||
if (overridenSpeedScrew != 0) {
|
if (overridenSpeedScrew_Program != 0) {
|
||||||
shot_.speedScrew = overridenSpeedScrew;
|
shot_.speedScrew = overridenSpeedScrew_Program;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t repeatCountFromShot = currentProg->program.header.options & 2U;
|
uint8_t repeatCountFromShot = currentProg->program.header.options & 2U;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user