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");
|
print("Program indexGlobal out of range in currentMacro\n");
|
||||||
return 0;
|
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;
|
currentMacro->currentProgram.indexGlobal = programId;
|
||||||
getProg(programId, &program_);
|
getProg(programId, &program_);
|
||||||
|
|
||||||
@ -357,20 +359,19 @@ uint8_t loadProgramFromMacro(CurrentMacro *currentMacro) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t needOverride =
|
uint8_t needOverride = macroProgram->countRepeat != 0
|
||||||
currentMacro->macro.programs[currentProgIndexLocal].countRepeat != 0
|
&& macroProgram->speedScrew != 0;
|
||||||
&& currentMacro->macro.programs[currentProgIndexLocal].speedScrew
|
|
||||||
!= 0;
|
|
||||||
|
|
||||||
if (needOverride) {
|
if (needOverride) {
|
||||||
print("Override programs params\n");
|
print("Override programs params\n");
|
||||||
program_.header.countRepeat =
|
program_.header.countRepeat = macroProgram->countRepeat;
|
||||||
currentMacro->macro.programs[currentProgIndexLocal].countRepeat;
|
|
||||||
program_.header.options =
|
// options override(???)
|
||||||
currentMacro->macro.programs[currentProgIndexLocal].options;
|
uint8_t options = macroProgram->options;
|
||||||
|
program_.header.options = options;
|
||||||
|
|
||||||
for (uint8_t i = 0; i < program_.header.shotCount; i++) {
|
for (uint8_t i = 0; i < program_.header.shotCount; i++) {
|
||||||
program_.shots[i].speedScrew =
|
program_.shots[i].speedScrew = macroProgram->speedScrew;
|
||||||
currentMacro->macro.programs[currentProgIndexLocal].speedScrew;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
currentMacro->currentProgram.program = program_;
|
currentMacro->currentProgram.program = program_;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user