Skip to content

Commit

Permalink
Merge pull request #434 from caternuson/esp32_warns
Browse files Browse the repository at this point in the history
Remove volatile from wait loops
  • Loading branch information
caternuson authored Oct 10, 2023
2 parents b0ac687 + 3c0c85b commit 6338e26
Showing 1 changed file with 2 additions and 26 deletions.
28 changes: 2 additions & 26 deletions Adafruit_SPITFT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2305,10 +2305,6 @@ inline void Adafruit_SPITFT::SPI_MOSI_HIGH(void) {
#endif // end !HAS_PORT_SET_CLR
#else // !USE_FAST_PINIO
digitalWrite(swspi._mosi, HIGH);
#if defined(ESP32)
for (volatile uint8_t i = 0; i < 1; i++)
;
#endif // end ESP32
#endif // end !USE_FAST_PINIO
}

Expand All @@ -2328,10 +2324,6 @@ inline void Adafruit_SPITFT::SPI_MOSI_LOW(void) {
#endif // end !HAS_PORT_SET_CLR
#else // !USE_FAST_PINIO
digitalWrite(swspi._mosi, LOW);
#if defined(ESP32)
for (volatile uint8_t i = 0; i < 1; i++)
;
#endif // end ESP32
#endif // end !USE_FAST_PINIO
}

Expand All @@ -2343,22 +2335,14 @@ inline void Adafruit_SPITFT::SPI_SCK_HIGH(void) {
#if defined(HAS_PORT_SET_CLR)
#if defined(KINETISK)
*swspi.sckPortSet = 1;
#else // !KINETISK
#else // !KINETISK
*swspi.sckPortSet = swspi.sckPinMask;
#if defined(__IMXRT1052__) || defined(__IMXRT1062__) // Teensy 4.x
for (volatile uint8_t i = 0; i < 1; i++)
;
#endif
#endif
#else // !HAS_PORT_SET_CLR
*swspi.sckPort |= swspi.sckPinMaskSet;
#endif // end !HAS_PORT_SET_CLR
#else // !USE_FAST_PINIO
digitalWrite(swspi._sck, HIGH);
#if defined(ESP32)
for (volatile uint8_t i = 0; i < 1; i++)
;
#endif // end ESP32
#endif // end !USE_FAST_PINIO
}

Expand All @@ -2370,22 +2354,14 @@ inline void Adafruit_SPITFT::SPI_SCK_LOW(void) {
#if defined(HAS_PORT_SET_CLR)
#if defined(KINETISK)
*swspi.sckPortClr = 1;
#else // !KINETISK
#else // !KINETISK
*swspi.sckPortClr = swspi.sckPinMask;
#if defined(__IMXRT1052__) || defined(__IMXRT1062__) // Teensy 4.x
for (volatile uint8_t i = 0; i < 1; i++)
;
#endif
#endif
#else // !HAS_PORT_SET_CLR
*swspi.sckPort &= swspi.sckPinMaskClr;
#endif // end !HAS_PORT_SET_CLR
#else // !USE_FAST_PINIO
digitalWrite(swspi._sck, LOW);
#if defined(ESP32)
for (volatile uint8_t i = 0; i < 1; i++)
;
#endif // end ESP32
#endif // end !USE_FAST_PINIO
}

Expand Down

0 comments on commit 6338e26

Please sign in to comment.