mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-06 07:53:43 +08:00
add modules in booz
This commit is contained in:
@@ -22,7 +22,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define DATALINK_C
|
#define DATALINK_C
|
||||||
|
#define MODULES_DATALINK_C
|
||||||
|
|
||||||
#include "datalink.h"
|
#include "datalink.h"
|
||||||
|
#ifdef USE_MODULES
|
||||||
|
#include "modules.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
#include "downlink.h"
|
#include "downlink.h"
|
||||||
@@ -107,6 +112,10 @@ void dl_parse_msg(void) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif /* USE_NAVIGATION */
|
#endif /* USE_NAVIGATION */
|
||||||
|
#ifdef USE_MODULES
|
||||||
|
/* Parse modules datalink */
|
||||||
|
modules_parse_datalink(msg_id);
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,8 @@
|
|||||||
* Boston, MA 02111-1307, USA.
|
* Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define MODULES_C
|
||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "init_hw.h"
|
#include "init_hw.h"
|
||||||
@@ -73,6 +75,11 @@
|
|||||||
#include "nps_autopilot_booz.h"
|
#include "nps_autopilot_booz.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_MODULES
|
||||||
|
#include "modules.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
static inline void on_gyro_accel_event( void );
|
static inline void on_gyro_accel_event( void );
|
||||||
static inline void on_baro_event( void );
|
static inline void on_baro_event( void );
|
||||||
static inline void on_gps_event( void );
|
static inline void on_gps_event( void );
|
||||||
@@ -144,6 +151,10 @@ STATIC_INLINE void booz2_main_init( void ) {
|
|||||||
|
|
||||||
int_enable();
|
int_enable();
|
||||||
|
|
||||||
|
#ifdef USE_MODULES
|
||||||
|
modules_init();
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined BOOZ_START_DELAY && ! defined SITL
|
#if defined BOOZ_START_DELAY && ! defined SITL
|
||||||
delay_done = FALSE;
|
delay_done = FALSE;
|
||||||
init_done_time = T0TC;
|
init_done_time = T0TC;
|
||||||
@@ -210,6 +221,10 @@ STATIC_INLINE void booz2_main_periodic( void ) {
|
|||||||
booz2_analog_periodic();
|
booz2_analog_periodic();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_MODULES
|
||||||
|
modules_periodic_task();
|
||||||
|
#endif
|
||||||
|
|
||||||
if (booz2_autopilot_in_flight) {
|
if (booz2_autopilot_in_flight) {
|
||||||
RunOnceEvery(512, { booz2_autopilot_flight_time++; datalink_time++; });
|
RunOnceEvery(512, { booz2_autopilot_flight_time++; datalink_time++; });
|
||||||
}
|
}
|
||||||
@@ -233,6 +248,10 @@ STATIC_INLINE void booz2_main_event( void ) {
|
|||||||
|
|
||||||
Booz2AnalogBaroEvent(on_baro_event);
|
Booz2AnalogBaroEvent(on_baro_event);
|
||||||
|
|
||||||
|
#ifdef BOOZ2_SONAR
|
||||||
|
Booz2SonarEvent(booz_ins_update_sonar);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef USE_GPS
|
#ifdef USE_GPS
|
||||||
Booz2GpsEvent(on_gps_event);
|
Booz2GpsEvent(on_gps_event);
|
||||||
#endif
|
#endif
|
||||||
@@ -241,6 +260,10 @@ STATIC_INLINE void booz2_main_event( void ) {
|
|||||||
BoozDetectGroundEvent();
|
BoozDetectGroundEvent();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_MODULES
|
||||||
|
modules_event_task();
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void on_gyro_accel_event( void ) {
|
static inline void on_gyro_accel_event( void ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user