Copter: integrate ToshibaLED

This commit is contained in:
Randy Mackay 2013-08-09 12:18:01 +09:00 committed by Andrew Tridgell
parent 54007854a9
commit 46c24fdf39
2 changed files with 15 additions and 1 deletions

View File

@ -106,7 +106,7 @@
#include <SITL.h> // software in the loop support
#include <AP_Scheduler.h> // main loop scheduler
#include <AP_RCMapper.h> // RC input mapping library
#include <AC_Sprayer.h> // Crop sprayer library
#include <ToshibaLED.h> // ToshibaLED library
// AP_HAL to Arduino compatibility layer
#include "compat.h"
@ -149,6 +149,9 @@ static AP_Scheduler scheduler;
// AP_BoardLED instance
static AP_BoardLED board_led;
// Toshiba LED instance
static ToshibaLED toshiba_led;
////////////////////////////////////////////////////////////////////////////////
// prototypes
////////////////////////////////////////////////////////////////////////////////
@ -872,6 +875,7 @@ static const AP_Scheduler::Task scheduler_tasks[] PROGMEM = {
{ compass_accumulate, 2, 700 },
{ barometer_accumulate, 2, 900 },
{ super_slow_loop, 100, 1100 },
{ update_toshiba_led, 2, 100 },
{ perf_update, 1000, 500 }
};
@ -888,6 +892,9 @@ void setup() {
// initialise board leds
board_led.init();
// initialise toshiba led
toshiba_led.init();
#if CONFIG_SONAR == ENABLED
#if CONFIG_SONAR_SOURCE == SONAR_SOURCE_ADC
sonar_analog_source = new AP_ADC_AnalogSource(

View File

@ -1,5 +1,12 @@
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
// update_toshiba_led - updates the status of the toshiba led
// should be called at 50hz ~ 100hz
static void update_toshiba_led()
{
toshiba_led.update();
}
/////////////////////////////////////////////////////////////////////////////////////////////
// Copter LEDS by Robert Lefebvre
// Based on the work of U4eake, Bill Sanford, Max Levine, and Oliver