mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 12:45:26 -05:00
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
This commit is contained in:
parent
f728559bf9
commit
8ef33f479e
1 changed files with 1 additions and 8 deletions
|
|
@ -545,14 +545,7 @@ void ascodec_wait_adc_finished(void)
|
||||||
/* read sticky end-of-charge bit and clear it */
|
/* read sticky end-of-charge bit and clear it */
|
||||||
bool ascodec_endofch(void)
|
bool ascodec_endofch(void)
|
||||||
{
|
{
|
||||||
int oldlevel = disable_irq_save();
|
return bitclr32(&ascodec_enrd0_shadow, CHG_ENDOFCH) & CHG_ENDOFCH;
|
||||||
|
|
||||||
bool ret = ascodec_enrd0_shadow & CHG_ENDOFCH;
|
|
||||||
ascodec_enrd0_shadow &= ~CHG_ENDOFCH; /* clear interrupt */
|
|
||||||
|
|
||||||
restore_irq(oldlevel);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* read the presence state of the charger */
|
/* read the presence state of the charger */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue