@@ -127,8 +127,7 @@ Command_Interpreter_RPi5::Command_Interpreter_RPi5(std::vector<PwmPin *> thruste
127
127
const WiringControl &wiringControl, std::ostream &output,
128
128
std::ostream &outLog, std::ostream &errorLog) :
129
129
thrusterPins(std::move(thrusterPins)), digitalPins(std::move(digitalPins)), wiringControl(wiringControl),
130
- errorLog(errorLog),
131
- outLog(outLog), output(output) {
130
+ errorLog(errorLog), outLog(outLog), output(output), isInterruptBlind_Execute(false ) {
132
131
if (this ->thrusterPins .size () != 8 ) {
133
132
errorLog << " Incorrect number of thruster pwm pins given! Need 8, given " << this ->thrusterPins .size ()
134
133
<< std::endl;
@@ -168,13 +167,14 @@ Command_Interpreter_RPi5::~Command_Interpreter_RPi5() {
168
167
}
169
168
170
169
void Command_Interpreter_RPi5::timed_execute (const CommandComponent &commandComponent) {
170
+ isInterruptBlind_Execute = false ;
171
171
auto endTime = std::chrono::system_clock::now () + commandComponent.duration ;
172
172
auto currentTime = std::chrono::system_clock::now ();
173
173
untimed_execute (commandComponent.thruster_pwms );
174
- while (currentTime < endTime) {
175
-
174
+ while (currentTime < endTime && !isInterruptBlind_Execute) {
176
175
currentTime = std::chrono::system_clock::now ();
177
176
}
177
+ isInterruptBlind_Execute = false ;
178
178
}
179
179
180
180
void Command_Interpreter_RPi5::untimed_execute (pwm_array thrusterPwms) {
0 commit comments