From 8ce7ef1342f6cc20e1f69bb346756a6b16aeca1f Mon Sep 17 00:00:00 2001 From: Alexander Malishev Date: Sat, 23 Jun 2018 17:11:05 +1000 Subject: [PATCH] HAL_ChibiOS: added OSD support for MatekF405 and Omnibuspro --- .../AP_HAL_ChibiOS/hwdef/MatekF405-Wing/hwdef.dat | 5 ++++- .../AP_HAL_ChibiOS/hwdef/omnibusf4pro/hwdef.dat | 13 ++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/MatekF405-Wing/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/MatekF405-Wing/hwdef.dat index 5316bea909..cbc094e6c9 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/MatekF405-Wing/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/MatekF405-Wing/hwdef.dat @@ -136,7 +136,7 @@ define HAL_BUZZER_OFF 0 SPIDEV mpu6000 SPI1 DEVID1 MPU_CS MODE3 1*MHZ 4*MHZ # OSD on SPI -SPIDEV osd SPI2 DEVID2 OSD_CS MODE0 1*MHZ 4*MHZ +SPIDEV osd SPI2 DEVID2 OSD_CS MODE0 10*MHZ 10*MHZ # SD Card on SPI SPIDEV sdcard SPI3 DEVID3 SDCARD_CS MODE0 400*KHZ 25*MHZ @@ -166,6 +166,9 @@ define HAL_COMPASS_HMC5843_ROTATION ROTATION_YAW_90 define ALLOW_ARM_NO_COMPASS +define OSD_ENABLED ENABLED +ROMFS osd_font.bin libraries/AP_OSD/fonts/clarity.bin + define BOARD_PWM_COUNT_DEFAULT 9 define STM32_PWM_USE_ADVANCED TRUE diff --git a/libraries/AP_HAL_ChibiOS/hwdef/omnibusf4pro/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/omnibusf4pro/hwdef.dat index f72c37d087..a26811ad08 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/omnibusf4pro/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/omnibusf4pro/hwdef.dat @@ -89,7 +89,7 @@ PC9 SBUS_INVERT_TX OUTPUT LOW SPIDEV mpu6000 SPI1 DEVID1 MPU6000_CS MODE3 1*MHZ 8*MHZ SPIDEV sdcard SPI2 DEVID2 SDCARD_CS MODE0 400*KHZ 25*MHZ SPIDEV bmp280 SPI3 DEVID3 BMP280_CS MODE3 1*MHZ 8*MHZ -SPIDEV osd SPI3 DEVID4 OSD_CS MODE0 1*MHZ 4*MHZ +SPIDEV osd SPI3 DEVID4 OSD_CS MODE0 10*MHZ 10*MHZ define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_CHIBIOS_OMNIBUSF4PRO @@ -102,6 +102,7 @@ define HAL_BARO_BMP280_NAME "bmp280" define HAL_COMPASS_DEFAULT HAL_COMPASS_HMC5843 define HAL_COMPASS_HMC5843_I2C_BUS 0 define HAL_COMPASS_HMC5843_I2C_ADDR 0x1E +define ALLOW_ARM_NO_COMPASS TRUE define STORAGE_FLASH_PAGE 1 define HAL_STORAGE_SIZE 15360 @@ -120,7 +121,17 @@ define HAL_BATT_CURR_SCALE 18.2 define HAL_GPIO_A_LED_PIN 57 +define OSD_ENABLED ENABLED + #To complementary channels work we define this define STM32_PWM_USE_ADVANCED TRUE define BOARD_PWM_COUNT_DEFAULT 6 + +#define CH_DBG_ENABLE_ASSERTS TRUE +#define CH_DBG_ENABLE_CHECKS TRUE +#define CH_DBG_SYSTEM_STATE_CHECK TRUE +#define CH_DBG_ENABLE_STACK_CHECK TRUE + +#font for the osd +ROMFS osd_font.bin libraries/AP_OSD/fonts/clarity.bin