Skip to content

Commit

Permalink
wrap some includes and functions for nps in #if USE_NPS
Browse files Browse the repository at this point in the history
  • Loading branch information
flixr committed Feb 11, 2012
1 parent 2e9faab commit f25e5df
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 7 deletions.
2 changes: 2 additions & 0 deletions sw/airborne/arch/sim/subsystems/imu/imu_aspirin_arch.c
Expand Up @@ -33,6 +33,7 @@ void imu_periodic(void) {

}

#if USE_NPS
#include "nps_sensors.h"

void imu_feed_gyro_accel(void) {
Expand All @@ -56,3 +57,4 @@ void imu_feed_mag(void) {
hmc5843.data.value[IMU_MAG_Z_CHAN] = sensors.mag.value.z;
hmc5843.data_available = TRUE;
}
#endif
2 changes: 1 addition & 1 deletion sw/airborne/arch/sim/subsystems/imu/imu_b2_arch.c
Expand Up @@ -35,7 +35,7 @@ void imu_periodic(void) {

}

#ifdef USE_NPS
#if USE_NPS
#include "nps_sensors.h"

void imu_feed_gyro_accel(void) {
Expand Down
2 changes: 1 addition & 1 deletion sw/airborne/arch/sim/subsystems/imu/imu_b2_arch.h
Expand Up @@ -31,7 +31,7 @@

extern int imu_overrun;

#ifdef USE_NPS
#if USE_NPS
extern void imu_feed_gyro_accel(void);
extern void imu_feed_mag(void);
#endif
Expand Down
3 changes: 2 additions & 1 deletion sw/airborne/arch/sim/subsystems/imu/imu_crista_arch.c
Expand Up @@ -10,7 +10,7 @@ void imu_crista_arch_init(void) {

}


#if USE_NPS
#include "nps_sensors.h"

void imu_feed_gyro_accel(void) {
Expand All @@ -29,3 +29,4 @@ void imu_feed_mag(void) {
ami601_values[IMU_MAG_Z_CHAN] = sensors.mag.value.z;
ami601_status = AMI601_DATA_AVAILABLE;
}
#endif
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 USE_NPS
#if USE_NPS
#include "nps_radio_control.h"
#endif

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

#ifdef USE_NPS
#if 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 USE_NPS
#if 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 USE_NPS
#if USE_NPS
extern void radio_control_feed(void);
#endif

Expand Down

0 comments on commit f25e5df

Please sign in to comment.