Commit 1a815f34 authored by Ian McInerney's avatar Ian McInerney

Moved watchdog tick

parent cfc9ad5e
......@@ -136,7 +136,6 @@ static void commanderXYZ_WatchdogTick(void) {
// If the timeout occurs, drop the quad to the ground
if ((tickNow - crtpPosCache.timestamp) > COMMANDER_XYZ_WDT_TIMEOUT_SHUTDOWN) {
watchdogTriggered = 1;
// DEBUG_PRINT("Watchdog");
}
}
......@@ -189,9 +188,6 @@ uint32_t commanderXYZ_GetInactivityTime(void) {
}
void commanderXYZ_GetSetpoint(setpoint_t *setpoint, const state_t *state, uint8_t *resetControllers) {
// Check the watchdog
commanderXYZ_WatchdogTick();
// Tell the controller everything should be in absolute mode
setpoint->mode.x = modeAbs;
setpoint->mode.y = modeAbs;
......@@ -221,6 +217,9 @@ void commanderXYZ_GetSetpoint(setpoint_t *setpoint, const state_t *state, uint8_
}
void commanderXYZ_GetPosition(state_t *state, const uint32_t tick) {
// Check the watchdog and feed it
commanderXYZ_WatchdogTick();
// Save the previous position values
static float oldX = 0;
static float oldY = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment