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
lisa_test_actuators_mkk.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 
23 #include "mcu.h"
24 #include "mcu_periph/sys_time.h"
25 #include "subsystems/commands.h"
26 #include "subsystems/actuators.h"
28 #include "led.h"
29 
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 //static uint8_t i2c_done;
37 
38 int main(void) {
39  main_init();
40 
41  while(1) {
45  }
46 
47  return 0;
48 }
49 
50 static inline void main_init( void ) {
51  mcu_init();
54 }
55 
56 
57 
58 static inline void main_periodic_task( void ) {
59 
60  static uint16_t i = 0;
61 
62  RunOnceEvery(100, {
63  LED_TOGGLE(3);
64  DOWNLINK_SEND_ALIVE(DefaultChannel, DefaultDevice, 16, MD5SUM);
65  });
66 
67 
68 #if 0
69  if (i==1) {
72  }
73 #endif
74 #if 0
75  if (i==1) {
79  }
80 #endif
81 #if 0
82  if (i==1) {
85  }
86 #endif
87  i++;
88 
89  if (i>1000) {
90  /* set actuators */
91  commands[COMMAND_PITCH] = 0;
92  commands[COMMAND_ROLL] = 0;
93  commands[COMMAND_YAW] = 20;
94  commands[COMMAND_THRUST] = 0;
95  // actuators_set(TRUE);
96  //actuators_set(FALSE);
97  }
98  LED_PERIODIC();
99 
100 }
101 
102 
103 
104 static inline void main_event_task( void ) {
105 
106 }
unsigned short uint16_t
Definition: types.h:16
void mcu_init(void)
Microcontroller peripherals initialization.
Definition: mcu.c:61
struct ActuatorsAsctec actuators_asctec
Architecture independent timing functions.
static void main_init(void)
static void main_event_task(void)
Hardware independent code for commands handling.
Hardware independent API for actuators (servos, motor controllers).
int main(void)
int sys_time_register_timer(float duration, sys_time_cb cb)
Register a new system timer.
Definition: sys_time.c:37
#define LED_TOGGLE(i)
Definition: led_hw.h:30
static bool_t sys_time_check_and_ack_timer(tid_t id)
Check if timer has elapsed.
Definition: sys_time.h:111
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]
Storage of intermediate command values.
Definition: commands.c:30
enum actuators_asctec_addr new_addr
#define PERIODIC_FREQUENCY
Definition: imu_aspirin2.c:54
arch independent LED (Light Emitting Diodes) API
void actuators_init(void)
Definition: actuators_at.c:32
static void main_periodic_task(void)
enum actuators_asctec_cmd cmd
enum actuators_asctec_addr cur_addr