diff --git a/fb/main.go b/fb/main.go index d0b3be8..806c4dd 100644 --- a/fb/main.go +++ b/fb/main.go @@ -8,11 +8,6 @@ import ( "os" ) -var ( - devfb *os.File - Width, Height int -) - func resolution() (w int, h int) { resFile, err := os.Open("/sys/class/graphics/fb0/virtual_size") if err != nil { @@ -28,8 +23,10 @@ func resolution() (w int, h int) { return } +var devfb *os.File +const Width, Height int = resolution() + func init() { - Width, Height = resolution() var err error devfb, err = os.OpenFile("/dev/fb", os.O_WRONLY, os.ModePerm) if err != nil {