File tree 2 files changed +6
-1
lines changed
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -185,9 +185,10 @@ void Command_Interpreter_RPi5::blind_execute(const CommandComponent& commandComp
185
185
auto endTime = std::chrono::system_clock::now () + commandComponent.duration ;
186
186
auto currentTime = std::chrono::system_clock::now ();
187
187
execute (commandComponent.thruster_pwms , logfile);
188
- while (currentTime < endTime) {
188
+ while (currentTime < endTime && !isInterruptBlind_Execute ) {
189
189
currentTime = std::chrono::system_clock::now ();
190
190
}
191
+ isInterruptBlind_Execute = false ;
191
192
}
192
193
193
194
// void Command_Interpreter_RPi5::corrective_execute(command_component command, std::ofstream logfile) {
Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ class Command_Interpreter_RPi5 {
108
108
std::vector<PwmPin*> thrusterPins;
109
109
std::vector<DigitalPin*> digitalPins;
110
110
WiringControl wiringControl;
111
+ bool isInterruptBlind_Execute;
111
112
112
113
public:
113
114
explicit Command_Interpreter_RPi5 (std::vector<PwmPin*> thrusterPins, std::vector<DigitalPin*> digitalPins);
@@ -132,6 +133,9 @@ class Command_Interpreter_RPi5 {
132
133
// / varies depending on the type.
133
134
std::vector<int > readPins ();
134
135
136
+ // / @brief Set an interrupt for the blind_execute function while running. Calling this function sets the interrupt to occur.
137
+ void interruptBlind_Execute () {isInterruptBlind_Execute = true ;}
138
+
135
139
~Command_Interpreter_RPi5 (); // TODO this also deletes all its pins. Not sure if this is desirable or not?
136
140
};
137
141
You can’t perform that action at this time.
0 commit comments