altos: Need to use 16-bit counts for ao_xmem functions
[fw/altos] / src / cc1111 / ao_battery.c
index 070f682fa60ded378db1b6f646b0a2caf14baae4..b9845fb38612cde07a071bb6e6e9ac1d8e46734f 100644 (file)
@@ -36,7 +36,7 @@ ao_battery_get(void)
                ADCCON3 = ADCCON3_EREF_VDD | ADCCON3_EDIV_512 | BATTERY_PIN;
                ao_sleep(DATA_TO_XDATA(&ao_battery_value));
                );
-       return (uint16_t) ((int32_t) ao_battery_value.v * (int32_t) 3333 >> 15);
+       return (uint16_t) ((int32_t) ao_battery_value.v * (int32_t) 4950 >> 15);
 }
 
 static void