AP_HAL_AVR: Blink sketch - first working code on coreless

This commit is contained in:
Pat Hickey 2012-08-23 15:18:32 -07:00 committed by Andrew Tridgell
parent ea8242ace1
commit 474f57a90a
4 changed files with 29 additions and 0 deletions

View 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;
}
}

View File

@ -0,0 +1 @@
include ../../../AP_Common/Arduino.mk