Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable OSD for all targets #7118

Merged
merged 1 commit into from
Jun 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/main/io/osd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1755,10 +1755,11 @@ static bool osdDrawSingleElement(uint8_t item)

case OSD_REMAINING_FLIGHT_TIME_BEFORE_RTH:
{
static timeUs_t updatedTimestamp = 0;
/*static int32_t updatedTimeSeconds = 0;*/
timeUs_t currentTimeUs = micros();
static int32_t timeSeconds = -1;
#if defined(USE_ADC) && defined(USE_GPS)
static timeUs_t updatedTimestamp = 0;
timeUs_t currentTimeUs = micros();
if (cmpTimeUs(currentTimeUs, updatedTimestamp) >= MS2US(1000)) {
#ifdef USE_WIND_ESTIMATOR
timeSeconds = calculateRemainingFlightTimeBeforeRTH(osdConfig()->estimations_wind_compensation);
Expand All @@ -1767,10 +1768,13 @@ static bool osdDrawSingleElement(uint8_t item)
#endif
updatedTimestamp = currentTimeUs;
}
#endif
if ((!ARMING_FLAG(ARMED)) || (timeSeconds == -1)) {
buff[0] = SYM_FLY_M;
strcpy(buff + 1, "--:--");
#if defined(USE_ADC) && defined(USE_GPS)
updatedTimestamp = 0;
#endif
} else if (timeSeconds == -2) {
// Wind is too strong to come back with cruise throttle
buff[0] = SYM_FLY_M;
Expand All @@ -1787,9 +1791,10 @@ static bool osdDrawSingleElement(uint8_t item)
break;

case OSD_REMAINING_DISTANCE_BEFORE_RTH:;
static int32_t distanceMeters = -1;
#if defined(USE_ADC) && defined(USE_GPS)
static timeUs_t updatedTimestamp = 0;
timeUs_t currentTimeUs = micros();
static int32_t distanceMeters = -1;
if (cmpTimeUs(currentTimeUs, updatedTimestamp) >= MS2US(1000)) {
#ifdef USE_WIND_ESTIMATOR
distanceMeters = calculateRemainingDistanceBeforeRTH(osdConfig()->estimations_wind_compensation);
Expand All @@ -1798,6 +1803,7 @@ static bool osdDrawSingleElement(uint8_t item)
#endif
updatedTimestamp = currentTimeUs;
}
#endif
buff[0] = SYM_TRIP_DIST;
if ((!ARMING_FLAG(ARMED)) || (distanceMeters == -1)) {
buff[4] = SYM_DIST_M;
Expand Down
1 change: 0 additions & 1 deletion src/main/target/AIKONF4/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@
#define TARGET_IO_PORTC 0xffff
#define TARGET_IO_PORTD 0xffff

#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI3
#define MAX7456_CS_PIN SPI3_NSS_PIN
Expand Down
1 change: 0 additions & 1 deletion src/main/target/AIRBOTF7/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
#endif

// *************** OSD *****************************
#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI2
#define MAX7456_CS_PIN PC15
Expand Down
1 change: 0 additions & 1 deletion src/main/target/ALIENFLIGHTNGF7/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@
#define I2C1_SCL PB6
#define I2C1_SDA PB7

#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI3
#define MAX7456_CS_PIN PB12
Expand Down
1 change: 0 additions & 1 deletion src/main/target/ANYFCF7/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@
#define SPI4_MISO_PIN PE13
#define SPI4_MOSI_PIN PE14

#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI3
#define MAX7456_CS_PIN SPI3_NSS_PIN
Expand Down
1 change: 0 additions & 1 deletion src/main/target/ANYFCM7/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@
#define USE_FLASH_M25P16
#define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT

#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI3
#define MAX7456_CS_PIN SPI3_NSS_PIN
Expand Down
1 change: 0 additions & 1 deletion src/main/target/ASGARD32F4/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@
#define SPI3_MISO_PIN PB4
#define SPI3_MOSI_PIN PB5

#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI3
#define MAX7456_CS_PIN PA15
Expand Down
1 change: 0 additions & 1 deletion src/main/target/ASGARD32F7/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@
#define SPI3_MISO_PIN PB4
#define SPI3_MOSI_PIN PB5

#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI3
#define MAX7456_CS_PIN PA15
Expand Down
1 change: 0 additions & 1 deletion src/main/target/BEEROTORF4/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
#define TEMPERATURE_I2C_BUS BUS_I2C1
#define BNO055_I2C_BUS BUS_I2C1

#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI3
#define MAX7456_CS_PIN SPI3_NSS_PIN
Expand Down
1 change: 0 additions & 1 deletion src/main/target/BETAFLIGHTF3/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
#define SPI2_MISO_PIN PB14
#define SPI2_MOSI_PIN PB15

#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI1
#define MAX7456_CS_PIN PA1
Expand Down
1 change: 0 additions & 1 deletion src/main/target/BETAFLIGHTF4/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
#define BMP280_SPI_BUS BUS_SPI2
#define BMP280_CS_PIN PB3

#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI2
#define MAX7456_CS_PIN PB12
Expand Down
1 change: 0 additions & 1 deletion src/main/target/CLRACINGF4AIR/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
#define BMP280_SPI_BUS BUS_SPI3
#define BMP280_CS_PIN PB3

#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI3
#define MAX7456_CS_PIN PA15
Expand Down
1 change: 0 additions & 1 deletion src/main/target/DALRCF405/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
#define SPI3_MISO_PIN PC11
#define SPI3_MOSI_PIN PB5

#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI3
#define MAX7456_CS_PIN PA15
Expand Down
1 change: 0 additions & 1 deletion src/main/target/DALRCF722DUAL/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@
#define SPI3_MISO_PIN PB4
#define SPI3_MOSI_PIN PB5

#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI2
#define MAX7456_CS_PIN SPI2_NSS_PIN
Expand Down
1 change: 0 additions & 1 deletion src/main/target/FF_F35_LIGHTNING/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
#define BMP280_CS_PIN PC5
#define BMP280_SPI_BUS BUS_SPI3

#define USE_OSD
#define USE_MAX7456
#define MAX7456_CS_PIN PA4
#define MAX7456_SPI_BUS BUS_SPI1
Expand Down
1 change: 0 additions & 1 deletion src/main/target/FF_FORTINIF4/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
/*---------------------------------*/

/*-------------OSD-----------------*/
#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI3
#define MAX7456_CS_PIN PB3
Expand Down
1 change: 0 additions & 1 deletion src/main/target/FF_PIKOF4/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@

#if defined(FF_PIKOF4OSD)
/*-------------OSD-----------------*/
#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI1
#define MAX7456_CS_PIN PA4
Expand Down
1 change: 0 additions & 1 deletion src/main/target/FIREWORKSV2/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@
#define SPI3_MISO_PIN PC11
#define SPI3_MOSI_PIN PC12

#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI3
#define MAX7456_CS_PIN PA15
Expand Down
1 change: 0 additions & 1 deletion src/main/target/FISHDRONEF4/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
#define SPI2_MISO_PIN PC2
#define SPI2_MOSI_PIN PC3

#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI2
#define MAX7456_CS_PIN SPI2_NSS_PIN
Expand Down
1 change: 0 additions & 1 deletion src/main/target/FLYWOOF411/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
#define USE_MAG_LIS3MDL

// *************** SPI OSD *****************************
#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI2
#define MAX7456_CS_PIN PB12
Expand Down
1 change: 0 additions & 1 deletion src/main/target/FLYWOOF745/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@
#define SPI4_MISO_PIN PE5
#define SPI4_MOSI_PIN PE6

#define USE_OSD

#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI2
Expand Down
1 change: 0 additions & 1 deletion src/main/target/FLYWOOF7DUAL/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
#define M25P16_SPI_BUS BUS_SPI3

/*** OSD ***/
#define USE_OSD
#define USE_MAX7456
#define MAX7456_CS_PIN PB12
#define MAX7456_SPI_BUS BUS_SPI2
Expand Down
4 changes: 2 additions & 2 deletions src/main/target/FOXEERF405/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
#define M25P16_SPI_BUS BUS_SPI2

/*** OSD ***/
#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI3
#define MAX7456_CS_PIN PA15
Expand Down Expand Up @@ -147,4 +146,5 @@
#define TARGET_IO_PORTA 0xffff
#define TARGET_IO_PORTB 0xffff
#define TARGET_IO_PORTC 0xffff
#define TARGET_IO_PORTD (BIT(2))
#define TARGET_IO_PORTD (BIT(2))

4 changes: 2 additions & 2 deletions src/main/target/FOXEERF722DUAL/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
#define M25P16_SPI_BUS BUS_SPI2

/*** OSD ***/
#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI3
#define MAX7456_CS_PIN PC3
Expand Down Expand Up @@ -158,4 +157,5 @@
#define TARGET_IO_PORTA 0xffff
#define TARGET_IO_PORTB 0xffff
#define TARGET_IO_PORTC 0xffff
#define TARGET_IO_PORTD (BIT(2))
#define TARGET_IO_PORTD (BIT(2))

1 change: 0 additions & 1 deletion src/main/target/FRSKYF3/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
#define I2C1_SDA PB7

#define USE_SPI
#define USE_OSD

// include the max7456 driver
#define USE_MAX7456
Expand Down
1 change: 0 additions & 1 deletion src/main/target/FRSKYF4/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#define BMP280_SPI_BUS BUS_SPI3
#define BMP280_CS_PIN PB3

#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI3
#define MAX7456_CS_PIN PA15
Expand Down
1 change: 0 additions & 1 deletion src/main/target/FRSKYPILOT/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@
#define UART5_AF 1

// OSD
#define USE_OSD
#define USE_UART6
#define UART6_TX_PIN PC6
#define UART6_RX_PIN PC7
Expand Down
1 change: 0 additions & 1 deletion src/main/target/FRSKY_ROVERF7/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
#define SPI3_MISO_PIN PB4
#define SPI3_MOSI_PIN PB5

#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI3
#define MAX7456_CS_PIN PD2
Expand Down
1 change: 0 additions & 1 deletion src/main/target/FURYF4OSD/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
#define SPI2_MISO_PIN PB14
#define SPI2_MOSI_PIN PB15

#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI2
#define MAX7456_CS_PIN PB12
Expand Down
4 changes: 2 additions & 2 deletions src/main/target/HGLRCF722/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@
#define SPI2_MISO_PIN PB14
#define SPI2_MOSI_PIN PB15

#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI2
#define MAX7456_CS_PIN PB12
Expand Down Expand Up @@ -177,4 +176,5 @@
#define MAX_PWM_OUTPUT_PORTS 8
#define USE_DSHOT
#define USE_SERIALSHOT
#define USE_ESC_SENSOR
#define USE_ESC_SENSOR

1 change: 0 additions & 1 deletion src/main/target/IFLIGHTF4_SUCCEXD/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
#define SPI2_MISO_PIN PB14
#define SPI2_MOSI_PIN PB15

#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI2
#define MAX7456_CS_PIN PB12
Expand Down
1 change: 0 additions & 1 deletion src/main/target/IFLIGHTF4_TWING/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
#define SPI2_MISO_PIN PB14
#define SPI2_MOSI_PIN PB15

#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI2
#define MAX7456_CS_PIN PB12
Expand Down
1 change: 0 additions & 1 deletion src/main/target/IFLIGHTF7_TWING/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@
#define SPI2_MISO_PIN PB14
#define SPI2_MOSI_PIN PB15

#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI2
#define MAX7456_CS_PIN PB12
Expand Down
1 change: 0 additions & 1 deletion src/main/target/KAKUTEF4/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
# define USE_MAG
#endif

#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI3
#define MAX7456_CS_PIN PB14
Expand Down
4 changes: 2 additions & 2 deletions src/main/target/KAKUTEF7/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@
#define SPI4_MISO_PIN PE5
#define SPI4_MOSI_PIN PE6

#define USE_OSD

#ifndef KAKUTEF7HDV
#define USE_MAX7456
Expand Down Expand Up @@ -179,4 +178,5 @@

#define MAX_PWM_OUTPUT_PORTS 6

#define BNO055_I2C_BUS BUS_I2C1
#define BNO055_I2C_BUS BUS_I2C1

4 changes: 2 additions & 2 deletions src/main/target/KAKUTEF7MINIV3/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@
/*
* OSD
*/
#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI3
#define MAX7456_CS_PIN PA15
Expand Down Expand Up @@ -173,4 +172,5 @@
#define TARGET_IO_PORTA 0xffff
#define TARGET_IO_PORTB 0xffff
#define TARGET_IO_PORTC 0xffff
#define TARGET_IO_PORTD (BIT(2))
#define TARGET_IO_PORTD (BIT(2))

1 change: 0 additions & 1 deletion src/main/target/KROOZX/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
#define SDCARD_DETECT_INVERTED
#define SDCARD_DETECT_PIN PC13

#define USE_OSD
#ifdef USE_MSP_DISPLAYPORT
#undef USE_MSP_DISPLAYPORT
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/main/target/MAMBAF405US/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@
#define VBAT_SCALE_DEFAULT 1100

// ******* OSD ********
#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI2
#define MAX7456_CS_PIN PB12
Expand Down Expand Up @@ -199,4 +198,5 @@
#define TEMPERATURE_I2C_BUS DEFAULT_I2C_BUS
#define PITOT_I2C_BUS DEFAULT_I2C_BUS
#define RANGEFINDER_I2C_BUS DEFAULT_I2C_BUS
#define BNO055_I2C_BUS DEFAULT_I2C_BUS
#define BNO055_I2C_BUS DEFAULT_I2C_BUS