1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-23 16:25:26 +03:00

Enable OSD for all targets

This commit is contained in:
scavanger 2021-06-15 09:52:51 +02:00 committed by Pawel Spychalski (DzikuVx)
parent da5575823f
commit 753c447974
62 changed files with 30 additions and 74 deletions

View file

@ -1754,10 +1754,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);
@ -1766,10 +1767,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;
@ -1786,9 +1790,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);
@ -1797,6 +1802,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;

View file

@ -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

View file

@ -59,7 +59,6 @@
#endif
// *************** OSD *****************************
#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI2
#define MAX7456_CS_PIN PC15

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -58,7 +58,6 @@
/*---------------------------------*/
/*-------------OSD-----------------*/
#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI3
#define MAX7456_CS_PIN PB3

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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
@ -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))

View file

@ -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
@ -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))

View file

@ -56,7 +56,6 @@
#define I2C1_SDA PB7
#define USE_SPI
#define USE_OSD
// include the max7456 driver
#define USE_MAX7456

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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
@ -177,4 +176,5 @@
#define MAX_PWM_OUTPUT_PORTS 8
#define USE_DSHOT
#define USE_SERIALSHOT
#define USE_ESC_SENSOR
#define USE_ESC_SENSOR

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -104,7 +104,6 @@
#define SPI4_MISO_PIN PE5
#define SPI4_MOSI_PIN PE6
#define USE_OSD
#ifndef KAKUTEF7HDV
#define USE_MAX7456
@ -179,4 +178,5 @@
#define MAX_PWM_OUTPUT_PORTS 6
#define BNO055_I2C_BUS BUS_I2C1
#define BNO055_I2C_BUS BUS_I2C1

View file

@ -106,7 +106,6 @@
/*
* OSD
*/
#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI3
#define MAX7456_CS_PIN PA15
@ -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))

View file

@ -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

View file

@ -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
@ -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

View file

@ -156,7 +156,6 @@
#define VBAT_SCALE_DEFAULT 1100
// ******* OSD ********
#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI2
#define MAX7456_CS_PIN SPI2_NSS_PIN
@ -207,4 +206,5 @@
#define BNO055_I2C_BUS DEFAULT_I2C_BUS
#endif
#endif

View file

@ -76,7 +76,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 PB10

View file

@ -85,7 +85,6 @@
#define SPI2_MISO_PIN PC2
#define SPI2_MOSI_PIN PC3
#define USE_OSD
#define USE_MAX7456
#define MAX7456_CS_PIN PB12
#define MAX7456_SPI_BUS BUS_SPI2

View file

@ -55,7 +55,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

View file

@ -50,7 +50,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

View file

@ -90,7 +90,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 PB10

View file

@ -169,7 +169,6 @@
#define TARGET_IO_PORTD 0xffff
#define MAX_PWM_OUTPUT_PORTS 10
#define USE_OSD
#define USE_DSHOT
#define USE_SERIALSHOT
#define USE_ESC_SENSOR

View file

@ -95,7 +95,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
@ -195,4 +194,5 @@
#define USE_SERIALSHOT
#define USE_ESC_SENSOR
#define BNO055_I2C_BUS BUS_I2C1
#define BNO055_I2C_BUS BUS_I2C1

View file

@ -98,7 +98,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

View file

@ -71,7 +71,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
@ -207,4 +206,5 @@
#define MAX_PWM_OUTPUT_PORTS 15
#define USE_DSHOT
#define USE_ESC_SENSOR
#define USE_SERIALSHOT
#define USE_SERIALSHOT

View file

@ -61,7 +61,6 @@
#define BMP280_CS_PIN PA9
// *************** SPI OSD *****************************
#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI2
#define MAX7456_CS_PIN PA10

View file

@ -103,7 +103,6 @@
#define SDCARD_SPI_BUS BUS_SPI2
#define SDCARD_CS_PIN SPI2_NSS_PIN
#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI1
#define MAX7456_CS_PIN PB1

View file

@ -213,7 +213,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

View file

@ -126,7 +126,6 @@
#define SPI4_MISO_PIN PE5
#define SPI4_MOSI_PIN PE6
#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI2
#define MAX7456_CS_PIN SPI2_NSS_PIN

View file

@ -128,7 +128,6 @@
#define SPI3_MISO_PIN PC11
#define SPI3_MOSI_PIN PC12
#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI2
#define MAX7456_CS_PIN PA15

View file

@ -141,7 +141,6 @@
#define TARGET_IO_PORTD 0xffff
#define MAX_PWM_OUTPUT_PORTS 10
#define USE_OSD
#define USE_DSHOT
#define USE_SERIALSHOT
#define USE_ESC_SENSOR

View file

@ -73,7 +73,6 @@
#define USE_FLASH_M25P16
/*** OSD ***/
#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI2
#define MAX7456_CS_PIN PB10
@ -171,4 +170,5 @@
#define TARGET_IO_PORTC 0xffff
#define TARGET_IO_PORTD (BIT(2))
#define RANGEFINDER_I2C_BUS BUS_I2C1
#define RANGEFINDER_I2C_BUS BUS_I2C1

View file

@ -73,7 +73,6 @@
// OSD -- SPI2
#define USE_SPI_DEVICE_2
#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI2
#define MAX7456_CS_PIN PB12

View file

@ -143,7 +143,6 @@
// PC4 - NC - Free for ADC12_IN14 / VTX CS
// PC5 - NC - Free for ADC12_IN15 / VTX Enable / OSD VSYNC
//#define USE_OSD
//#define USE_MAX7456
//#define USE_OSD_OVER_MSP_DISPLAYPORT

View file

@ -168,8 +168,6 @@
#define CURRENT_METER_SCALE 300
#define USE_OSD
#define USE_LED_STRIP
#define WS2811_PIN PA1

View file

@ -74,7 +74,6 @@
#define USE_BARO_MS5611
#define USE_BARO_BMP280
#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI1
#define MAX7456_CS_PIN PA14

View file

@ -115,7 +115,6 @@
#define I2C_DEVICE (I2CDEV_1)
// OSD
#define USE_OSD
#define USE_MAX7456
#define MAX7456_SPI_BUS BUS_SPI1
#define MAX7456_CS_PIN PA14

View file

@ -140,7 +140,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

View file

@ -127,6 +127,7 @@
#define USE_PWM_DRIVER_PCA9685
#define USE_OSD
#define USE_FRSKYOSD
#define USE_DJI_HD_OSD
#define USE_SMARTPORT_MASTER