Paparazzi UAS  v4.2.2_stable-4-gcc32f65
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
lisa_tunnel.c
Go to the documentation of this file.
1 /*
2  * $Id$
3  *
4  * Copyright (C) 2008-2009 Antoine Drouin <poinix@gmail.com>
5  *
6  * This file is part of paparazzi.
7  *
8  * paparazzi is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2, or (at your option)
11  * any later version.
12  *
13  * paparazzi is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with paparazzi; see the file COPYING. If not, write to
20  * the Free Software Foundation, 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
24 #include <inttypes.h>
25 
26 #include "std.h"
27 #include "mcu.h"
28 #include "mcu_periph/uart.h"
29 #include "mcu_periph/sys_time.h"
30 #include "led.h"
31 
32 static inline void main_init( void );
33 static inline void main_periodic_task( void );
34 static inline void main_event_task( void );
35 
36 int main( void ) {
37  main_init();
38  while(1) {
42  }
43  return 0;
44 }
45 
46 static inline void main_init( void ) {
47  mcu_init();
49 }
50 
51 static inline void main_periodic_task( void ) {
52  RunOnceEvery(100, {
53  LED_TOGGLE(4);
54  LED_PERIODIC();
55  });
56 
57 }
58 
59 static inline void main_event_task( void ) {
60 
61  if (Uart2ChAvailable())
62  Uart1Transmit(Uart2Getch());
63 
64  if (Uart1ChAvailable())
65  Uart2Transmit(Uart1Getch());
66 
67 
68 }
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
#define PERIODIC_FREQUENCY
Definition: imu_aspirin2.c:54
Architecture independent timing functions.
static void main_periodic_task(void)
Definition: lisa_tunnel.c:51
int sys_time_register_timer(float duration, sys_time_cb cb)
Register a new system timer.
Definition: sys_time.c:35
#define LED_TOGGLE(i)
Definition: led_hw.h:30
static bool_t sys_time_check_and_ack_timer(tid_t id)
Definition: sys_time.h:90
#define LED_PERIODIC()
Definition: led_hw.h:8
arch independent mcu ( Micro Controller Unit ) utilities
arch independent LED (Light Emitting Diodes) API
static void main_event_task(void)
Definition: lisa_tunnel.c:59
void mcu_init(void)
Definition: mcu.c:57
int main(void)
Definition: lisa_tunnel.c:36
static void main_init(void)
Definition: lisa_tunnel.c:46