Paparazzi UAS
v5.14.0_stable-0-g3f680d1
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_demo6.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/usb_serial.h
"
6
7
#include "pprzlink/messages.h"
8
#include "
subsystems/datalink/downlink.h
"
9
10
static
inline
void
main_init
(
void
);
11
static
inline
void
main_periodic_task
(
void
);
12
13
int
main
(
void
)
14
{
15
main_init
();
16
while
(1) {
17
if
(
sys_time_check_and_ack_timer
(0)) {
18
main_periodic_task
();
19
}
20
}
21
return
0;
22
}
23
24
static
inline
void
main_init
(
void
)
25
{
26
mcu_init
();
27
sys_time_register_timer
((1. / PERIODIC_FREQUENCY), NULL);
28
usb_serial_init();
29
mcu_int_enable
();
30
}
31
32
static
inline
void
main_periodic_task
(
void
)
33
{
34
LED_TOGGLE
(1);
35
//uint16_t time_sec = sys_time.nb_sec;
36
// DOWNLINK_SEND_TAKEOFF(&time_sec);
37
usb_serial_transmit
(
'A'
);
38
usb_serial_transmit
(
'\n'
);
39
40
}
mcu_init
void mcu_init(void)
Microcontroller peripherals initialization.
Definition:
mcu.c:82
main_init
static void main_init(void)
Definition:
main_demo6.c:24
mcu_int_enable
#define mcu_int_enable()
Definition:
mcu_arch.h:36
sys_time.h
Architecture independent timing functions.
std.h
LED_TOGGLE
#define LED_TOGGLE(i)
Definition:
led_hw.h:52
mcu.h
Arch independent mcu ( Micro Controller Unit ) utilities.
main
int main(void)
Definition:
main_demo6.c:13
usb_serial_transmit
static void usb_serial_transmit(struct usb_serial_periph *p, long fd, uint8_t byte)
Definition:
usb_ser_hw.c:555
sys_time_check_and_ack_timer
static bool sys_time_check_and_ack_timer(tid_t id)
Check if timer has elapsed.
Definition:
sys_time.h:114
main_periodic_task
static void main_periodic_task(void)
Definition:
main_demo6.c:32
downlink.h
Common code for AP and FBW telemetry.
led.h
arch independent LED (Light Emitting Diodes) API
sys_time_register_timer
tid_t sys_time_register_timer(float duration, sys_time_cb cb)
Register a new system timer.
Definition:
sys_time.c:43
usb_serial.h
arch independent USB API
sw
airborne
firmwares
tutorial
main_demo6.c
Generated on Sat Feb 9 2019 07:05:41 for Paparazzi UAS by
1.8.8