File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 2828#include < etl/vector.h>
2929
3030#include < algorithm>
31- #include < array>
3231#include < charconv>
3332#include < cstddef>
3433#include < cstdint>
@@ -61,8 +60,6 @@ constexpr auto cepData = 0x8b_b; //! Data packet format is used (not a command
6160// 1.5 s just to be sure.
6261constexpr auto sendTimeout = 1500 * ms;
6362constexpr auto receiveTimeout = 1500 * ms;
64- // TODO: Can we choose a smaller value?
65- constexpr auto flushReceiveBufferTimeout = 1 * ms;
6663
6764// TODO: Choose proper values
6865// Max. number of send retries after receiving NACK
Original file line number Diff line number Diff line change @@ -86,13 +86,16 @@ class EduPowerManagementThread : public RODOS::StaticThread<stackSize>
8686 nextEduProgramStartTimeBuffer.get (nextEduProgramStartTime);
8787 auto timeTillNextEduProgram = ToRodosTime (nextEduProgramStartTime) - CurrentRodosTime ();
8888 auto eduHasUpdate = edu::updateGpioPin.Read () == hal::PinState::set;
89- auto noWorkMustBeDoneInTheNearFuture =
90- not eduHasUpdate and not edu::ProgramsAreAvailableOnCobc ()
91- and timeTillNextEduProgram > persistentVariables.Load <" maxEduIdleDuration" >();
92- if (eduIsAlive and noWorkMustBeDoneInTheNearFuture)
89+ if (eduIsAlive)
9390 {
94- DEBUG_PRINT (" Turning EDU off\n " );
95- edu::TurnOff ();
91+ auto noWorkMustBeDoneInTheNearFuture =
92+ not eduHasUpdate and not edu::ProgramsAreAvailableOnCobc ()
93+ and timeTillNextEduProgram > persistentVariables.Load <" maxEduIdleDuration" >();
94+ if (noWorkMustBeDoneInTheNearFuture)
95+ {
96+ DEBUG_PRINT (" Turning EDU off\n " );
97+ edu::TurnOff ();
98+ }
9699 }
97100 else if (not eduIsAlive and timeTillNextEduProgram < (eduBootTime + eduBootTimeMargin))
98101 {
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ class EduProgramTransferThread : public RODOS::StaticThread<stackSize>
5151 {
5252 auto eduIsAlive = false ;
5353 eduIsAliveBufferForProgramTransfer.get (eduIsAlive);
54- if (edu::ProgramsAreAvailableOnCobc () and eduIsAlive )
54+ if (eduIsAlive and edu::ProgramsAreAvailableOnCobc ())
5555 {
5656 DEBUG_PRINT (" Sending programs to EDU\n " );
5757 SendProgramsToEdu ();
You can’t perform that action at this time.
0 commit comments