Paparazzi UAS  v4.0.4_stable-3-gf39211a
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
lisa_test_actuators_mkk.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 
25 #include "mcu.h"
26 #include "mcu_periph/sys_time.h"
28 #include "actuators.h"
30 #include "led.h"
31 
33 
34 static inline void main_init( void );
35 static inline void main_periodic_task( void );
36 static inline void main_event_task( void );
37 
38 //static uint8_t i2c_done;
39 
40 int main(void) {
41  main_init();
42 
43  while(1) {
47  }
48 
49  return 0;
50 }
51 
52 static inline void main_init( void ) {
53  mcu_init();
56 }
57 
58 
59 
60 static inline void main_periodic_task( void ) {
61 
62  static uint16_t i = 0;
63 
64  RunOnceEvery(100, {
65  LED_TOGGLE(3);
66  DOWNLINK_SEND_ALIVE(DefaultChannel, DefaultDevice, 16, MD5SUM);
67  });
68 
69 
70 #if 0
71  if (i==1) {
74  }
75 #endif
76 #if 0
77  if (i==1) {
81  }
82 #endif
83 #if 0
84  if (i==1) {
87  }
88 #endif
89  i++;
90 
91  if (i>1000) {
92  /* set actuators */
93  commands[COMMAND_PITCH] = 0;
94  commands[COMMAND_ROLL] = 0;
95  commands[COMMAND_YAW] = 20;
96  commands[COMMAND_THRUST] = 0;
97  // actuators_set(TRUE);
99  }
100  LED_PERIODIC();
101 
102 }
103 
104 
105 
106 static inline void main_event_task( void ) {
107 
108 }
unsigned short uint16_t
Definition: types.h:16
void actuators_set(bool_t motors_on)
enum actuators_astec_cmd cmd
#define PERIODIC_FREQUENCY
Definition: imu_aspirin2.c:54
#define FALSE
Definition: imu_chimu.h:141
struct ActuatorsAsctec actuators_asctec
Architecture independent timing functions.
enum actuators_astec_addr cur_addr
void actuators_init(void)
enum actuators_astec_addr new_addr
static void main_init(void)
static void main_event_task(void)
int main(void)
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
Actuators driver for Asctec motor controllers.
#define LED_PERIODIC()
Definition: led_hw.h:8
arch independent mcu ( Micro Controller Unit ) utilities
pprz_t commands[COMMANDS_NB]
Definition: commands.c:42
arch independent LED (Light Emitting Diodes) API
static void main_periodic_task(void)
void mcu_init(void)
Definition: mcu.c:57