caemor / epd-waveshare

Drivers for various EPDs from Waveshare
ISC License
207 stars 128 forks source link

fix: overflow error #173

Closed ldicarlo closed 6 months ago

ldicarlo commented 9 months ago

Currently on my computer it displays an error message:

44 | const NUM_DISPLAY_BYTES: usize = WIDTH as usize  * HEIGHT as usize /8;
   |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `800_usize * 480_usize`, which would overflow

as said in #151. This a fix to this error (when compiling for arduino, in my case).

tippfehlr commented 9 months ago

What target are you compiling for? (which arduino?)

My problem as in #151 was that the buffer doesn’t fit in my memory (of an Arduino Nano) at all.

ldicarlo commented 9 months ago

Ok. Mine is an Arduino Uno. But I may have complety misunderstood the whole config. I use arduino-hal and ravedude but I am kind of lost between all the tools I am using.

What I know is that when I git clone this repo and use it as a dependency, it compile only with this version. In the master version, I get the same error as you in #151

tippfehlr commented 9 months ago

I also use ardino-hal and ravedude (I don’t know if this even could be run with another hal or if there exists another good one)

You shouldn’t need to clone the repo for normal use though. Just add it with cargo add epd-waveshare (except when you are developing on it ofc)

caemor commented 6 months ago

Thanks!