almindor / st7789

Rust library for displays using the ST7735 driver
https://docs.rs/st7735-lcd
MIT License
49 stars 25 forks source link

fix the clear() function to work on architectures where 240*320 does not fit in a usize. #18

Closed mutantbob closed 2 years ago

mutantbob commented 2 years ago

The clear() function was only clearing a small slice of the screen for me. The call to take() was not working on AVR, probably because 240x320 = 76800, which when converted to a usize becomes 11264.

This patch seems to fix it.

almindor commented 2 years ago

@mutantbob I forgot to mention, could you please look at https://github.com/almindor/mipidsi and see if you could apply the fix there too? I'm deprecating this driver in favour of the unified one.