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
stm_test_spi_link.c
Go to the documentation of this file.
1 /*
2  * $Id$
3  *
4  * Copyright (C) 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 <stm32/flash.h>
25 #include <stm32/misc.h>
26 
27 #include <string.h>
28 
29 #include BOARD_CONFIG
30 #include "mcu.h"
31 #include "mcu_periph/sys_time.h"
32 #include "lisa/lisa_overo_link.h"
33 #include "led.h"
34 
35 #include "my_debug_servo.h"
36 
37 
38 static inline void main_periodic( void );
39 static inline void main_event( void );
40 static inline void on_overo_link_msg_received(void);
41 static inline void on_overo_link_crc_err(void);
42 static inline void on_overo_link_lost(void);
43 
44 int main(void) {
45 
46  mcu_init();
50 
51  while (1) {
53  main_periodic();
54  main_event();
55  }
56 
57  return 0;
58 }
59 
60 
61 static inline void main_periodic( void ) {
62 
64 
65  RunOnceEvery(10,{ LED_PERIODIC();});
66 
67 }
68 
69 static inline void main_event( void ) {
70 
72 
73 }
74 
75 
76 static inline void on_overo_link_lost(void) {
77 
78 }
79 
80 static inline void on_overo_link_msg_received(void) {
81 
83 
84  memcpy(&overo_link.up.msg, &overo_link.down.msg,
85  sizeof(union AutopilotMessage));
86 
87 }
88 
89 static inline void on_overo_link_crc_err(void) {
90 
91 }
#define DEBUG_S1_TOGGLE()
Definition: my_debug_servo.h:9
#define PERIODIC_FREQUENCY
Definition: imu_aspirin2.c:54
#define DEBUG_SERVO1_INIT()
Architecture independent timing functions.
int sys_time_register_timer(float duration, sys_time_cb cb)
Register a new system timer.
Definition: sys_time.c:35
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
void mcu_init(void)
Definition: mcu.c:57