diff options
Diffstat (limited to 'firmware/target/arm/imx233/lradc-imx233.c')
-rw-r--r-- | firmware/target/arm/imx233/lradc-imx233.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/firmware/target/arm/imx233/lradc-imx233.c b/firmware/target/arm/imx233/lradc-imx233.c index 1101e3d32d..8b065bffea 100644 --- a/firmware/target/arm/imx233/lradc-imx233.c +++ b/firmware/target/arm/imx233/lradc-imx233.c | |||
@@ -177,12 +177,14 @@ int imx233_lradc_sense_die_temperature(int nmos_chan, int pmos_chan) | |||
177 | return (diff * 1012) / 4000; | 177 | return (diff * 1012) / 4000; |
178 | } | 178 | } |
179 | 179 | ||
180 | void imx233_lradc_setup_battery_conversion(bool automatic, int scale_factor) | 180 | void imx233_lradc_setup_battery_conversion(bool automatic, unsigned long scale_factor) |
181 | { | 181 | { |
182 | __REG_CLR(HW_LRADC_CONVERSION) = HW_LRADC_CONVERSION__AUTOMATIC | | 182 | __REG_CLR(HW_LRADC_CONVERSION) = HW_LRADC_CONVERSION__SCALE_FACTOR_BM; |
183 | HW_LRADC_CONVERSION__SCALE_FACTOR_BM; | 183 | __REG_SET(HW_LRADC_CONVERSION) = scale_factor; |
184 | __REG_SET(HW_LRADC_CONVERSION) = scale_factor | | 184 | if(automatic) |
185 | automatic ? HW_LRADC_CONVERSION__AUTOMATIC : 0; | 185 | __REG_SET(HW_LRADC_CONVERSION) = HW_LRADC_CONVERSION__AUTOMATIC; |
186 | else | ||
187 | __REG_CLR(HW_LRADC_CONVERSION) = HW_LRADC_CONVERSION__AUTOMATIC; | ||
186 | } | 188 | } |
187 | 189 | ||
188 | int imx233_lradc_read_battery_voltage(void) | 190 | int imx233_lradc_read_battery_voltage(void) |