icuStartCapture panic better state validation
This commit is contained in:
parent
429847a4d9
commit
cc55c143f5
|
@ -547,6 +547,16 @@ void chDbgPanic3(const char *msg, const char * file, int line);
|
|||
#define hasFatalError() (FALSE)
|
||||
#endif
|
||||
|
||||
|
||||
#define chDbgAssert(c, remark) do { \
|
||||
if (CH_DBG_ENABLE_ASSERTS != FALSE) { \
|
||||
if (!(c)) { \
|
||||
/*lint -restore*/ \
|
||||
chSysHalt(remark); \
|
||||
} \
|
||||
} \
|
||||
} while (false)
|
||||
|
||||
#endif /* _CHCONF_H_ */
|
||||
|
||||
/** @} */
|
||||
|
|
|
@ -211,6 +211,8 @@ void startInputDriver(digital_input_s *hw, bool isActiveHigh) {
|
|||
}
|
||||
wave_icucfg.channel = getInputCaptureChannel(hw->brainPin);
|
||||
efiIcuStart(driver, &wave_icucfg);
|
||||
efiAssertVoid(driver != NULL, "di: driver is NULL");
|
||||
efiAssertVoid(driver->state == ICU_READY, "di: driver not ready");
|
||||
icuStartCapture(driver); // this would change state from READY to WAITING
|
||||
icuEnableNotifications(driver);
|
||||
}
|
||||
|
|
|
@ -123,6 +123,8 @@ static ICUDriver *turnOnTriggerInputPin(const char *msg, brain_pin_e hwPin, ICUC
|
|||
|
||||
efiIcuStart(driver, icucfg);
|
||||
if (driver->state == ICU_READY) {
|
||||
efiAssertVoid(driver != NULL, "ti: driver is NULL");
|
||||
efiAssertVoid(driver->state == ICU_READY, "ti: driver not ready");
|
||||
icuStartCapture(driver); // this would change state from READY to WAITING
|
||||
icuEnableNotifications(driver);
|
||||
} else {
|
||||
|
|
|
@ -251,5 +251,5 @@ int getRusEfiVersion(void) {
|
|||
return 123; // this is here to make the compiler happy about the unused array
|
||||
if (UNUSED_CCM_SIZE[0] * 0 != 0)
|
||||
return 3211; // this is here to make the compiler happy about the unused array
|
||||
return 20170424;
|
||||
return 20170426;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue