diff --git a/badge.go b/badge.go index fcde783..6ebad79 100644 --- a/badge.go +++ b/badge.go @@ -176,8 +176,8 @@ func scroll(topline, middleline, bottomline string) { display.FillScreen(colorWhite) writeLine(topline, getRainbowRGB(200), displayWidth/2, 3*displayHeight/10, displayWidth, true) - writeLine(middleline, getRainbowRGB(80), displayWidth/2, 55*displayHeight/100, displayWidth, true) - writeLine(bottomline, getRainbowRGB(120), displayWidth/2, 8*displayHeight/10, displayWidth, true) + writeLine(middleline, getRainbowRGB(80), displayWidth/2, 6*displayHeight/10, displayWidth, true) + writeLine(bottomline, getRainbowRGB(120), displayWidth/2, 9*displayHeight/10, displayWidth, true) display.SetScrollArea(0, 0) defer func() { diff --git a/info.go b/info.go index dfb6d4b..20dbfe5 100644 --- a/info.go +++ b/info.go @@ -66,14 +66,9 @@ func Info() { for { time.Sleep(100 * time.Millisecond) getInput() - for b := 0; b < 9; b++ { - if !buttonsOldState[b] && buttonsState[b] { - quit = true - break - } - } - if quit { - break + if goBack() { + quit = true + return } } } diff --git a/info_pybadge.go b/info_pybadge.go index 853dd18..fcf21c5 100644 --- a/info_pybadge.go +++ b/info_pybadge.go @@ -5,7 +5,6 @@ package main import ( "image/color" - "machine" "time" "tinygo.org/x/tinyfont" @@ -42,9 +41,10 @@ func Info() { for { time.Sleep(100 * time.Millisecond) - pressed, _ := buttons.Read8Input() - if pressed&machine.BUTTON_SELECT_MASK > 0 || pressed&machine.BUTTON_START_MASK > 0 { - break + getInput() + if goBack() { + quit = true + return } } }