2013-09-19 03:27:31 -03:00
|
|
|
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
|
|
|
/*
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <AP_Notify.h>
|
|
|
|
|
|
|
|
// static flags, to allow for direct class update from device drivers
|
|
|
|
struct AP_Notify::notify_type AP_Notify::flags;
|
|
|
|
|
|
|
|
// initialisation
|
2013-11-30 09:53:40 -04:00
|
|
|
void AP_Notify::init(bool enable_external_leds)
|
2013-09-19 03:27:31 -03:00
|
|
|
{
|
2013-11-30 09:53:40 -04:00
|
|
|
AP_Notify::flags.external_leds = enable_external_leds;
|
|
|
|
|
2013-09-19 03:27:31 -03:00
|
|
|
boardled.init();
|
2013-11-28 00:00:02 -04:00
|
|
|
|
2013-09-19 03:27:31 -03:00
|
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4
|
2014-08-15 22:30:22 -03:00
|
|
|
toshibaled.init();
|
2013-09-19 03:27:31 -03:00
|
|
|
tonealarm.init();
|
|
|
|
#endif
|
2013-11-28 00:00:02 -04:00
|
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_APM1 || CONFIG_HAL_BOARD == HAL_BOARD_APM2
|
|
|
|
externalled.init();
|
2013-11-28 00:28:14 -04:00
|
|
|
buzzer.init();
|
2013-11-28 00:00:02 -04:00
|
|
|
#endif
|
2014-03-31 14:48:41 -03:00
|
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN
|
2014-08-15 22:30:22 -03:00
|
|
|
toshibaled.init();
|
2014-05-30 17:58:34 -03:00
|
|
|
externalled.init();
|
|
|
|
buzzer.init();
|
2014-03-31 14:48:41 -03:00
|
|
|
#endif
|
2013-09-19 03:27:31 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
// main update function, called at 50Hz
|
|
|
|
void AP_Notify::update(void)
|
|
|
|
{
|
|
|
|
boardled.update();
|
|
|
|
|
|
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4
|
2014-08-15 22:30:22 -03:00
|
|
|
toshibaled.update();
|
2013-09-19 03:27:31 -03:00
|
|
|
tonealarm.update();
|
|
|
|
#endif
|
2013-11-28 00:00:02 -04:00
|
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_APM1 || CONFIG_HAL_BOARD == HAL_BOARD_APM2
|
|
|
|
externalled.update();
|
2013-11-28 00:28:14 -04:00
|
|
|
buzzer.update();
|
2013-11-28 00:00:02 -04:00
|
|
|
#endif
|
2014-03-31 14:48:41 -03:00
|
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN
|
2014-08-15 22:30:22 -03:00
|
|
|
toshibaled.update();
|
2014-05-30 17:58:34 -03:00
|
|
|
externalled.update();
|
|
|
|
buzzer.update();
|
2014-03-31 14:48:41 -03:00
|
|
|
#endif
|
2013-09-19 03:27:31 -03:00
|
|
|
}
|