Skip to content

Commit

Permalink
fix: Implement SIAutoSwitchOffBehaviour:, SetAutoSwitchOffBehavior:()
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsci committed Oct 19, 2024
1 parent 66f7cea commit ec9f8d8
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/opx/system.lua
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ function IsBacklightPresent(stack, runtime) -- 5
end

function SetAutoSwitchOffBehavior(stack, runtime) -- 6
unimplemented("opx.system.SetAutoSwitchOffBehavior")
local behavior = stack:pop()
printf("SetAutoSwitchOffBehavior(%d)\n", behavior)
stack:push(0)
end

function SetAutoSwitchOffTime(stack, runtime) -- 7
Expand Down
35 changes: 34 additions & 1 deletion src/opx/systinfo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,39 @@ KDateFormatAmerican = 0
KDateFormatEuropean = 1
KDateFormatJapanese = 2

KTimeFormat12Hour = 0
KTimeFormat24Hour = 1

KDaylightSavingZoneHome = 0
KDaylightSavingZoneEuropean = 1
KDaylightSavingZoneNorthern = 2
KDaylightSavingZoneSouthern = 4

KUnitsImperial = 0
KUnitsMetric = 1

KSwitchOffDisabled = 0
KSwitchOffEnabledOnBatteries = 1
KSwitchOffEnabledAlways = 2

KBacklightBehaviorTimed = 0
KBacklightBehaviorUntimed = 1

KRemoteLinkDisabled = 0
KRemoteLinkDisconnected = 1
KRemoteLinkConnected = 2

KLinkTypeUnknown = 0
KLinkTypeCable = 1
KLinkTypeIrDA = 2

KLinkBpsUnknown = 0
KLinkBps9600 = 1
KLinkBps19200 = 2
KLinkBps38400 = 3
KLinkBps57600 = 4
KLinkBps115200 = 5

function SISystemVisible(stack, runtime) -- 1
unimplemented("opx.systinfo.SISystemVisible")
end
Expand Down Expand Up @@ -226,7 +259,7 @@ function SISoundEnabled(stack, runtime) -- 30
end

function SIAutoSwitchOffBehaviour(stack, runtime) -- 31
unimplemented("opx.systinfo.SIAutoSwitchOffBehaviour")
stack:push(KSwitchOffDisabled)
end

function SIAutoSwitchOffTime(stack, runtime) -- 32
Expand Down

0 comments on commit ec9f8d8

Please sign in to comment.