summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2017-10-30 22:12:58 -0400
committerMichael Sevakis <jethead71@rockbox.org>2017-10-30 22:12:58 -0400
commit8ef33f479e8dc95811e503a49306b9e56dd84cb1 (patch)
tree10ef2ac22b92c62034d7bf1a124bf26902a1e6a7 /firmware/target
parentf728559bf951b515be39d61f3ffd0eaae64b2b0d (diff)
downloadrockbox-8ef33f479e8dc95811e503a49306b9e56dd84cb1.tar.gz
rockbox-8ef33f479e8dc95811e503a49306b9e56dd84cb1.zip
AMS: Convert ascodec_endofch() to use bit mod function's return value.
It cleans up the code and it was the initial inspiring reason to change them. Change-Id: I299499117b8a12d93d13d6563683bab89ab80555
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/arm/as3525/ascodec-as3525.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/firmware/target/arm/as3525/ascodec-as3525.c b/firmware/target/arm/as3525/ascodec-as3525.c
index e144f07ed4..1bd07c57b1 100644
--- a/firmware/target/arm/as3525/ascodec-as3525.c
+++ b/firmware/target/arm/as3525/ascodec-as3525.c
@@ -545,14 +545,7 @@ void ascodec_wait_adc_finished(void)
545/* read sticky end-of-charge bit and clear it */ 545/* read sticky end-of-charge bit and clear it */
546bool ascodec_endofch(void) 546bool ascodec_endofch(void)
547{ 547{
548 int oldlevel = disable_irq_save(); 548 return bitclr32(&ascodec_enrd0_shadow, CHG_ENDOFCH) & CHG_ENDOFCH;
549
550 bool ret = ascodec_enrd0_shadow & CHG_ENDOFCH;
551 ascodec_enrd0_shadow &= ~CHG_ENDOFCH; /* clear interrupt */
552
553 restore_irq(oldlevel);
554
555 return ret;
556} 549}
557 550
558/* read the presence state of the charger */ 551/* read the presence state of the charger */