Skip to content

Commit

Permalink
chore: fix some start-up timing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Nevexo committed Jan 28, 2025
1 parent 10cc089 commit 7097124
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions display.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func watchTsEvents() {
func startBacklightTickers() {
LoadConfig()
if dimTicker == nil && config.DisplayDimAfterSec != 0 {
fmt.Printf("display: dim_ticker has started.")
fmt.Printf("display: dim_ticker has started\n")
dimTicker = time.NewTicker(time.Duration(config.DisplayDimAfterSec) * time.Second)
defer dimTicker.Stop()

Expand All @@ -225,7 +225,7 @@ func startBacklightTickers() {
}

if offTicker == nil && config.DisplayOffAfterSec != 0 {
fmt.Printf("display: off_ticker has started.")
fmt.Printf("display: off_ticker has started\n")
offTicker = time.NewTicker(time.Duration(config.DisplayOffAfterSec) * time.Second)
defer offTicker.Stop()

Expand All @@ -243,14 +243,14 @@ func startBacklightTickers() {
func init() {
go func() {
waitCtrlClientConnected()
startBacklightTickers()
fmt.Println("setting initial display contents")
time.Sleep(500 * time.Millisecond)
updateStaticContents()
displayInited = true
fmt.Println("display inited")
wakeDisplay(false)
wakeDisplay(true)
requestDisplayUpdate()
startBacklightTickers()
}()

go watchTsEvents()
Expand Down

0 comments on commit 7097124

Please sign in to comment.