mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-06 16:58:48 +08:00
rename booz2_main to main
This commit is contained in:
@@ -42,7 +42,7 @@
|
||||
#include "booz_gps.h"
|
||||
|
||||
#include "booz/booz2_analog.h"
|
||||
#include "firmwares/rotorcraft/baro.h"
|
||||
#include <firmwares/rotorcraft/baro.h>
|
||||
|
||||
#include "booz2_battery.h"
|
||||
|
||||
@@ -75,18 +75,18 @@ static inline void on_mag_event( void );
|
||||
|
||||
#ifndef SITL
|
||||
int main( void ) {
|
||||
booz2_main_init();
|
||||
main_init();
|
||||
|
||||
while(1) {
|
||||
if (sys_time_periodic())
|
||||
booz2_main_periodic();
|
||||
booz2_main_event();
|
||||
main_periodic();
|
||||
main_event();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif /* SITL */
|
||||
|
||||
STATIC_INLINE void booz2_main_init( void ) {
|
||||
STATIC_INLINE void main_init( void ) {
|
||||
|
||||
#ifndef RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT
|
||||
/* IF THIS IS NEEDED SOME PERHIPHERAL THEN PLEASE MOVE IT THERE */
|
||||
@@ -135,7 +135,7 @@ STATIC_INLINE void booz2_main_init( void ) {
|
||||
}
|
||||
|
||||
|
||||
STATIC_INLINE void booz2_main_periodic( void ) {
|
||||
STATIC_INLINE void main_periodic( void ) {
|
||||
|
||||
imu_periodic();
|
||||
|
||||
@@ -145,7 +145,7 @@ STATIC_INLINE void booz2_main_periodic( void ) {
|
||||
actuators_set(autopilot_motors_on);
|
||||
|
||||
PeriodicPrescaleBy10( \
|
||||
{ \
|
||||
{ \
|
||||
radio_control_periodic(); \
|
||||
if (radio_control.status != RADIO_CONTROL_OK && \
|
||||
autopilot_mode != AP_MODE_KILL && \
|
||||
@@ -159,7 +159,7 @@ STATIC_INLINE void booz2_main_periodic( void ) {
|
||||
/*BoozControlSurfacesSetFromCommands();*/ \
|
||||
}, \
|
||||
{ \
|
||||
LED_PERIODIC(); \
|
||||
LED_PERIODIC(); \
|
||||
}, \
|
||||
{ baro_periodic();
|
||||
}, \
|
||||
@@ -171,7 +171,7 @@ STATIC_INLINE void booz2_main_periodic( void ) {
|
||||
Booz2TelemetryPeriodic(); \
|
||||
} \
|
||||
); \
|
||||
|
||||
|
||||
#ifdef USE_GPS
|
||||
if (radio_control.status != RADIO_CONTROL_OK && \
|
||||
autopilot_mode == AP_MODE_NAV && GpsIsLost()) \
|
||||
@@ -191,7 +191,7 @@ STATIC_INLINE void booz2_main_periodic( void ) {
|
||||
|
||||
}
|
||||
|
||||
STATIC_INLINE void booz2_main_event( void ) {
|
||||
STATIC_INLINE void main_event( void ) {
|
||||
|
||||
DatalinkEvent();
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef BOOZ2_MAIN_H
|
||||
#define BOOZ2_MAIN_H
|
||||
#ifndef MAIN_H
|
||||
#define MAIN_H
|
||||
|
||||
#ifdef SITL
|
||||
#define STATIC_INLINE extern
|
||||
@@ -30,8 +30,8 @@
|
||||
#define STATIC_INLINE static inline
|
||||
#endif
|
||||
|
||||
STATIC_INLINE void booz2_main_init( void );
|
||||
STATIC_INLINE void booz2_main_periodic( void );
|
||||
STATIC_INLINE void booz2_main_event( void );
|
||||
STATIC_INLINE void main_init( void );
|
||||
STATIC_INLINE void main_periodic( void );
|
||||
STATIC_INLINE void main_event( void );
|
||||
|
||||
#endif /* BOOZ2_MAIN_H */
|
||||
#endif /* MAIN_H */
|
||||
|
||||
@@ -20,7 +20,7 @@ void nps_autopilot_init(enum NpsRadioControlType type_rc, int num_rc_script, cha
|
||||
nps_bypass_ahrs = TRUE;
|
||||
// nps_bypass_ahrs = FALSE;
|
||||
|
||||
booz2_main_init();
|
||||
main_init();
|
||||
|
||||
}
|
||||
|
||||
@@ -31,34 +31,34 @@ void nps_autopilot_run_step(double time __attribute__ ((unused))) {
|
||||
|
||||
if (nps_radio_control_available(time)) {
|
||||
booz_radio_control_feed();
|
||||
booz2_main_event();
|
||||
main_event();
|
||||
}
|
||||
|
||||
if (nps_sensors_gyro_available()) {
|
||||
imu_feed_gyro_accel();
|
||||
booz2_main_event();
|
||||
main_event();
|
||||
}
|
||||
|
||||
if (nps_sensors_mag_available()) {
|
||||
imu_feed_mag();
|
||||
booz2_main_event();
|
||||
main_event();
|
||||
}
|
||||
|
||||
if (nps_sensors_baro_available()) {
|
||||
baro_feed_value(sensors.baro.value);
|
||||
booz2_main_event();
|
||||
main_event();
|
||||
}
|
||||
|
||||
if (nps_sensors_gps_available()) {
|
||||
booz_gps_feed_value();
|
||||
booz2_main_event();
|
||||
main_event();
|
||||
}
|
||||
|
||||
if (nps_bypass_ahrs) {
|
||||
sim_overwrite_ahrs();
|
||||
}
|
||||
|
||||
booz2_main_periodic();
|
||||
main_periodic();
|
||||
|
||||
if (time < 8) { /* start with a little bit of hovering */
|
||||
int32_t init_cmd[4];
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include "booz_rc_sim.h"
|
||||
#include "booz2_battery.h"
|
||||
|
||||
#include "booz2_main.h"
|
||||
#include "main.h"
|
||||
|
||||
|
||||
char* fg_host = "10.31.4.107";
|
||||
@@ -99,7 +99,7 @@ static void booz2_sim_init(void) {
|
||||
|
||||
ivy_transport_init();
|
||||
|
||||
booz2_main_init();
|
||||
main_init();
|
||||
|
||||
}
|
||||
|
||||
@@ -151,18 +151,18 @@ static void sim_run_one_step(void) {
|
||||
// feed a rc frame and signal event
|
||||
BoozRcSimFeed(sim_time);
|
||||
// process it
|
||||
booz2_main_event();
|
||||
main_event();
|
||||
|
||||
if (booz_sensors_model_baro_available()) {
|
||||
Booz2BaroISRHandler(bsm.baro);
|
||||
booz2_main_event();
|
||||
main_event();
|
||||
#ifdef BYPASS_INS
|
||||
sim_overwrite_ins();
|
||||
#endif /* BYPASS_INS */
|
||||
}
|
||||
if (booz_sensors_model_gyro_available()) {
|
||||
booz2_imu_feed_data();
|
||||
booz2_main_event();
|
||||
main_event();
|
||||
#ifdef BYPASS_AHRS
|
||||
sim_overwrite_ahrs();
|
||||
#endif /* BYPASS_AHRS */
|
||||
@@ -173,18 +173,18 @@ static void sim_run_one_step(void) {
|
||||
|
||||
if (booz_sensors_model_gps_available()) {
|
||||
sim_gps_feed_data();
|
||||
booz2_main_event();
|
||||
main_event();
|
||||
}
|
||||
|
||||
if (booz_sensors_model_mag_available()) {
|
||||
sim_mag_feed_data();
|
||||
booz2_main_event();
|
||||
main_event();
|
||||
#ifdef BYPASS_AHRS
|
||||
sim_overwrite_ahrs();
|
||||
#endif /* BYPASS_AHRS */
|
||||
}
|
||||
|
||||
booz2_main_periodic();
|
||||
main_periodic();
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user