From 80b9cf09def737fa46e8d037b173c433d2ed2597 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 9 Dec 2018 07:42:59 +1100 Subject: [PATCH] HAL_ChibiOS: setup PH4 for right voltage scaling --- libraries/AP_HAL_ChibiOS/hwdef/PH4-mini/hwdef.dat | 6 ++++++ libraries/AP_HAL_ChibiOS/hwdef/Pixhawk4/hwdef.dat | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/PH4-mini/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/PH4-mini/hwdef.dat index d010e4e4e5..00bb363d9d 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/PH4-mini/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/PH4-mini/hwdef.dat @@ -11,3 +11,9 @@ undef AP_FEATURE_SBUS_OUT # RCInput PI5 TIM8_CH1 TIM8 RCININT PULLUP LOW + +# setup for supplied power brick +undef HAL_BATT_VOLT_SCALE +define HAL_BATT_VOLT_SCALE 18.182 +undef HAL_BATT_CURR_SCALE +define HAL_BATT_CURR_SCALE 36.364 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/Pixhawk4/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/Pixhawk4/hwdef.dat index 663a3bca8d..194ed5906e 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/Pixhawk4/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/Pixhawk4/hwdef.dat @@ -6,3 +6,9 @@ include ../fmuv5/hwdef.dat # use ChibiOS based IO firmware to avoid issue with SBUS # input. NuttX has no parity checking on UARTs ROMFS io_firmware.bin Tools/IO_Firmware/fmuv2_IO_ChibiOS.bin + +# setup for supplied power brick +undef HAL_BATT_VOLT_SCALE +define HAL_BATT_VOLT_SCALE 18.182 +undef HAL_BATT_CURR_SCALE +define HAL_BATT_CURR_SCALE 36.364