Skip to content

Commit

Permalink
renamed flag NPS to USE_NPS, ifdef USE_NPS around nps specific funtio…
Browse files Browse the repository at this point in the history
…ns in imu_b2 sim file
  • Loading branch information
flixr committed Jul 26, 2011
1 parent f79dd3d commit 4746fe3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion conf/autopilot/subsystems/rotorcraft/fdm_nps.makefile
Expand Up @@ -17,7 +17,7 @@ NPSDIR = $(SIMDIR)/nps

sim.ARCHDIR = $(ARCH)

sim.CFLAGS += -DSITL -DNPS
sim.CFLAGS += -DSITL -DUSE_NPS
sim.CFLAGS += `pkg-config glib-2.0 --cflags` -I /usr/include/meschach
sim.LDFLAGS += `pkg-config glib-2.0 --libs` -lm -lpcre -lglibivy -lgsl -lgslcblas
sim.CFLAGS += -I$(NPSDIR) -I$(SRC_FIRMWARE) -I$(SRC_BOARD) -I../simulator -I$(PAPARAZZI_HOME)/conf/simulator/nps
Expand Down
2 changes: 2 additions & 0 deletions sw/airborne/arch/sim/subsystems/imu/imu_b2_arch.c
Expand Up @@ -35,6 +35,7 @@ void imu_periodic(void) {

}

#ifdef USE_NPS
#include "nps_sensors.h"

void imu_feed_gyro_accel(void) {
Expand All @@ -61,3 +62,4 @@ void imu_feed_mag(void) {
ami601_status = AMI601_DATA_AVAILABLE;
#endif
}
#endif //USE_NPS
3 changes: 2 additions & 1 deletion sw/airborne/arch/sim/subsystems/imu/imu_b2_arch.h
Expand Up @@ -31,8 +31,9 @@

extern int imu_overrun;

#ifdef USE_NPS
extern void imu_feed_gyro_accel(void);
extern void imu_feed_mag(void);

#endif

#endif /* IMU_B2_HW_H */
6 changes: 3 additions & 3 deletions sw/airborne/arch/sim/subsystems/radio_control/ppm_arch.c
Expand Up @@ -28,7 +28,7 @@
#include <inttypes.h>
#include <caml/mlvalues.h>

#ifdef NPS
#ifdef USE_NPS
#include "nps_radio_control.h"
#endif

Expand All @@ -55,7 +55,7 @@ value send_ppm(value unit) {
return unit;
}

#ifdef NPS
#ifdef USE_NPS
#define PPM_OF_NPS(_nps, _neutral, _min, _max) \
((_nps) >= 0 ? (_neutral) + (_nps) * ((_max)-(_neutral)) : (_neutral) + (_nps) * ((_neutral)- (_min)))

Expand Down Expand Up @@ -94,7 +94,7 @@ value send_ppm(value unit) {
return unit;
}

#ifdef NPS
#ifdef USE_NPS
void radio_control_feed(void) {}
#endif

Expand Down
2 changes: 1 addition & 1 deletion sw/airborne/arch/sim/subsystems/radio_control/ppm_arch.h
Expand Up @@ -36,7 +36,7 @@

#define PPM_NB_CHANNEL RADIO_CONTROL_NB_CHANNEL

#ifdef NPS
#ifdef USE_NPS
extern void radio_control_feed(void);
#endif

Expand Down

0 comments on commit 4746fe3

Please sign in to comment.