Paparazzi UAS  v5.2.2_stable-0-gd6b9f29
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
main_demo4.c
Go to the documentation of this file.
1 #include "std.h"
2 #include "mcu.h"
3 #include "mcu_periph/sys_time.h"
4 #include "led.h"
5 #include "mcu_periph/uart.h"
6 
7 #include "messages.h"
9 
10 static inline void main_init( void );
11 static inline void main_periodic_task( void );
12 
13 int main( void ) {
14  main_init();
15  while(1) {
18  }
19  return 0;
20 }
21 
22 static inline void main_init( void ) {
23  mcu_init();
25  uart0_init_tx();
27 }
28 
29 static inline void main_periodic_task( void ) {
30  LED_TOGGLE(1);
31  uint16_t time_sec = sys_time.nb_sec;
32  DOWNLINK_SEND_TAKEOFF(&time_sec);
33 }
unsigned short uint16_t
Definition: types.h:16
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
void mcu_init(void)
Microcontroller peripherals initialization.
Definition: mcu.c:61
int main(void)
Definition: main_demo4.c:13
static void main_periodic_task(void)
Definition: main_demo4.c:29
#define mcu_int_enable()
Definition: mcu_arch.h:37
Architecture independent timing functions.
int sys_time_register_timer(float duration, sys_time_cb cb)
Register a new system timer.
Definition: sys_time.c:37
#define LED_TOGGLE(i)
Definition: led_hw.h:30
static bool_t sys_time_check_and_ack_timer(tid_t id)
Check if timer has elapsed.
Definition: sys_time.h:111
Arch independent mcu ( Micro Controller Unit ) utilities.
volatile uint32_t nb_sec
full seconds since startup
Definition: sys_time.h:69
#define PERIODIC_FREQUENCY
Definition: imu_aspirin2.c:51
arch independent LED (Light Emitting Diodes) API
static void main_init(void)
Definition: main_demo4.c:22