Commit 7bdfa5ad authored by Timothy E Baldwin's avatar Timothy E Baldwin
Browse files

Call Portable_Idle when idle

Previously Wimp was calling Portable_Idle during Wimp_Poll if the
number of polls per second was high. Instead `powersave_tick`
will call Portable_Idle if there have been interrupts since
the last call.

This results in a rapid return to a low power state.

Also, don't register every second callback if only Portable_Idle
is available.
parent ecd62c36
......@@ -343,9 +343,9 @@ initfirsttask
MOVVS R1, #0
01
AND R1, R1, #(PortableFeature_Speed :OR: PortableFeature_Idle :OR: PortableFeature_Stop)
TST R1, #(PortableFeature_Speed :OR: PortableFeature_Idle)
TST R1, #PortableFeature_Speed
STR R1, WimpPortableFlags
BEQ %FT01 ; don't attach call back routine if no portable
BEQ %FT01 ; don't attach call back routine if no adjustable speed
|
MOV R0,#0
MOV R1,#0
......
......@@ -822,9 +822,22 @@ powersave_tick
STR R14,IdlePerSec
[ Stork
LDR R14, WimpPortableFlags
TST R14, #PowerSave ; if power saving
TSTNE R14, #PortableFeature_Idle ; and Portable_Idle works
SWINE XPortable_Idle ; then go dormant until next interrupt or centi-second tick
TST R14, #PortableFeature_Idle ; Portable_Idle works
BEQ %FT01 ; Skip if not
; Check if an interrupt has occoured since this routine
; last ran, by checking if the top of the interrupt stack
; where the return address is saved has changed.
SetModeSEI IRQ32_mode, r0, r4
; If not then go dormant until next interrupt.
LDR r0, [sp, #-4]
TEQ r0, r12
SWIEQ Portable_Idle
STR r12, [sp, #-4]
RestPSR r4
01
]
EXIT
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment