@@ -869,7 +869,10 @@ static void checkRTCBattery()
|
|||||||
void checkFailsafe()
|
void checkFailsafe()
|
||||||
{
|
{
|
||||||
for (int i=0; i<NUM_MODULES; i++) {
|
for (int i=0; i<NUM_MODULES; i++) {
|
||||||
if (isModuleFailsafeAvailable(i)) {
|
if (isModuleMultimodule(i)) {
|
||||||
|
multiModuleStatus.requiresFailsafeCheck = true;
|
||||||
|
}
|
||||||
|
else if (isModuleFailsafeAvailable(i)) {
|
||||||
ModuleData & moduleData = g_model.moduleData[i];
|
ModuleData & moduleData = g_model.moduleData[i];
|
||||||
if (moduleData.failsafeMode == FAILSAFE_NOT_SET) {
|
if (moduleData.failsafeMode == FAILSAFE_NOT_SET) {
|
||||||
ALERT(STR_FAILSAFEWARN, STR_NO_FAILSAFE, AU_ERROR);
|
ALERT(STR_FAILSAFEWARN, STR_NO_FAILSAFE, AU_ERROR);
|
||||||
|
|||||||
@@ -73,6 +73,12 @@ static void processMultiStatusPacket(const uint8_t *data)
|
|||||||
multiModuleStatus.patch = data[4];
|
multiModuleStatus.patch = data[4];
|
||||||
multiModuleStatus.lastUpdate = get_tmr10ms();
|
multiModuleStatus.lastUpdate = get_tmr10ms();
|
||||||
|
|
||||||
|
if (multiModuleStatus.requiresFailsafeCheck == true) {
|
||||||
|
multiModuleStatus.requiresFailsafeCheck = false;
|
||||||
|
if (multiModuleStatus.supportsFailsafe() && g_model.moduleData[EXTERNAL_MODULE].failsafeMode == FAILSAFE_NOT_SET)
|
||||||
|
POPUP_WARNING(STR_NO_FAILSAFE);
|
||||||
|
}
|
||||||
|
|
||||||
if (wasBinding && !multiModuleStatus.isBinding() && multiBindStatus == MULTI_BIND_INITIATED)
|
if (wasBinding && !multiModuleStatus.isBinding() && multiBindStatus == MULTI_BIND_INITIATED)
|
||||||
multiBindStatus = MULTI_BIND_FINISHED;
|
multiBindStatus = MULTI_BIND_FINISHED;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,17 +118,18 @@ struct MultiModuleStatus {
|
|||||||
uint8_t patch;
|
uint8_t patch;
|
||||||
|
|
||||||
uint8_t flags;
|
uint8_t flags;
|
||||||
|
uint8_t requiresFailsafeCheck;
|
||||||
tmr10ms_t lastUpdate;
|
tmr10ms_t lastUpdate;
|
||||||
|
|
||||||
void getStatusString(char* statusText);
|
void getStatusString(char* statusText);
|
||||||
|
|
||||||
inline bool isValid() { return (bool)(get_tmr10ms() - lastUpdate < 200); }
|
inline bool isValid() const { return (bool)(get_tmr10ms() - lastUpdate < 200); }
|
||||||
inline bool supportsFailsafe() { return (bool) (flags & 0x20); }
|
inline bool supportsFailsafe() const { return (bool) (flags & 0x20); }
|
||||||
inline bool isWaitingforBind() { return (bool) (flags & 0x10); }
|
inline bool isWaitingforBind() const { return (bool) (flags & 0x10); }
|
||||||
inline bool isBinding() { return (bool) (flags & 0x08); }
|
inline bool isBinding() const { return (bool) (flags & 0x08); }
|
||||||
inline bool protocolValid() { return (bool) (flags & 0x04); }
|
inline bool protocolValid() const { return (bool) (flags & 0x04); }
|
||||||
inline bool serialMode() { return (bool) (flags & 0x02); }
|
inline bool serialMode() const { return (bool) (flags & 0x02); }
|
||||||
inline bool inputDetected() { return (bool) (flags & 0x01); }
|
inline bool inputDetected() const { return (bool) (flags & 0x01); }
|
||||||
};
|
};
|
||||||
|
|
||||||
extern MultiModuleStatus multiModuleStatus;
|
extern MultiModuleStatus multiModuleStatus;
|
||||||
|
|||||||
Reference in New Issue
Block a user