mirror of
https://github.com/DashyFox/StackSport.git
synced 2025-05-04 07:10:17 +00:00
clean
This commit is contained in:
parent
d9ad8667cc
commit
d088948a1d
@ -346,8 +346,10 @@ uint8_t loadProgramFromMacro(CurrentMacro *currentMacro) {
|
||||
print("Program indexGlobal out of range in currentMacro\n");
|
||||
return 0;
|
||||
}
|
||||
MacroProgram *macroProgram =
|
||||
¤tMacro->macro.programs[currentProgIndexLocal];
|
||||
|
||||
uint8_t programId = currentMacro->macro.programs[currentProgIndexLocal].id;
|
||||
uint8_t programId = macroProgram->id;
|
||||
currentMacro->currentProgram.indexGlobal = programId;
|
||||
getProg(programId, &program_);
|
||||
|
||||
@ -357,20 +359,19 @@ uint8_t loadProgramFromMacro(CurrentMacro *currentMacro) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8_t needOverride =
|
||||
currentMacro->macro.programs[currentProgIndexLocal].countRepeat != 0
|
||||
&& currentMacro->macro.programs[currentProgIndexLocal].speedScrew
|
||||
!= 0;
|
||||
uint8_t needOverride = macroProgram->countRepeat != 0
|
||||
&& macroProgram->speedScrew != 0;
|
||||
|
||||
if (needOverride) {
|
||||
print("Override programs params\n");
|
||||
program_.header.countRepeat =
|
||||
currentMacro->macro.programs[currentProgIndexLocal].countRepeat;
|
||||
program_.header.options =
|
||||
currentMacro->macro.programs[currentProgIndexLocal].options;
|
||||
program_.header.countRepeat = macroProgram->countRepeat;
|
||||
|
||||
// options override(???)
|
||||
uint8_t options = macroProgram->options;
|
||||
program_.header.options = options;
|
||||
|
||||
for (uint8_t i = 0; i < program_.header.shotCount; i++) {
|
||||
program_.shots[i].speedScrew =
|
||||
currentMacro->macro.programs[currentProgIndexLocal].speedScrew;
|
||||
program_.shots[i].speedScrew = macroProgram->speedScrew;
|
||||
}
|
||||
}
|
||||
currentMacro->currentProgram.program = program_;
|
||||
|
Loading…
x
Reference in New Issue
Block a user