Reuse redraws to decrease cpu load

This commit is contained in:
2023-08-06 18:22:56 +03:00
parent 502890530c
commit 776819ea00
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -36,6 +36,7 @@ const CAN_ID_06C = 0x06C
const CAN_ID_061 = 0x061
const CAN_ID_062 = 0x062
const CAN_ID_065 = 0x065
const bufferSize = 100
type CanFrame struct {
CanId uint32
@@ -159,7 +160,7 @@ func StartCan(canbus string) (<-chan *CanFrame, error) {
if cerr := socket.Bind(canbus, filter); cerr == nil {
canevents := make(chan *CanFrame)
canevents := make(chan *CanFrame, bufferSize)
go func() {
defer close(canevents)
+1 -1
View File
@@ -52,7 +52,7 @@ func main() {
display.Start()
updates := make(chan *yabl.Event)
updates := make(chan *yabl.Event, 1000)
var f func()
f = func() {