adafruit / Adafruit_EPD

e-paper display driver for Arduino
140 stars 56 forks source link

Remove volatile compound assignments and add cast for min #78

Closed caternuson closed 10 months ago

caternuson commented 10 months ago

Removes use of compound assignments with volatiles to avoid compile warns. Example warn for ref:

  /home/runner/Arduino/libraries/Adafruit_EPD/src/Adafruit_EPD.cpp:659:11: warning: compound assignment with 'volatile'-qualified left operand is deprecated [-Wvolatile]
    659 |   *csPort |= csPinMask;
        |   ~~~~~~~~^~~~~~~~~~~~

Also adds an explicit cast to a min call that was causing a compile error:

  /home/runner/Arduino/libraries/Adafruit_EPD/src/drivers/Adafruit_ACeP.cpp:132:28: error: no matching function for call to 'min(uint32_t&, unsigned int)'
    132 |     uint32_t numbytes = min(remaining, sizeof(block));
        |                         ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
caternuson commented 10 months ago

Tested with a Feather ESP32 and an old model PID 3625 EPD running library example: https://github.com/adafruit/Adafruit_EPD/blob/master/examples/ThinkInk_tricolor/ThinkInk_tricolor.ino

caternuson commented 10 months ago

@ladyada for review

ladyada commented 10 months ago

looks great thanks!