21 #include "../config/failsafe.h"
23 #define FAILSAFE_POWER_ON_DELAY_US (1000 * 1000 * 5)
24 #define MILLIS_PER_TENTH_SECOND 100
25 #define MILLIS_PER_SECOND 1000
26 #define PERIOD_OF_1_SECONDS 1 * MILLIS_PER_SECOND
27 #define PERIOD_OF_3_SECONDS 3 * MILLIS_PER_SECOND
28 #define PERIOD_OF_30_SECONDS 30 * MILLIS_PER_SECOND
29 #define PERIOD_RXDATA_FAILURE 200 // millis
30 #define PERIOD_RXDATA_RECOVERY 200 // millis
bool failsafe_is_monitoring(struct failsafe *self)
Definition: failsafe.c:66
failsafeRxLinkState_e rxLinkState
Definition: failsafe.h:58
sys_millis_t landingShouldBeFinishedAt
Definition: failsafe.h:54
Definition: failsafe.h:46
uint32_t validRxDataFailedAt
Definition: failsafe.h:52
void failsafe_reset(struct failsafe *self)
Definition: failsafe.c:41
void failsafe_on_rx_resume(struct failsafe *self)
Definition: failsafe.c:109
int16_t events
Definition: failsafe.h:47
sys_millis_t receivingRxDataPeriod
Definition: failsafe.h:55
Definition: failsafe.h:37
int32_t sys_millis_t
Definition: system_calls.h:6
sys_millis_t receivingRxDataPeriodPreset
Definition: failsafe.h:56
Definition: failsafe.h:43
bool active
Definition: failsafe.h:49
void failsafe_on_valid_data_received(struct failsafe *self)
Definition: failsafe.c:114
void failsafe_init(struct failsafe *self, struct ninja *ninja, const struct config *config)
bool failsafe_is_active(struct failsafe *self)
Definition: failsafe.c:70
Definition: failsafe.h:36
failsafePhase_e phase
Definition: failsafe.h:57
Definition: failsafe.h:38
void failsafe_start_monitoring(struct failsafe *self)
Definition: failsafe.c:74
bool failsafe_is_receiving_rx(struct failsafe *self)
Definition: failsafe.c:101
failsafePhase_e failsafe_get_state(struct failsafe *self)
Definition: failsafe.c:62
Definition: failsafe.h:34
void failsafe_update(struct failsafe *self)
Definition: failsafe.c:128
uint32_t validRxDataReceivedAt
Definition: failsafe.h:51
void failsafe_on_valid_data_failed(struct failsafe *self)
Definition: failsafe.c:121
bool monitoring
Definition: failsafe.h:48
Definition: failsafe.h:33
uint32_t rxDataFailurePeriod
Definition: failsafe.h:50
const struct config * config
Definition: failsafe.h:61
sys_millis_t throttleLowPeriod
Definition: failsafe.h:53
struct ninja * ninja
Definition: failsafe.h:60
failsafePhase_e
Definition: failsafe.h:32
failsafeRxLinkState_e
Definition: failsafe.h:41
Definition: failsafe.h:42
void failsafe_on_rx_suspend(struct failsafe *self, uint32_t suspendPeriod)
Definition: failsafe.c:105
Definition: failsafe.h:35