Add line offset

This commit is contained in:
Gregor Riepl 2021-05-05 23:39:27 +02:00
parent 2ca9c28c5c
commit e7d8246759

View file

@ -47,7 +47,7 @@ func (c *Can) DisplayWrite(line int, a []byte) error {
// print in separate chunks, as one frame payload is limited to 7 bytes
// the display has only 16 characters per line, so we truncate there
for i := 0; i < min(len(a), 16); i += 7 {
err := c.bus.Publish(DisplayCommand{addr, a[i:min(i+7,len(a))]}.Encode())
err := c.bus.Publish(DisplayCommand{addr + i, a[i:min(i+7,len(a))]}.Encode())
if err != nil {
return err
}