mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-08 08:53:56 -04:00
AP_HAL_AVR: Blink sketch - first working code on coreless
This commit is contained in:
parent
ea8242ace1
commit
474f57a90a
0
libraries/AP_HAL_AVR/examples/Blink/Arduino.h
Normal file
0
libraries/AP_HAL_AVR/examples/Blink/Arduino.h
Normal file
28
libraries/AP_HAL_AVR/examples/Blink/Blink.pde
Normal file
28
libraries/AP_HAL_AVR/examples/Blink/Blink.pde
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
|
||||||
|
#include <AP_Common.h>
|
||||||
|
#include <AP_HAL.h>
|
||||||
|
#include <AP_HAL_AVR.h>
|
||||||
|
|
||||||
|
const AP_HAL::HAL& hal = AP_HAL_AVR_APM1;
|
||||||
|
|
||||||
|
void loop (void) {
|
||||||
|
hal.scheduler->delay(1000);
|
||||||
|
hal.gpio->write(13, 1);
|
||||||
|
hal.scheduler->delay(1000);
|
||||||
|
hal.gpio->write(13, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void setup (void) {
|
||||||
|
hal.gpio->pinMode(13, GPIO_OUTPUT);
|
||||||
|
hal.gpio->write(13, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
int main (void) {
|
||||||
|
hal.init(NULL);
|
||||||
|
setup();
|
||||||
|
for(;;) loop();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
1
libraries/AP_HAL_AVR/examples/Blink/Makefile
Normal file
1
libraries/AP_HAL_AVR/examples/Blink/Makefile
Normal file
@ -0,0 +1 @@
|
|||||||
|
include ../../../AP_Common/Arduino.mk
|
0
libraries/AP_HAL_AVR/examples/Blink/nocore.inoflag
Normal file
0
libraries/AP_HAL_AVR/examples/Blink/nocore.inoflag
Normal file
Loading…
Reference in New Issue
Block a user