Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
stm_test_spi_link.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2009 Antoine Drouin <poinix@gmail.com>
3  *
4  * This file is part of paparazzi.
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, write to
18  * the Free Software Foundation, 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21 
22 #include <stm32/flash.h>
23 #include <stm32/misc.h>
24 
25 #include <string.h>
26 
27 #include BOARD_CONFIG
28 #include "mcu.h"
29 #include "mcu_periph/sys_time.h"
30 #include "lisa/lisa_overo_link.h"
31 #include "led.h"
32 
33 #include "my_debug_servo.h"
34 
35 
36 static inline void main_periodic( void );
37 static inline void main_event( void );
38 static inline void on_overo_link_msg_received(void);
39 static inline void on_overo_link_crc_err(void);
40 static inline void on_overo_link_lost(void);
41 
42 int main(void) {
43 
44  mcu_init();
48 
49  while (1) {
51  main_periodic();
52  main_event();
53  }
54 
55  return 0;
56 }
57 
58 
59 static inline void main_periodic( void ) {
60 
62 
63  RunOnceEvery(10,{ LED_PERIODIC();});
64 
65 }
66 
67 static inline void main_event( void ) {
68 
70 
71 }
72 
73 
74 static inline void on_overo_link_lost(void) {
75 
76 }
77 
78 static inline void on_overo_link_msg_received(void) {
79 
81 
82  memcpy(&overo_link.up.msg, &overo_link.down.msg,
83  sizeof(union AutopilotMessage));
84 
85 }
86 
87 static inline void on_overo_link_crc_err(void) {
88 
89 }
void mcu_init(void)
Microcontroller peripherals initialization.
Definition: mcu.c:61
#define DEBUG_S1_TOGGLE()
Definition: my_debug_servo.h:9
#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:37
static bool_t sys_time_check_and_ack_timer(tid_t id)
Check if timer has elapsed.
Definition: sys_time.h:111
#define LED_PERIODIC()
Definition: led_hw.h:8
Arch independent mcu ( Micro Controller Unit ) utilities.
#define PERIODIC_FREQUENCY
Definition: imu_aspirin2.c:54
arch independent LED (Light Emitting Diodes) API