From 3b8afb674a3ee838e611233219dd6146a6a1c739 Mon Sep 17 00:00:00 2001 From: Martin Budden Date: Sat, 30 Jan 2016 15:31:58 +0000 Subject: [PATCH 1/8] More effective use of BARO, TELEMETRY, BEEPER and USE_QUAD_MIXER_ONLY #defines, allowing reduction of ROM size. --- src/main/config/config.c | 10 ++++++++++ src/main/config/config_master.h | 2 ++ src/main/drivers/pwm_mapping.h | 9 ++++++++- src/main/flight/mixer.h | 7 +++++++ src/main/io/beeper.c | 15 +++++++++++++++ src/main/io/serial_cli.c | 2 ++ src/main/io/serial_msp.c | 10 ++++++++-- src/main/mw.c | 2 ++ src/main/scheduler_tasks.c | 2 ++ 9 files changed, 56 insertions(+), 3 deletions(-) diff --git a/src/main/config/config.c b/src/main/config/config.c index 9fdc3acc525..13f31b49fcd 100755 --- a/src/main/config/config.c +++ b/src/main/config/config.c @@ -221,6 +221,7 @@ void resetGpsProfile(gpsProfile_t *gpsProfile) } #endif +#ifdef BARO void resetBarometerConfig(barometerConfig_t *barometerConfig) { barometerConfig->baro_sample_count = 21; @@ -228,6 +229,7 @@ void resetBarometerConfig(barometerConfig_t *barometerConfig) barometerConfig->baro_cf_vel = 0.985f; barometerConfig->baro_cf_alt = 0.965f; } +#endif void resetSensorAlignment(sensorAlignmentConfig_t *sensorAlignmentConfig) { @@ -252,6 +254,7 @@ void resetFlight3DConfig(flight3DConfig_t *flight3DConfig) flight3DConfig->deadband3d_throttle = 50; } +#ifdef TELEMETRY void resetTelemetryConfig(telemetryConfig_t *telemetryConfig) { telemetryConfig->telemetry_inversion = 0; @@ -263,6 +266,7 @@ void resetTelemetryConfig(telemetryConfig_t *telemetryConfig) telemetryConfig->frsky_vfas_precision = 0; telemetryConfig->hottAlarmSoundInterval = 5; } +#endif void resetBatteryConfig(batteryConfig_t *batteryConfig) { @@ -424,7 +428,9 @@ static void resetConf(void) resetBatteryConfig(&masterConfig.batteryConfig); +#ifdef TELEMETRY resetTelemetryConfig(&masterConfig.telemetryConfig); +#endif masterConfig.rxConfig.serialrx_provider = 0; masterConfig.rxConfig.sbus_inversion = 1; @@ -502,7 +508,9 @@ static void resetConf(void) currentProfile->accDeadband.z = 40; currentProfile->acc_unarmedcal = 1; +#ifdef BARO resetBarometerConfig(¤tProfile->barometerConfig); +#endif // Radio parseRcChannels("AETR1234", &masterConfig.rxConfig); @@ -778,12 +786,14 @@ void activateConfig(void) currentProfile->throttle_correction_angle ); +#if defined(BARO) || defined(SONAR) configureAltitudeHold( ¤tProfile->pidProfile, ¤tProfile->barometerConfig, ¤tProfile->rcControlsConfig, &masterConfig.escAndServoConfig ); +#endif #ifdef BARO useBarometerConfig(¤tProfile->barometerConfig); diff --git a/src/main/config/config_master.h b/src/main/config/config_master.h index 9f95b1f826f..474d992a302 100644 --- a/src/main/config/config_master.h +++ b/src/main/config/config_master.h @@ -86,7 +86,9 @@ typedef struct master_t { serialConfig_t serialConfig; +#ifdef TELEMETRY telemetryConfig_t telemetryConfig; +#endif #ifdef LED_STRIP ledConfig_t ledConfigs[MAX_LED_STRIP_LENGTH]; diff --git a/src/main/drivers/pwm_mapping.h b/src/main/drivers/pwm_mapping.h index f220045edce..32276919b77 100644 --- a/src/main/drivers/pwm_mapping.h +++ b/src/main/drivers/pwm_mapping.h @@ -19,11 +19,18 @@ #include "gpio.h" #include "timer.h" +#ifdef USE_QUAD_MIXER_ONLY +#define MAX_PWM_MOTORS 4 +#define MAX_PWM_SERVOS 1 +#define MAX_MOTORS 4 +#define MAX_SERVOS 1 +#else #define MAX_PWM_MOTORS 12 #define MAX_PWM_SERVOS 8 - #define MAX_MOTORS 12 #define MAX_SERVOS 8 +#endif + #define MAX_PWM_OUTPUT_PORTS MAX_PWM_MOTORS // must be set to the largest of either MAX_MOTORS or MAX_SERVOS #if MAX_PWM_OUTPUT_PORTS < MAX_MOTORS || MAX_PWM_OUTPUT_PORTS < MAX_SERVOS diff --git a/src/main/flight/mixer.h b/src/main/flight/mixer.h index b8100bfc8d4..9348257bf80 100644 --- a/src/main/flight/mixer.h +++ b/src/main/flight/mixer.h @@ -17,8 +17,15 @@ #pragma once + +#ifdef USE_QUAD_MIXER_ONLY +#define MAX_SUPPORTED_MOTORS 4 +#define MAX_SUPPORTED_SERVOS 1 +#else #define MAX_SUPPORTED_MOTORS 12 #define MAX_SUPPORTED_SERVOS 8 +#endif + #define YAW_JUMP_PREVENTION_LIMIT_LOW 80 #define YAW_JUMP_PREVENTION_LIMIT_HIGH 500 diff --git a/src/main/io/beeper.c b/src/main/io/beeper.c index 242662e8854..1f9d4272dda 100644 --- a/src/main/io/beeper.c +++ b/src/main/io/beeper.c @@ -51,6 +51,7 @@ #define BEEPER_COMMAND_REPEAT 0xFE #define BEEPER_COMMAND_STOP 0xFF +#ifdef BEEPER /* Beeper Sound Sequences: (Square wave generation) * Sequence must end with 0xFF or 0xFE. 0xFE repeats the sequence from * start when 0xFF stops the sound when it's completed. @@ -379,3 +380,17 @@ int beeperTableEntryCount(void) { return (int)BEEPER_TABLE_ENTRY_COUNT; } +} +#else +void beeper(beeperMode_e mode) +{ + UNUSED(mode); +} +void beeperSilence(void) +{ +} +void beeperConfirmationBeeps(uint8_t beepCount) +{ + UNUSED(beepCount); +} +#endif diff --git a/src/main/io/serial_cli.c b/src/main/io/serial_cli.c index b955bcd3f82..ef9b0fc8871 100644 --- a/src/main/io/serial_cli.c +++ b/src/main/io/serial_cli.c @@ -536,6 +536,7 @@ const clivalue_t valueTable[] = { { "sbus_inversion", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, &masterConfig.rxConfig.sbus_inversion, .config.lookup = { TABLE_OFF_ON } }, { "spektrum_sat_bind", VAR_UINT8 | MASTER_VALUE, &masterConfig.rxConfig.spektrum_sat_bind, .config.minmax = { SPEKTRUM_SAT_BIND_DISABLED, SPEKTRUM_SAT_BIND_MAX} }, +#ifdef TELEMETRY { "telemetry_switch", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, &masterConfig.telemetryConfig.telemetry_switch, .config.lookup = { TABLE_OFF_ON } }, { "telemetry_inversion", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, &masterConfig.telemetryConfig.telemetry_inversion, .config.lookup = { TABLE_OFF_ON } }, { "frsky_default_lattitude", VAR_FLOAT | MASTER_VALUE, &masterConfig.telemetryConfig.gpsNoFixLatitude, .config.minmax = { -90.0, 90.0 } }, @@ -544,6 +545,7 @@ const clivalue_t valueTable[] = { { "frsky_unit", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, &masterConfig.telemetryConfig.frsky_unit, .config.lookup = { TABLE_UNIT } }, { "frsky_vfas_precision", VAR_UINT8 | MASTER_VALUE, &masterConfig.telemetryConfig.frsky_vfas_precision, .config.minmax = { FRSKY_VFAS_PRECISION_LOW, FRSKY_VFAS_PRECISION_HIGH } }, { "hott_alarm_sound_interval", VAR_UINT8 | MASTER_VALUE, &masterConfig.telemetryConfig.hottAlarmSoundInterval, .config.minmax = { 0, 120 } }, +#endif { "battery_capacity", VAR_UINT16 | MASTER_VALUE, &masterConfig.batteryConfig.batteryCapacity, .config.minmax = { 0, 20000 } }, { "vbat_scale", VAR_UINT8 | MASTER_VALUE, &masterConfig.batteryConfig.vbatscale, .config.minmax = { VBAT_SCALE_MIN, VBAT_SCALE_MAX } }, diff --git a/src/main/io/serial_msp.c b/src/main/io/serial_msp.c index 2ef8ebebb46..7720b9cb397 100644 --- a/src/main/io/serial_msp.c +++ b/src/main/io/serial_msp.c @@ -500,8 +500,10 @@ void mspInit(serialConfig_t *serialConfig) activeBoxIds[activeBoxIdCount++] = BOXOSD; +#ifdef TELEMETRY if (feature(FEATURE_TELEMETRY) && masterConfig.telemetryConfig.telemetry_switch) activeBoxIds[activeBoxIdCount++] = BOXTELEMETRY; +#endif if (feature(FEATURE_SONAR)){ activeBoxIds[activeBoxIdCount++] = BOXSONAR; @@ -1361,8 +1363,12 @@ static bool processInCommand(void) masterConfig.batteryConfig.vbatwarningcellvoltage = read8(); // vbatlevel when buzzer starts to alert break; case MSP_SET_MOTOR: - for (i = 0; i < 8; i++) // FIXME should this use MAX_MOTORS or MAX_SUPPORTED_MOTORS instead of 8 - motor_disarmed[i] = read16(); + for (i = 0; i < 8; i++) { + const int16_t disarmed = read16(); + if (i < MAX_SUPPORTED_MOTORS) { + motor_disarmed[i] = disarmed; + } + } break; case MSP_SET_SERVO_CONFIGURATION: #ifdef USE_SERVOS diff --git a/src/main/mw.c b/src/main/mw.c index 2d6a8963a8e..84ee8a03772 100644 --- a/src/main/mw.c +++ b/src/main/mw.c @@ -729,10 +729,12 @@ void taskHandleSerial(void) handleSerial(); } +#ifdef BEEPER void taskUpdateBeeper(void) { beeperUpdate(); //call periodic beeper handler } +#endif void taskUpdateBattery(void) { diff --git a/src/main/scheduler_tasks.c b/src/main/scheduler_tasks.c index 1c679b97ae0..70ff48c81dc 100755 --- a/src/main/scheduler_tasks.c +++ b/src/main/scheduler_tasks.c @@ -70,12 +70,14 @@ cfTask_t cfTasks[TASK_COUNT] = { .staticPriority = TASK_PRIORITY_LOW, }, +#ifdef BEEPER [TASK_BEEPER] = { .taskName = "BEEPER", .taskFunc = taskUpdateBeeper, .desiredPeriod = 1000000 / 100, // 100 Hz .staticPriority = TASK_PRIORITY_MEDIUM, }, +#endif [TASK_BATTERY] = { .taskName = "BATTERY", From a1d13fdb8d99f469c4ef2d199a1d8f3f0697f79e Mon Sep 17 00:00:00 2001 From: Martin Budden Date: Sat, 30 Jan 2016 16:25:34 +0000 Subject: [PATCH 2/8] More effective use of MAG #define to get better ROM reduction. --- src/main/flight/imu.c | 6 +++++- src/main/sensors/initialisation.c | 9 +++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/flight/imu.c b/src/main/flight/imu.c index 328c0fb2197..e68ee63ad43 100644 --- a/src/main/flight/imu.c +++ b/src/main/flight/imu.c @@ -370,10 +370,12 @@ static bool imuIsAccelerometerHealthy(void) return (81 < accMagnitude) && (accMagnitude < 121); } +#ifdef MAG static bool isMagnetometerHealthy(void) { return (magADC[X] != 0) && (magADC[Y] != 0) && (magADC[Z] != 0); } +#endif static void imuCalculateEstimatedAttitude(void) { @@ -402,9 +404,11 @@ static void imuCalculateEstimatedAttitude(void) useAcc = true; } +#ifdef MAG if (sensors(SENSOR_MAG) && isMagnetometerHealthy()) { useMag = true; } +#endif #if defined(GPS) else if (STATE(FIXED_WING) && sensors(SENSOR_GPS) && STATE(GPS_FIX) && GPS_numSat >= 5 && GPS_speed >= 300) { // In case of a fixed-wing aircraft we can use GPS course over ground to correct heading @@ -464,4 +468,4 @@ int16_t calculateThrottleAngleCorrection(uint8_t throttle_correction_value) if (angle > 900) angle = 900; return lrintf(throttle_correction_value * sin_approx(angle / (900.0f * M_PIf / 2.0f))); -} \ No newline at end of file +} diff --git a/src/main/sensors/initialisation.c b/src/main/sensors/initialisation.c index 4d4940e00cc..5006ce4baae 100755 --- a/src/main/sensors/initialisation.c +++ b/src/main/sensors/initialisation.c @@ -535,6 +535,7 @@ static void detectBaro(baroSensor_e baroHardwareToUse) #endif } +#ifdef MAG static void detectMag(magSensor_e magHardwareToUse) { magSensor_e magHardware; @@ -637,6 +638,7 @@ static void detectMag(magSensor_e magHardwareToUse) detectedSensors[SENSOR_INDEX_MAG] = magHardware; sensorsSet(SENSOR_MAG); } +#endif void reconfigureAlignment(sensorAlignmentConfig_t *sensorAlignmentConfig) { @@ -646,9 +648,11 @@ void reconfigureAlignment(sensorAlignmentConfig_t *sensorAlignmentConfig) if (sensorAlignmentConfig->acc_align != ALIGN_DEFAULT) { accAlign = sensorAlignmentConfig->acc_align; } +#ifdef MAG if (sensorAlignmentConfig->mag_align != ALIGN_DEFAULT) { magAlign = sensorAlignmentConfig->mag_align; } +#endif } bool sensorsAutodetect(sensorAlignmentConfig_t *sensorAlignmentConfig, uint8_t gyroLpf, uint8_t accHardwareToUse, uint8_t magHardwareToUse, uint8_t baroHardwareToUse, @@ -657,6 +661,9 @@ bool sensorsAutodetect(sensorAlignmentConfig_t *sensorAlignmentConfig, uint8_t g int16_t deg, min; +#ifndef MAG + UNUSED(magHardwareToUse); +#endif memset(&acc, 0, sizeof(acc)); memset(&gyro, 0, sizeof(gyro)); @@ -682,7 +689,9 @@ bool sensorsAutodetect(sensorAlignmentConfig_t *sensorAlignmentConfig, uint8_t g gyroUpdateSampleRate(looptime, gyroLpf, gyroSync, gyroSyncDenominator); // Set gyro sampling rate divider before initialization gyro.init(gyroLpf); +#ifdef MAG detectMag(magHardwareToUse); +#endif reconfigureAlignment(sensorAlignmentConfig); From 6d2b978d5141673d13fe1663a28d45df148607ac Mon Sep 17 00:00:00 2001 From: Martin Budden Date: Sun, 31 Jan 2016 07:14:37 +0000 Subject: [PATCH 3/8] Further refinement of use of BARO and MAG #defines for ROM reduction. --- src/main/config/config_profile.h | 2 ++ src/main/io/beeper.c | 4 +++- src/main/io/serial_cli.c | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/config/config_profile.h b/src/main/config/config_profile.h index f102d0c1155..1b924b8718d 100644 --- a/src/main/config/config_profile.h +++ b/src/main/config/config_profile.h @@ -32,7 +32,9 @@ typedef struct profile_s { float accz_lpf_cutoff; // cutoff frequency for the low pass filter used on the acc z-axis for althold in Hz accDeadband_t accDeadband; +#ifdef BARO barometerConfig_t barometerConfig; +#endif uint8_t acc_unarmedcal; // turn automatic acc compensation on/off diff --git a/src/main/io/beeper.c b/src/main/io/beeper.c index 1f9d4272dda..2daf78ac453 100644 --- a/src/main/io/beeper.c +++ b/src/main/io/beeper.c @@ -380,8 +380,9 @@ int beeperTableEntryCount(void) { return (int)BEEPER_TABLE_ENTRY_COUNT; } -} + #else + void beeper(beeperMode_e mode) { UNUSED(mode); @@ -393,4 +394,5 @@ void beeperConfirmationBeeps(uint8_t beepCount) { UNUSED(beepCount); } + #endif diff --git a/src/main/io/serial_cli.c b/src/main/io/serial_cli.c index ef9b0fc8871..48c894a838f 100644 --- a/src/main/io/serial_cli.c +++ b/src/main/io/serial_cli.c @@ -627,14 +627,18 @@ const clivalue_t valueTable[] = { { "acc_trim_pitch", VAR_INT16 | PROFILE_VALUE, &masterConfig.profile[0].accelerometerTrims.values.pitch, .config.minmax = { -300, 300 } }, { "acc_trim_roll", VAR_INT16 | PROFILE_VALUE, &masterConfig.profile[0].accelerometerTrims.values.roll, .config.minmax = { -300, 300 } }, +#ifdef BARO { "baro_tab_size", VAR_UINT8 | PROFILE_VALUE, &masterConfig.profile[0].barometerConfig.baro_sample_count, .config.minmax = { 0, BARO_SAMPLE_COUNT_MAX } }, { "baro_noise_lpf", VAR_FLOAT | PROFILE_VALUE, &masterConfig.profile[0].barometerConfig.baro_noise_lpf, .config.minmax = { 0 , 1 } }, { "baro_cf_vel", VAR_FLOAT | PROFILE_VALUE, &masterConfig.profile[0].barometerConfig.baro_cf_vel, .config.minmax = { 0 , 1 } }, { "baro_cf_alt", VAR_FLOAT | PROFILE_VALUE, &masterConfig.profile[0].barometerConfig.baro_cf_alt, .config.minmax = { 0 , 1 } }, { "baro_hardware", VAR_UINT8 | MASTER_VALUE, &masterConfig.baro_hardware, .config.minmax = { 0, BARO_MAX } }, +#endif +#ifdef MAG { "mag_hardware", VAR_UINT8 | MASTER_VALUE, &masterConfig.mag_hardware, .config.minmax = { 0, MAG_MAX } }, { "mag_declination", VAR_INT16 | PROFILE_VALUE, &masterConfig.profile[0].mag_declination, .config.minmax = { -18000, 18000 } }, +#endif { "pid_controller", VAR_UINT8 | PROFILE_VALUE | MODE_LOOKUP, &masterConfig.profile[0].pidProfile.pidController, .config.lookup = { TABLE_PID_CONTROLLER } }, From 4a9e90bd5c1a0dd0c501ae80de5d0246f15052dc Mon Sep 17 00:00:00 2001 From: Martin Budden Date: Mon, 1 Feb 2016 07:54:54 +0000 Subject: [PATCH 4/8] Added #ifdef BARO. --- src/main/io/serial_msp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/io/serial_msp.c b/src/main/io/serial_msp.c index 7720b9cb397..d5c3cfa859d 100644 --- a/src/main/io/serial_msp.c +++ b/src/main/io/serial_msp.c @@ -464,9 +464,11 @@ void mspInit(serialConfig_t *serialConfig) activeBoxIds[activeBoxIdCount++] = BOXHORIZON; } +#ifdef BARO if (sensors(SENSOR_BARO)) { activeBoxIds[activeBoxIdCount++] = BOXBARO; } +#endif if (sensors(SENSOR_ACC) || sensors(SENSOR_MAG)) { activeBoxIds[activeBoxIdCount++] = BOXMAG; From 6a4823a88b6c98b7c14c4de9c5aedbc713c81d7b Mon Sep 17 00:00:00 2001 From: Martin Budden Date: Mon, 1 Feb 2016 17:58:08 +0000 Subject: [PATCH 5/8] Fixed serialization in MSP_MOTOR command. --- src/main/io/serial_msp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/io/serial_msp.c b/src/main/io/serial_msp.c index d5c3cfa859d..11892d5db02 100644 --- a/src/main/io/serial_msp.c +++ b/src/main/io/serial_msp.c @@ -731,7 +731,10 @@ static bool processOutCommand(uint8_t cmdMSP) break; #endif case MSP_MOTOR: - s_struct((uint8_t *)motor, 16); + headSerialReply(16); + for (i = 0; i < 8; i++) { + serialize16(i < MAX_SUPPORTED_MOTORS ? motor[i] : 0); + } break; case MSP_RC: headSerialReply(2 * rxRuntimeConfig.channelCount); From cd0874e5d3a9d8c8ee893b7a29e6e4172e018f0a Mon Sep 17 00:00:00 2001 From: Martin Budden Date: Mon, 1 Feb 2016 18:22:12 +0000 Subject: [PATCH 6/8] Fixed unused function warning. --- src/main/io/serial_msp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/io/serial_msp.c b/src/main/io/serial_msp.c index 11892d5db02..534a95a1014 100644 --- a/src/main/io/serial_msp.c +++ b/src/main/io/serial_msp.c @@ -243,12 +243,14 @@ static void tailSerialReply(void) serialEndWrite(mspSerialPort); } +#ifdef USE_SERVOS static void s_struct(uint8_t *cb, uint8_t siz) { headSerialReply(siz); while (siz--) serialize8(*cb++); } +#endif static void serializeNames(const char *s) { From d91f9534a3f5c563aec3819ff16114b1b177450d Mon Sep 17 00:00:00 2001 From: Martin Budden Date: Mon, 1 Feb 2016 18:40:33 +0000 Subject: [PATCH 7/8] Whitespace tidy. --- src/main/drivers/pwm_mapping.h | 1 - src/main/flight/mixer.h | 2 -- 2 files changed, 3 deletions(-) diff --git a/src/main/drivers/pwm_mapping.h b/src/main/drivers/pwm_mapping.h index 32276919b77..a3d50fc8e1a 100644 --- a/src/main/drivers/pwm_mapping.h +++ b/src/main/drivers/pwm_mapping.h @@ -30,7 +30,6 @@ #define MAX_MOTORS 12 #define MAX_SERVOS 8 #endif - #define MAX_PWM_OUTPUT_PORTS MAX_PWM_MOTORS // must be set to the largest of either MAX_MOTORS or MAX_SERVOS #if MAX_PWM_OUTPUT_PORTS < MAX_MOTORS || MAX_PWM_OUTPUT_PORTS < MAX_SERVOS diff --git a/src/main/flight/mixer.h b/src/main/flight/mixer.h index 9348257bf80..bee8febadca 100644 --- a/src/main/flight/mixer.h +++ b/src/main/flight/mixer.h @@ -17,7 +17,6 @@ #pragma once - #ifdef USE_QUAD_MIXER_ONLY #define MAX_SUPPORTED_MOTORS 4 #define MAX_SUPPORTED_SERVOS 1 @@ -25,7 +24,6 @@ #define MAX_SUPPORTED_MOTORS 12 #define MAX_SUPPORTED_SERVOS 8 #endif - #define YAW_JUMP_PREVENTION_LIMIT_LOW 80 #define YAW_JUMP_PREVENTION_LIMIT_HIGH 500 From 4743b5514a74303304b0c70646263e1f9807445a Mon Sep 17 00:00:00 2001 From: Martin Budden Date: Tue, 2 Feb 2016 10:50:56 +0000 Subject: [PATCH 8/8] Fixed build for SPARKY, ALIENWIIF3, EUSTM32F103RC, and OLIMEXINO targets. --- src/main/config/config.c | 2 ++ src/main/io/beeper.c | 20 +++++++++----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/config/config.c b/src/main/config/config.c index 13f31b49fcd..a6f224cb706 100755 --- a/src/main/config/config.c +++ b/src/main/config/config.c @@ -844,7 +844,9 @@ void validateAndFixConfig(void) #ifdef STM32F303xC // hardware supports serial port inversion, make users life easier for those that want to connect SBus RX's +#ifdef TELEMETRY masterConfig.telemetryConfig.telemetry_inversion = 1; +#endif #endif /* diff --git a/src/main/io/beeper.c b/src/main/io/beeper.c index 2daf78ac453..3d044dcc0a2 100644 --- a/src/main/io/beeper.c +++ b/src/main/io/beeper.c @@ -383,16 +383,14 @@ int beeperTableEntryCount(void) #else -void beeper(beeperMode_e mode) -{ - UNUSED(mode); -} -void beeperSilence(void) -{ -} -void beeperConfirmationBeeps(uint8_t beepCount) -{ - UNUSED(beepCount); -} +// Stub out beeper functions if #BEEPER not defined +void beeper(beeperMode_e mode) {UNUSED(mode);} +void beeperSilence(void) {} +void beeperConfirmationBeeps(uint8_t beepCount) {UNUSED(beepCount);} +void beeperUpdate(void) {} +uint32_t getArmingBeepTimeMicros(void) {return 0;} +beeperMode_e beeperModeForTableIndex(int idx) {UNUSED(idx); return BEEPER_SILENCE;} +const char *beeperNameForTableIndex(int idx) {UNUSED(idx); return NULL;} +int beeperTableEntryCount(void) {return 0;} #endif