diff --git a/conf/airframes/fraser_lisa_m_rotorcraft.xml b/conf/airframes/fraser_lisa_m_rotorcraft.xml index 7dfd5936e5..7e7151b6b5 100644 --- a/conf/airframes/fraser_lisa_m_rotorcraft.xml +++ b/conf/airframes/fraser_lisa_m_rotorcraft.xml @@ -27,6 +27,9 @@ + + + diff --git a/sw/airborne/arch/stm32/mcu_arch.c b/sw/airborne/arch/stm32/mcu_arch.c index d00f586598..73cd4d1aab 100644 --- a/sw/airborne/arch/stm32/mcu_arch.c +++ b/sw/airborne/arch/stm32/mcu_arch.c @@ -36,16 +36,18 @@ #include #include +#include "std.h" + void mcu_arch_init(void) { #if LUFTBOOT -#pragma message "We are running luftboot, the interrupt vector is being relocated." +PRINT_CONFIG_MSG("We are running luftboot, the interrupt vector is being relocated.") SCB_VTOR = 0x00002000; #endif #if EXT_CLK == 8000000 -#pragma message "Using 8MHz external clock to PLL it to 72MHz." +PRINT_CONFIG_MSG("Using 8MHz external clock to PLL it to 72MHz.") rcc_clock_setup_in_hse_8mhz_out_72mhz(); #elif EXT_CLK == 12000000 -#pragma message "Using 12MHz external clock to PLL it to 72MHz." +PRINT_CONFIG_MSG("Using 12MHz external clock to PLL it to 72MHz.") rcc_clock_setup_in_hse_12mhz_out_72mhz(); #else #error EXT_CLK is either set to an unsupported frequency or not defined at all. Please check! diff --git a/sw/airborne/arch/stm32/mcu_periph/adc_arch.c b/sw/airborne/arch/stm32/mcu_periph/adc_arch.c index 3b84602616..117207edb9 100644 --- a/sw/airborne/arch/stm32/mcu_periph/adc_arch.c +++ b/sw/airborne/arch/stm32/mcu_periph/adc_arch.c @@ -374,13 +374,13 @@ static inline void adc_init_single(uint32_t adc, adc_set_injected_sequence(adc, num_channels, channels); #if USE_AD_TIM4 -#pragma message "Info: Using TIM4 for ADC" +PRINT_CONFIG_MSG("Info: Using TIM4 for ADC") adc_enable_external_trigger_injected(adc, ADC_CR2_JEXTSEL_TIM4_TRGO); #elif USE_AD_TIM1 -#pragma message "Info: Using TIM1 for ADC" +PRINT_CONFIG_MSG("Info: Using TIM1 for ADC") adc_enable_external_trigger_injected(adc, ADC_CR2_JEXTSEL_TIM1_TRGO); #else -#pragma message "Info: Using default TIM2 for ADC" +PRINT_CONFIG_MSG("Info: Using default TIM2 for ADC") adc_enable_external_trigger_injected(adc, ADC_CR2_JEXTSEL_TIM2_TRGO); #endif diff --git a/sw/airborne/arch/stm32/subsystems/actuators/actuators_pwm_arch.c b/sw/airborne/arch/stm32/subsystems/actuators/actuators_pwm_arch.c index 3ac5635dc1..3a9dff8fd3 100644 --- a/sw/airborne/arch/stm32/subsystems/actuators/actuators_pwm_arch.c +++ b/sw/airborne/arch/stm32/subsystems/actuators/actuators_pwm_arch.c @@ -176,10 +176,10 @@ void actuators_pwm_arch_init(void) { #if (!REMAP_SERVOS_5AND6 || USE_SERVOS_7AND8) #if !REMAP_SERVOS_5AND6 -#pragma message "Not remapping servos 5 and 6 using PB8 and PB9 -> TIM4" +PRINT_CONFIG_MSG("Not remapping servos 5 and 6 using PB8 and PB9 -> TIM4") #endif #if USE_SERVOS_7AND8 -#pragma message "Enabeling sevros 7 and 8 on PB6, PB7 -> TIM4" +PRINT_CONFIG_MSG("Enabling sevros 7 and 8 on PB6, PB7 -> TIM4") #endif /*--------------- * Timer 4 setup @@ -255,7 +255,7 @@ void actuators_pwm_arch_init(void) { #endif #if REMAP_SERVOS_5AND6 -#pragma message "Remapping servo outputs 5 and 6 to PA0,PA1 -> TIM5" +PRINT_CONFIG_MSG("Remapping servo outputs 5 and 6 to PA0,PA1 -> TIM5") /*--------------- * Timer 5 setup *---------------*/ diff --git a/sw/airborne/arch/stm32/subsystems/radio_control/spektrum_arch.c b/sw/airborne/arch/stm32/subsystems/radio_control/spektrum_arch.c index ea4b904f6f..ec3a8f4c55 100644 --- a/sw/airborne/arch/stm32/subsystems/radio_control/spektrum_arch.c +++ b/sw/airborne/arch/stm32/subsystems/radio_control/spektrum_arch.c @@ -82,10 +82,10 @@ typedef struct SpektrumStateStruct SpektrumStateType; SpektrumStateType PrimarySpektrumState = {1,0,0,0,0,0,0,0,0}; #ifdef RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT -#pragma message "Using secondary spektrum receiver." +PRINT_CONFIG_MSG("Using secondary spektrum receiver.") SpektrumStateType SecondarySpektrumState = {1,0,0,0,0,0,0,0,0}; #else -#pragma message "NOT using secondary spektrum receiver." +PRINT_CONFIG_MSG("NOT using secondary spektrum receiver.") #endif int16_t SpektrumBuf[SPEKTRUM_CHANNELS_PER_FRAME*MAX_SPEKTRUM_FRAMES]; diff --git a/sw/airborne/boards/umarim/imu_umarim.c b/sw/airborne/boards/umarim/imu_umarim.c index ac8172e6ad..248b178977 100644 --- a/sw/airborne/boards/umarim/imu_umarim.c +++ b/sw/airborne/boards/umarim/imu_umarim.c @@ -53,7 +53,7 @@ PRINT_CONFIG_VAR(UMARIM_ACCEL_RATE) #if !defined UMARIM_GYRO_LOWPASS && !defined UMARIM_GYRO_SMPLRT_DIV #define UMARIM_GYRO_LOWPASS ITG3200_DLPF_20HZ #define UMARIM_GYRO_SMPLRT_DIV 19 -INFO("Gyro output rate is 50Hz") +PRINT_CONFIG_MSG("Gyro output rate is 50Hz") #endif PRINT_CONFIG_VAR(UMARIM_GYRO_LOWPASS) PRINT_CONFIG_VAR(UMARIM_GYRO_SMPLRT_DIV) diff --git a/sw/airborne/firmwares/fixedwing/autopilot.h b/sw/airborne/firmwares/fixedwing/autopilot.h index 4305eb7f16..a7ae8e0d64 100644 --- a/sw/airborne/firmwares/fixedwing/autopilot.h +++ b/sw/airborne/firmwares/fixedwing/autopilot.h @@ -125,7 +125,7 @@ extern bool_t power_switch; #ifndef CONTROL_FREQUENCY #ifdef CONTROL_RATE #define CONTROL_FREQUENCY CONTROL_RATE -#pragma message "CONTROL_RATE is deprecated. Please use CONTROL_FREQUENCY instead. Defaults to 60Hz if not defined." +#warning "CONTROL_RATE is deprecated. Please use CONTROL_FREQUENCY instead. Defaults to 60Hz if not defined." #else #define CONTROL_FREQUENCY 60 #endif // CONTROL_RATE diff --git a/sw/airborne/firmwares/fixedwing/main_ap.c b/sw/airborne/firmwares/fixedwing/main_ap.c index 9420588842..e4fb19b0cd 100644 --- a/sw/airborne/firmwares/fixedwing/main_ap.c +++ b/sw/airborne/firmwares/fixedwing/main_ap.c @@ -263,7 +263,7 @@ static inline uint8_t pprz_mode_update( void ) { #ifndef RADIO_AUTO_MODE return ModeUpdate(pprz_mode, PPRZ_MODE_OF_PULSE(fbw_state->channels[RADIO_MODE])); #else -#pragma message "Using RADIO_AUTO_MODE to switch between AUTO1 and AUTO2." + INFO("Using RADIO_AUTO_MODE to switch between AUTO1 and AUTO2.") /* If RADIO_AUTO_MODE is enabled mode swithing will be seperated between two switches/channels * RADIO_MODE will switch between PPRZ_MODE_MANUAL and any PPRZ_MODE_AUTO mode selected by RADIO_AUTO_MODE. * @@ -609,7 +609,7 @@ void event_task_ap( void ) { #endif #ifdef InsEvent -#pragma message "calling InsEvent, remove me.." + TODO("calling InsEvent, remove me..") InsEvent(NULL); #endif diff --git a/sw/airborne/modules/bat_checker/bat_checker.c b/sw/airborne/modules/bat_checker/bat_checker.c index fc58a622af..7949d8bd9b 100644 --- a/sw/airborne/modules/bat_checker/bat_checker.c +++ b/sw/airborne/modules/bat_checker/bat_checker.c @@ -38,9 +38,9 @@ #endif #ifndef BAT_CHECKER_DELAY -#pragma message "BAT_CHECKER_DELAY is undefined. Falling back to 5 seconds." #define BAT_CHECKER_DELAY 5 #endif +PRINT_CONFIG_VAR(BAT_CHECKER_DELAY) // at this level, the buzzer will be activated periodically #define WARN_BAT_LEVEL1 (LOW_BAT_LEVEL*10) diff --git a/sw/airborne/subsystems/ahrs/ahrs_float_dcm.c b/sw/airborne/subsystems/ahrs/ahrs_float_dcm.c index 63f60f9052..b53f0bdea0 100644 --- a/sw/airborne/subsystems/ahrs/ahrs_float_dcm.c +++ b/sw/airborne/subsystems/ahrs/ahrs_float_dcm.c @@ -261,7 +261,7 @@ void ahrs_update_accel(void) ahrs_impl.gps_age ++; if (ahrs_impl.gps_age < 50) { //Remove centrifugal acceleration and longitudinal acceleration #if USE_AHRS_GPS_ACCELERATIONS -#pragma message "AHRS_FLOAT_DCM uses GPS acceleration." +PRINT_CONFIG_MSG("AHRS_FLOAT_DCM uses GPS acceleration.") accel_float.x += ahrs_impl.gps_acceleration; // Longitudinal acceleration #endif accel_float.y += ahrs_impl.gps_speed * Omega[2]; // Centrifugal force on Acc_y = GPS_speed*GyroZ @@ -505,7 +505,7 @@ void Drift_correction(void) Vector_Add(Omega_I,Omega_I,Scaled_Omega_I);//adding integrator to the Omega_I } #if USE_MAGNETOMETER_ONGROUND == 1 -#pragma message AHRS_FLOAT_DCM uses magnetometer prior to takeoff and GPS during flight +PRINT_CONFIG_MSG("AHRS_FLOAT_DCM uses magnetometer prior to takeoff and GPS during flight") else if (launch == FALSE) { float COGX = imu.mag.x; // Non-Tilt-Compensated (for filter stability reasons) diff --git a/sw/airborne/subsystems/imu.c b/sw/airborne/subsystems/imu.c index 36666c8bbe..f3533687a0 100644 --- a/sw/airborne/subsystems/imu.c +++ b/sw/airborne/subsystems/imu.c @@ -39,7 +39,7 @@ void imu_init(void) { VECT3_ASSIGN(imu.mag_neutral, IMU_MAG_X_NEUTRAL, IMU_MAG_Y_NEUTRAL, IMU_MAG_Z_NEUTRAL); #else #if USE_MAGNETOMETER -#pragma message "Info: Magnetomter neutrals are set to zero!" +INFO("Magnetomter neutrals are set to zero!") #endif INT_VECT3_ZERO(imu.mag_neutral); #endif diff --git a/sw/airborne/subsystems/imu/imu_aspirin.c b/sw/airborne/subsystems/imu/imu_aspirin.c index 39517dfba8..1bbc692a7f 100644 --- a/sw/airborne/subsystems/imu/imu_aspirin.c +++ b/sw/airborne/subsystems/imu/imu_aspirin.c @@ -94,7 +94,7 @@ void imu_impl_init(void) #endif #if ASPIRIN_ARCH_INDEP -#warning "Arch dependent functions (accel and gyro eoc interrupt) not used for aspirin!" +TODO("Arch dependent functions (accel and gyro eoc interrupt) not used for aspirin!") #else imu_aspirin_arch_init(); #endif diff --git a/sw/airborne/subsystems/imu/imu_aspirin2.c b/sw/airborne/subsystems/imu/imu_aspirin2.c index 3057b87be3..cd2f412923 100644 --- a/sw/airborne/subsystems/imu/imu_aspirin2.c +++ b/sw/airborne/subsystems/imu/imu_aspirin2.c @@ -299,7 +299,7 @@ static void mpu_configure(void) #if !IMU_ASPIRIN_DISABLE_BARO #ifdef IMU_ASPIRIN_VERSION_2_1 -#pragma message "Reading the MS5611" +PRINT_CONFIG_MSG("Reading the MS5611") /* diff --git a/sw/airborne/subsystems/imu/imu_aspirin_i2c.c b/sw/airborne/subsystems/imu/imu_aspirin_i2c.c index ad2b404de0..b9c381714f 100644 --- a/sw/airborne/subsystems/imu/imu_aspirin_i2c.c +++ b/sw/airborne/subsystems/imu/imu_aspirin_i2c.c @@ -68,10 +68,10 @@ PRINT_CONFIG_VAR(ASPIRIN_GYRO_LOWPASS) #ifndef ASPIRIN_GYRO_SMPLRT_DIV # if PERIODIC_FREQUENCY <= 60 # define ASPIRIN_GYRO_SMPLRT_DIV 19 - INFO("Gyro output rate is 50Hz") + PRINT_CONFIG_MSG("Gyro output rate is 50Hz") # else # define ASPIRIN_GYRO_SMPLRT_DIV 9 - INFO("Gyro output rate is 100Hz") + PRINT_CONFIG_MSG("Gyro output rate is 100Hz") # endif #endif PRINT_CONFIG_VAR(ASPIRIN_GYRO_SMPLRT_DIV) diff --git a/sw/airborne/subsystems/imu/imu_ppzuav.c b/sw/airborne/subsystems/imu/imu_ppzuav.c index bfce8c13a7..8d79810446 100644 --- a/sw/airborne/subsystems/imu/imu_ppzuav.c +++ b/sw/airborne/subsystems/imu/imu_ppzuav.c @@ -66,10 +66,10 @@ PRINT_CONFIG_VAR(IMU_PPZUAV_GYRO_LOWPASS) #ifndef IMU_PPZUAV_GYRO_SMPLRT_DIV # if PERIODIC_FREQUENCY <= 60 # define IMU_PPZUAV_GYRO_SMPLRT_DIV 19 - INFO("Gyro output rate is 50Hz") + PRINT_CONFIG_MSG("Gyro output rate is 50Hz") # else # define IMU_PPZUAV_GYRO_SMPLRT_DIV 9 - INFO("Gyro output rate is 100Hz") + PRINT_CONFIG_MSG("Gyro output rate is 100Hz") # endif #endif PRINT_CONFIG_VAR(IMU_PPZUAV_GYRO_SMPLRT_DIV) diff --git a/sw/include/std.h b/sw/include/std.h index e7e718956a..a4fad5f58b 100644 --- a/sw/include/std.h +++ b/sw/include/std.h @@ -40,7 +40,17 @@ #define TODO(x) DO_PRAGMA(message ("TODO - " x)) #define INFO(x) DO_PRAGMA(message ("Info: " x)) #define INFO_VALUE(x,v) DO_PRAGMA(message ("Info: " x VALUE(v))) + +/* only if PRINT_CONFIG is true */ +#if PRINT_CONFIG +#define PRINT_CONFIG_MSG(x) DO_PRAGMA(message ("Config: " x)) +#define PRINT_CONFIG_MSG_VALUE(x,v) DO_PRAGMA(message ("Config: " x VALUE(v)) #define PRINT_CONFIG_VAR(var) DO_PRAGMA(message ("Config: " #var " = " VALUE(var))) +#else +#define PRINT_CONFIG_MSG(x) +#define PRINT_CONFIG_MSG_VALUE(x,v) +#define PRINT_CONFIG_VAR(var) +#endif #ifndef FALSE