Optionally retry on FORM_FACTOR_UNAVAILABLE#946
Conversation
d7fbbb9 to
773847d
Compare
|
Yeah, the boilerplate is unfortunate, but it kinda falls out of the complexity of If it's too much to stomach, one thing you might be able to do is put the -- conf.lua
function lovr.conf(t)
-- ...fill out conf table
-- Wait until headset is connected before booting lovr!
local headset = require('lovr.headset') -- or lovr.headset = require 'lovr.headset' is fine too
local timer = require('lovr.timer')
while not headset.connect() do
timer.sleep(1)
end
endThis is still pretty awkward, but it's got a smaller surface area. (I'm maybe seeing an issue where requiring modules in conf.lua will cause them to not pick up the conf table properly, but that could be fixed) Regarding the change here (optional flag to enable a retry loop in |
Apologies that we are going back and forth on this. It turns out implementing a retry loop in the LUA gets really complicated due to the graphics init order. The amount of boiler plate code required just to connect the headset seems excessive, as shown in this Gist:
https://gist.github.com/gareth-morgan-nv/82d9e3b242146f8028e4d60af73c873c
So this PR adds the same retry loop we pushed in the last PR, but this time its behind a command line flag which is false by default.