mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-10 18:08:30 -04:00
AP_HAL_FLYMAPLE: Fix example Scheduler.pde fo recent changes to API
This commit is contained in:
parent
bc55a2844c
commit
8e5a9b06fb
@ -25,7 +25,7 @@ void delay_toggle() {
|
||||
hal.gpio->write(DELAY_TOGGLE_PIN, 0);
|
||||
}
|
||||
|
||||
void failsafe_toggle(uint32_t machtnichts) {
|
||||
void failsafe_toggle(void) {
|
||||
volatile int i;
|
||||
hal.gpio->write(FAILSAFE_TOGGLE_PIN, 1);
|
||||
for (i = 0; i < 10; i++);
|
||||
@ -33,21 +33,21 @@ void failsafe_toggle(uint32_t machtnichts) {
|
||||
}
|
||||
|
||||
|
||||
void schedule_toggle_1(uint32_t machtnichts) {
|
||||
void schedule_toggle_1(void) {
|
||||
volatile int i;
|
||||
hal.gpio->write(SCHEDULED_TOGGLE_PIN_1, 1);
|
||||
for (i = 0; i < 10; i++);
|
||||
hal.gpio->write(SCHEDULED_TOGGLE_PIN_1, 0);
|
||||
}
|
||||
|
||||
void schedule_toggle_2(uint32_t machtnichts) {
|
||||
void schedule_toggle_2(void) {
|
||||
volatile int i;
|
||||
hal.gpio->write(SCHEDULED_TOGGLE_PIN_2, 1);
|
||||
for (i = 0; i < 10; i++);
|
||||
hal.gpio->write(SCHEDULED_TOGGLE_PIN_2, 0);
|
||||
}
|
||||
|
||||
void schedule_toggle_hang(uint32_t machtnichts) {
|
||||
void schedule_toggle_hang(void) {
|
||||
hal.gpio->write(SCHEDULED_TOGGLE_PIN_2, 1);
|
||||
for(;;);
|
||||
}
|
||||
@ -102,6 +102,7 @@ void setup (void) {
|
||||
"dominates the processor."));
|
||||
hal.console->printf_P(PSTR("Pin %d should toggle then go high forever.\r\n"),
|
||||
(int) SCHEDULED_TOGGLE_PIN_2);
|
||||
hal.scheduler->delay(200);
|
||||
hal.scheduler->register_timer_process(schedule_toggle_hang);
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user