Пример #1
0
void baro_periodic( void ) {
  // Run some loops to get correct readings from the adc
  if (startup_cnt > 0) {
    --startup_cnt;
#ifdef BARO_LED
    LED_TOGGLE(BARO_LED);
    if (startup_cnt == 0) {
      LED_ON(BARO_LED);
    }
#endif
  }
  // Read the ADC (at 50/4 Hz, conversion time is 68 ms)
  RunOnceEvery(4,mcp355x_read());
}
Пример #2
0
void baro_periodic( void ) {

  if (baro.status == BS_UNINITIALIZED) {
    // Run some loops to get correct readings from the adc
    --startup_cnt;
#ifdef ROTORCRAFT_BARO_LED
    LED_TOGGLE(ROTORCRAFT_BARO_LED);
#endif
    if (startup_cnt == 0) {
      baro.status = BS_RUNNING;
#ifdef ROTORCRAFT_BARO_LED
      LED_ON(ROTORCRAFT_BARO_LED);
#endif
    }
  }
  // Read the ADC (at 50/4 Hz, conversion time is 68 ms)
  RunOnceEvery(4,mcp355x_read());
}