Exemplo n.º 1
0
static void commanderCacheSelectorUpdate(void)
{
  uint32_t tickNow = xTaskGetTickCount();

  /* Check inputs and prioritize. CHANGED BY Carlitos: crtp higher than extrx */
  if ((tickNow - crtpCache.timestamp) < M2T(commanderStabilizeTimeout)) {
    activeCache = &crtpCache;
  } else if ((tickNow - extrxCache.timestamp) < M2T(commanderStabilizeTimeout)) {
    activeCache = &extrxCache;
  } else if ((tickNow - crtpCache.timestamp) < M2T(commanderShutdownTimeout)) {
    activeCache = &crtpCache;
    commanderLevelRPY();
  } else if ((tickNow - extrxCache.timestamp) < M2T(commanderShutdownTimeout)) {
    activeCache = &extrxCache;
    commanderLevelRPY();
  } else {
    activeCache = &crtpCache;
    commanderDropToGround();
  }
}
static void commanderCacheSelectorUpdate(void)
{
  uint32_t tickNow = xTaskGetTickCount();

  /* Check inputs and prioritize. Extrx higher then crtp */
  if ((tickNow - extrxCache.timestamp) < COMMANDER_WDT_TIMEOUT_STABILIZE) {
    activeCache = &extrxCache;
  } else if ((tickNow - crtpCache.timestamp) < COMMANDER_WDT_TIMEOUT_STABILIZE) {
    activeCache = &crtpCache;
  } else if ((tickNow - extrxCache.timestamp) < COMMANDER_WDT_TIMEOUT_SHUTDOWN) {
    activeCache = &extrxCache;
    commanderLevelRPY();
  } else if ((tickNow - crtpCache.timestamp) < COMMANDER_WDT_TIMEOUT_SHUTDOWN) {
    activeCache = &crtpCache;
    commanderLevelRPY();
  } else {
    activeCache = &crtpCache;
    commanderDropToGround();
  }
 // activeCache = &extrxCache;
}
Exemplo n.º 3
0
static void commanderDropToGround(void)
{
  altHoldMode = false;
  commanderSetActiveThrust(0);
  commanderLevelRPY();
}