adafruit / Adafruit-GFX-Library

Adafruit GFX graphics core Arduino library, this is the 'core' class that all our other graphics libraries derive from
https://learn.adafruit.com/adafruit-gfx-graphics-library
Other
2.41k stars 1.55k forks source link

Remove volatile from wait loops #434

Closed caternuson closed 1 year ago

caternuson commented 1 year ago

Removes the volatile qualifier being used in a few wait loops. Doesn't seem necessary. This fixes a compile warn for ESP32. Example warn for ref:

  /home/runner/Arduino/libraries/Adafruit_GFX_Library/Adafruit_SPITFT.cpp:2309:39: warning: '++' expression of 'volatile'-qualified type is deprecated [-Wvolatile]
   2309 |   for (volatile uint8_t i = 0; i < 1; i++)
        |                                       ^
caternuson commented 1 year ago

Tested with a Feather ESP32 and PID 1480 (older non eyespi version) TFT and library example: https://github.com/adafruit/Adafruit_ILI9341/blob/master/examples/graphicstest/graphicstest.ino

caternuson commented 1 year ago

@ladyada for review

ladyada commented 1 year ago

i'd just delete - current version will be optimized out

caternuson commented 1 year ago

@ladyada take it you mean just remove the loops? pushed those changes and confirmed still working with same test setup.

ladyada commented 1 year ago

yep lets try it!