periph / devices

Go·Hardware·Lean - Device drivers
https://periph.io
Apache License 2.0
85 stars 42 forks source link

waveshare2in13v2: Deduplicate and simplify logic for sending data #33

Closed hansmi closed 2 years ago

hansmi commented 2 years ago

Dev.Clear: Avoid writing one beyond the end of the line. Also build the row data only once before sending it for each line.

Dev.Draw, Dev.DrawPartial: Deduplicate logic for iterating over pixels and simplify it such that a whole row of bits is built before sending them in one go.

Tested using a Waveshare e-Paper 2.13in V2 display.

maruel commented 2 years ago

Please fix the test failure then I can submit.

hansmi commented 2 years ago

@maruel, sorry, missed that. Done.