summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/tms320dm320/mrobe-500/powermgmt-mr500.c
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-10-13 13:06:18 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-10-13 13:37:21 -0400
commit4a3d04654580b1771fcda3492491843d5eac10ad (patch)
treec93aef6dda1960d357e0da146164b0f459c389b3 /firmware/target/arm/tms320dm320/mrobe-500/powermgmt-mr500.c
parentb4865b05b0a3cc45f2873599c6411bef92f40b1c (diff)
downloadrockbox-4a3d046545.tar.gz
rockbox-4a3d046545.tar.bz2
rockbox-4a3d046545.zip
Fix a pile of yellow in the bootloader
Change-Id: Ia89a33bbb13683566e421ac2a002baa20cdb07de
Diffstat (limited to 'firmware/target/arm/tms320dm320/mrobe-500/powermgmt-mr500.c')
-rw-r--r--firmware/target/arm/tms320dm320/mrobe-500/powermgmt-mr500.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/powermgmt-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/powermgmt-mr500.c
index 78f9bbb9c2..6e428ac01f 100644
--- a/firmware/target/arm/tms320dm320/mrobe-500/powermgmt-mr500.c
+++ b/firmware/target/arm/tms320dm320/mrobe-500/powermgmt-mr500.c
@@ -58,33 +58,32 @@ const unsigned short percent_to_volt_charge[11] =
{
4000, 4105, 4210, 4315, 4420, 4525, 4630, 4735, 4840, 4945, 5050,
};
-
+
/* Returns battery voltage from ADC [millivolts] */
int _battery_voltage(void)
{
short bat1, bat2, aux;
- static unsigned last_tick = 0;
+// static unsigned last_tick = 0;
short tsadc;
-
+
tsadc=tsc2100_readreg(TSADC_PAGE, TSADC_ADDRESS);
-
+
/* Set the TSC2100 to read voltages if not busy with pen */
if(!(tsadc & TSADC_PSTCM))
{
tsc2100_set_mode(true, 0x0B);
- last_tick = current_tick;
+// last_tick = current_tick;
}
-
+
if(tsc2100_read_volt(&bat1, &bat2, &aux))
- {
+ {
/* Calculation was:
- * (val << 10) / 4096 * 6 * 2.5
+ * (val << 10) / 4096 * 6 * 2.5
*/
current_voltage = (short)( (int) (bat1 * 15) >> 2 );
current_bat2 = (short)( (bat2 * 15) >> 2 );
current_aux = (short)( (aux * 15) >> 2 );
}
-
+
return current_voltage;
}
-