Commit a8c4aa91 authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Make use of power saving features when sat waiting for user input

Detail:
  s/Wimp03 - Move two key bits of power-saving logic out of repollwimp and into a new subroutine (powersave_tick)
  s/Wimp01, s/Wimp07 - Call powersave_tick when displaying an error box or "Press SPACE or click mouse to continue", so that CPU will drop speed and enter WFI state instead of running at full tilt.
Admin:
  Tested on Pandaboard
  Fixes issue reported on forums with CPUs getting hot for no good reason:
  https://www.riscosopen.org/forum/forums/4/topics/3749


Version 5.51. Tagged as 'Wimp-5_51'
parent 503570de
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "5.50"
Module_Version SETA 550
Module_MajorVersion SETS "5.51"
Module_Version SETA 551
Module_MinorVersion SETS ""
Module_Date SETS "10 Oct 2015"
Module_ApplicationDate SETS "10-Oct-15"
Module_Date SETS "29 Nov 2015"
Module_ApplicationDate SETS "29-Nov-15"
Module_ComponentName SETS "Wimp"
Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/Wimp"
Module_FullVersion SETS "5.50"
Module_HelpVersion SETS "5.50 (10 Oct 2015)"
Module_FullVersion SETS "5.51"
Module_HelpVersion SETS "5.51 (29 Nov 2015)"
END
/* (5.50)
/* (5.51)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 5.50
#define Module_MajorVersion_CMHG 5.51
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 10 Oct 2015
#define Module_Date_CMHG 29 Nov 2015
#define Module_MajorVersion "5.50"
#define Module_Version 550
#define Module_MajorVersion "5.51"
#define Module_Version 551
#define Module_MinorVersion ""
#define Module_Date "10 Oct 2015"
#define Module_Date "29 Nov 2015"
#define Module_ApplicationDate "10-Oct-15"
#define Module_ApplicationDate "29-Nov-15"
#define Module_ComponentName "Wimp"
#define Module_ComponentPath "castle/RiscOS/Sources/Desktop/Wimp"
#define Module_FullVersion "5.50"
#define Module_HelpVersion "5.50 (10 Oct 2015)"
#define Module_LibraryVersionInfo "5:50"
#define Module_FullVersion "5.51"
#define Module_HelpVersion "5.51 (29 Nov 2015)"
#define Module_LibraryVersionInfo "5:51"
......@@ -5759,6 +5759,7 @@ waitforkey
;
BL flushkbdmouse
11
BL powersave_tick
BL pollforkey
BEQ %BT11
;
......
......@@ -514,15 +514,7 @@ taskisused
;
repollwimp
Debug poll2, "repollwimp"
LDR R14,IdlePerSec ; update the idle information for the portable modules
ADD R14,R14,#1
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
]
BL powersave_tick
LDR R14,taskhandle ; get userblk back (may be corrupted)
LDR R14,[wsptr,R14]
LDR userblk,[R14,#task_registers+4*1]
......@@ -805,6 +797,19 @@ tryreturnit
MOV R0,#Redraw_Window_Request
B ExitPoll
powersave_tick
Entry "r0"
LDR R14,IdlePerSec ; update the idle information for the portable modules
ADD R14,R14,#1
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
]
EXIT
LTORG
;
......
......@@ -1600,6 +1600,7 @@ noerrorwindow ; come back here if error window dead
51
BL flushkbdmouse ; only done the first time
11
BL powersave_tick
BL pollforkey
BNE %FT12
......@@ -1684,6 +1685,7 @@ useerrorwindow
;
pollit
BL powersave_tick
MOV R0,#&81 ; read key with 0 time limit
MOV R1,#0
MOV R2,#0
......
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