Paparazzi UAS
v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
main_demo3.c
Go to the documentation of this file.
1
2
#include "
std.h
"
3
#include "
mcu.h
"
4
#include "
mcu_periph/sys_time.h
"
5
#include "
led.h
"
6
#include "
mcu_periph/uart.h
"
7
#include "
subsystems/datalink/uart_print.h
"
8
9
static
inline
void
main_init
(
void
);
10
static
inline
void
main_periodic_task
(
void
);
11
12
int
main
(
void
)
13
{
14
main_init
();
15
while
(1) {
16
if
(
sys_time_check_and_ack_timer
(0)) {
17
main_periodic_task
();
18
}
19
}
20
return
0;
21
}
22
23
static
inline
void
main_init
(
void
)
24
{
25
mcu_init
();
26
sys_time_register_timer
((1. /
PERIODIC_FREQUENCY
), NULL);
27
uart0_init_tx();
28
mcu_int_enable
();
29
}
30
31
static
inline
void
main_periodic_task
(
void
)
32
{
33
LED_TOGGLE
(1);
34
UART0PrintString(
"demo3 running since "
);
35
UART0PrintHex32(
sys_time
.
nb_sec
);
36
UART0PrintString(
" seconds\n"
);
37
}
uart.h
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
mcu_init
void mcu_init(void)
Microcontroller peripherals initialization.
Definition:
mcu.c:71
main
int main(void)
Definition:
main_demo3.c:12
main_periodic_task
static void main_periodic_task(void)
Definition:
main_demo3.c:31
LED_TOGGLE
#define LED_TOGGLE(i)
Definition:
led_hw.h:44
uart_print.h
main_init
static void main_init(void)
Definition:
main_demo3.c:23
sys_time.h
Architecture independent timing functions.
sys_time_register_timer
int sys_time_register_timer(float duration, sys_time_cb cb)
Register a new system timer.
Definition:
sys_time.c:37
std.h
sys_time_check_and_ack_timer
static bool_t sys_time_check_and_ack_timer(tid_t id)
Check if timer has elapsed.
Definition:
sys_time.h:111
mcu.h
Arch independent mcu ( Micro Controller Unit ) utilities.
mcu_int_enable
#define mcu_int_enable()
Definition:
mcu_arch.h:35
sys_time::nb_sec
volatile uint32_t nb_sec
full seconds since startup
Definition:
sys_time.h:69
PERIODIC_FREQUENCY
#define PERIODIC_FREQUENCY
Definition:
imu_aspirin2.c:47
led.h
arch independent LED (Light Emitting Diodes) API
sys_time
Definition:
sys_time.h:68
sw
airborne
firmwares
tutorial
main_demo3.c
Generated on Tue Jun 21 2016 14:01:14 for Paparazzi UAS by
1.8.8