From cc7f4353b467af3382811d33bcb2239f164f34c1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 3 Jan 2013 13:17:32 +1100 Subject: [PATCH] HAL_PX4: update simple example --- .../AP_HAL_PX4/examples/simple/simple.pde | 41 ++++++++++++------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/libraries/AP_HAL_PX4/examples/simple/simple.pde b/libraries/AP_HAL_PX4/examples/simple/simple.pde index 5e3147b024..d29420ae8e 100644 --- a/libraries/AP_HAL_PX4/examples/simple/simple.pde +++ b/libraries/AP_HAL_PX4/examples/simple/simple.pde @@ -1,25 +1,38 @@ +/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*- + +/* + simple hello world sketch + Andrew Tridgell September 2011 +*/ #include #include #include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -const AP_HAL::HAL& hal = AP_HAL_PX4_Instance; +const AP_HAL::HAL& hal = AP_HAL_BOARD_DRIVER; -void loop (void) { - hal.console->println("."); +void setup() { + hal.console->println_P(PSTR("hello world")); } -void setup (void) { - hal.console->println("Hello World"); +void loop() +{ + hal.scheduler->delay(1000); + hal.console->println("*"); } - -extern "C" { -int main (void) { - hal.init(NULL); - setup(); - for(;;) loop(); - return 0; -} -} +AP_HAL_MAIN();