@@ -87,7 +87,7 @@ static const struct {
87
87
#endif
88
88
};
89
89
#define NUM_TIMERS (sizeof tcList / sizeof tcList[0 ]) // /< # timer/counters
90
- #endif // end __SAMD51__
90
+ #endif // end __SAMD51__
91
91
92
92
#endif // end USE_SPI_DMA
93
93
@@ -157,7 +157,7 @@ Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int8_t cs, int8_t dc,
157
157
} else {
158
158
swspi.misoPort = portInputRegister (dc);
159
159
}
160
- #else // !CORE_TEENSY
160
+ #else // !CORE_TEENSY
161
161
dcPinMask = digitalPinToBitMask (dc);
162
162
swspi.sckPinMask = digitalPinToBitMask (sck);
163
163
swspi.mosiPinMask = digitalPinToBitMask (mosi);
@@ -188,7 +188,7 @@ Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int8_t cs, int8_t dc,
188
188
swspi.misoPort = (PORTreg_t)portInputRegister (digitalPinToPort (dc));
189
189
}
190
190
#endif // end !CORE_TEENSY
191
- #else // !HAS_PORT_SET_CLR
191
+ #else // !HAS_PORT_SET_CLR
192
192
dcPort = (PORTreg_t)portOutputRegister (digitalPinToPort (dc));
193
193
dcPinMaskSet = digitalPinToBitMask (dc);
194
194
swspi.sckPort = (PORTreg_t)portOutputRegister (digitalPinToPort (sck));
@@ -241,7 +241,7 @@ Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int8_t cs, int8_t dc,
241
241
_dc(dc) {
242
242
hwspi._spi = &SPI;
243
243
}
244
- #else // !ESP8266
244
+ #else // !ESP8266
245
245
Adafruit_SPITFT::Adafruit_SPITFT (uint16_t w, uint16_t h, int8_t cs, int8_t dc,
246
246
int8_t rst)
247
247
: Adafruit_SPITFT(w, h, &SPI, cs, dc, rst) {
@@ -304,7 +304,7 @@ Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, SPIClass *spiClass,
304
304
csPortSet = dcPortSet;
305
305
csPortClr = dcPortClr;
306
306
}
307
- #else // !CORE_TEENSY
307
+ #else // !CORE_TEENSY
308
308
dcPinMask = digitalPinToBitMask (dc);
309
309
dcPortSet = &(PORT->Group [g_APinDescription[dc].ulPort ].OUTSET .reg );
310
310
dcPortClr = &(PORT->Group [g_APinDescription[dc].ulPort ].OUTCLR .reg );
@@ -322,7 +322,7 @@ Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, SPIClass *spiClass,
322
322
csPinMask = 0 ;
323
323
}
324
324
#endif // end !CORE_TEENSY
325
- #else // !HAS_PORT_SET_CLR
325
+ #else // !HAS_PORT_SET_CLR
326
326
dcPort = (PORTreg_t)portOutputRegister (digitalPinToPort (dc));
327
327
dcPinMaskSet = digitalPinToBitMask (dc);
328
328
if (cs >= 0 ) {
@@ -425,7 +425,7 @@ Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, tftBusWidth busWidth,
425
425
tft8.readPort = portInputRegister (d0);
426
426
tft8.dirSet = portModeRegister (d0);
427
427
tft8.dirClr = portModeRegister (d0);
428
- #else // !CORE_TEENSY
428
+ #else // !CORE_TEENSY
429
429
tft8.wrPinMask = digitalPinToBitMask (wr);
430
430
tft8.wrPortSet = &(PORT->Group [g_APinDescription[wr].ulPort ].OUTSET .reg );
431
431
tft8.wrPortClr = &(PORT->Group [g_APinDescription[wr].ulPort ].OUTCLR .reg );
@@ -467,7 +467,7 @@ Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, tftBusWidth busWidth,
467
467
tft8.dirSet = (volatile uint8_t *)&(p->DIRSET .reg ) + offset;
468
468
tft8.dirClr = (volatile uint8_t *)&(p->DIRCLR .reg ) + offset;
469
469
#endif // end !CORE_TEENSY
470
- #else // !HAS_PORT_SET_CLR
470
+ #else // !HAS_PORT_SET_CLR
471
471
tft8.wrPort = (PORTreg_t)portOutputRegister (digitalPinToPort (wr));
472
472
tft8.wrPinMaskSet = digitalPinToBitMask (wr);
473
473
dcPort = (PORTreg_t)portOutputRegister (digitalPinToPort (dc));
@@ -616,7 +616,7 @@ void Adafruit_SPITFT::initSPI(uint32_t freq, uint8_t spiMode) {
616
616
*(volatile uint16_t *)tft8.dirSet = 0xFFFF ;
617
617
*(volatile uint16_t *)tft8.writePort = 0x0000 ;
618
618
}
619
- #else // !CORE_TEENSY
619
+ #else // !CORE_TEENSY
620
620
uint8_t portNum = g_APinDescription[tft8._d0 ].ulPort , // d0 PORT #
621
621
dBit = g_APinDescription[tft8._d0 ].ulPin , // d0 bit in PORT
622
622
lastBit = dBit + (tft8.wide ? 15 : 7 );
@@ -870,7 +870,7 @@ void Adafruit_SPITFT::initSPI(uint32_t freq, uint8_t spiMode) {
870
870
DMA_ADDRESS_INCREMENT_STEP_SIZE_1;
871
871
descriptor[d].DSTADDR .reg = (uint32_t )tft8.writePort ;
872
872
}
873
- #endif // __SAMD51
873
+ #endif // __SAMD51
874
874
} // end parallel-specific DMA setup
875
875
876
876
lastFillColor = 0x0000 ;
@@ -1216,7 +1216,7 @@ void Adafruit_SPITFT::writeColor(uint16_t color, uint32_t len) {
1216
1216
rtos_free (pixbuf);
1217
1217
return ;
1218
1218
}
1219
- #else // !ESP32
1219
+ #else // !ESP32
1220
1220
#if defined(USE_SPI_DMA) && (defined(__SAMD51__) || defined(ARDUINO_SAMD_ZERO))
1221
1221
if (((connection == TFT_HARD_SPI) || (connection == TFT_PARALLEL)) &&
1222
1222
(len >= 16 )) { // Don't bother with DMA on short pixel runs
@@ -1381,7 +1381,7 @@ void Adafruit_SPITFT::writeColor(uint16_t color, uint32_t len) {
1381
1381
SPI_SCK_LOW ();
1382
1382
x <<= 1 ;
1383
1383
}
1384
- #else // !__AVR__
1384
+ #else // !__AVR__
1385
1385
for (uint16_t bit = 0 , x = color; bit < 16 ; bit++) {
1386
1386
if (x & 0x8000 )
1387
1387
SPI_MOSI_HIGH ();
@@ -1391,9 +1391,9 @@ void Adafruit_SPITFT::writeColor(uint16_t color, uint32_t len) {
1391
1391
x <<= 1 ;
1392
1392
SPI_SCK_LOW ();
1393
1393
}
1394
- #endif // end !__AVR__
1394
+ #endif // end !__AVR__
1395
1395
}
1396
- #endif // end !ESP8266
1396
+ #endif // end !ESP8266
1397
1397
} else { // PARALLEL
1398
1398
if (hi == lo) {
1399
1399
#if defined(__AVR__)
@@ -1999,12 +1999,12 @@ uint16_t Adafruit_SPITFT::readcommand16(uint16_t addr) {
1999
1999
*(volatile uint16_t *)tft8.dirClr = 0xFFFF ; // Input state
2000
2000
result = *(volatile uint16_t *)tft8.readPort ; // 16-bit read
2001
2001
*(volatile uint16_t *)tft8.dirSet = 0xFFFF ; // Output state
2002
- #else // !HAS_PORT_SET_CLR
2003
- *(volatile uint16_t *)tft8.portDir = 0x0000 ; // Input state
2004
- result = *(volatile uint16_t *)tft8.readPort ; // 16-bit read
2005
- *(volatile uint16_t *)tft8.portDir = 0xFFFF ; // Output state
2006
- #endif // end !HAS_PORT_SET_CLR
2007
- TFT_RD_HIGH (); // Read line HIGH
2002
+ #else // !HAS_PORT_SET_CLR
2003
+ *(volatile uint16_t *)tft8.portDir = 0x0000 ; // Input state
2004
+ result = *(volatile uint16_t *)tft8.readPort ; // 16-bit read
2005
+ *(volatile uint16_t *)tft8.portDir = 0xFFFF ; // Output state
2006
+ #endif // end !HAS_PORT_SET_CLR
2007
+ TFT_RD_HIGH (); // Read line HIGH
2008
2008
endWrite ();
2009
2009
}
2010
2010
return result;
@@ -2153,31 +2153,31 @@ uint8_t Adafruit_SPITFT::spiRead(void) {
2153
2153
*tft8.portDir = 0x00 ; // Set port to input state
2154
2154
w = *tft8.readPort ; // Read value from port
2155
2155
*tft8.portDir = 0xFF ; // Restore port to output
2156
- #else // !__AVR__
2157
- if (!tft8.wide ) { // 8-bit TFT connection
2156
+ #else // !__AVR__
2157
+ if (!tft8.wide ) { // 8-bit TFT connection
2158
2158
#if defined(HAS_PORT_SET_CLR)
2159
- *tft8.dirClr = 0xFF ; // Set port to input state
2160
- w = *tft8.readPort ; // Read value from port
2161
- *tft8.dirSet = 0xFF ; // Restore port to output
2162
- #else // !HAS_PORT_SET_CLR
2163
- *tft8.portDir = 0x00 ; // Set port to input state
2164
- w = *tft8.readPort ; // Read value from port
2165
- *tft8.portDir = 0xFF ; // Restore port to output
2159
+ *tft8.dirClr = 0xFF ; // Set port to input state
2160
+ w = *tft8.readPort ; // Read value from port
2161
+ *tft8.dirSet = 0xFF ; // Restore port to output
2162
+ #else // !HAS_PORT_SET_CLR
2163
+ *tft8.portDir = 0x00 ; // Set port to input state
2164
+ w = *tft8.readPort ; // Read value from port
2165
+ *tft8.portDir = 0xFF ; // Restore port to output
2166
2166
#endif // end HAS_PORT_SET_CLR
2167
- } else { // 16-bit TFT connection
2167
+ } else { // 16-bit TFT connection
2168
2168
#if defined(HAS_PORT_SET_CLR)
2169
2169
*(volatile uint16_t *)tft8.dirClr = 0xFFFF ; // Input state
2170
2170
w = *(volatile uint16_t *)tft8.readPort ; // 16-bit read
2171
2171
*(volatile uint16_t *)tft8.dirSet = 0xFFFF ; // Output state
2172
- #else // !HAS_PORT_SET_CLR
2172
+ #else // !HAS_PORT_SET_CLR
2173
2173
*(volatile uint16_t *)tft8.portDir = 0x0000 ; // Input state
2174
2174
w = *(volatile uint16_t *)tft8.readPort ; // 16-bit read
2175
2175
*(volatile uint16_t *)tft8.portDir = 0xFFFF ; // Output state
2176
2176
#endif // end !HAS_PORT_SET_CLR
2177
2177
}
2178
- TFT_RD_HIGH (); // Read line HIGH
2178
+ TFT_RD_HIGH (); // Read line HIGH
2179
2179
#endif // end !__AVR__
2180
- #else // !USE_FAST_PINIO
2180
+ #else // !USE_FAST_PINIO
2181
2181
w = 0 ; // Parallel TFT is NOT SUPPORTED without USE_FAST_PINIO
2182
2182
#endif // end !USE_FAST_PINIO
2183
2183
}
@@ -2237,16 +2237,16 @@ uint16_t Adafruit_SPITFT::read16(void) {
2237
2237
*(volatile uint16_t *)tft8.dirClr = 0xFFFF ; // Input state
2238
2238
w = *(volatile uint16_t *)tft8.readPort ; // 16-bit read
2239
2239
*(volatile uint16_t *)tft8.dirSet = 0xFFFF ; // Output state
2240
- #else // !HAS_PORT_SET_CLR
2240
+ #else // !HAS_PORT_SET_CLR
2241
2241
*(volatile uint16_t *)tft8.portDir = 0x0000 ; // Input state
2242
2242
w = *(volatile uint16_t *)tft8.readPort ; // 16-bit read
2243
2243
*(volatile uint16_t *)tft8.portDir = 0xFFFF ; // Output state
2244
- #endif // end !HAS_PORT_SET_CLR
2244
+ #endif // end !HAS_PORT_SET_CLR
2245
2245
}
2246
2246
TFT_RD_HIGH (); // Read line HIGH
2247
- #else // !USE_FAST_PINIO
2247
+ #else // !USE_FAST_PINIO
2248
2248
w = 0 ; // Parallel TFT is NOT SUPPORTED without USE_FAST_PINIO
2249
- #endif // end !USE_FAST_PINIO
2249
+ #endif // end !USE_FAST_PINIO
2250
2250
}
2251
2251
}
2252
2252
return w;
@@ -2263,10 +2263,10 @@ inline void Adafruit_SPITFT::SPI_MOSI_HIGH(void) {
2263
2263
#else // !KINETISK
2264
2264
*swspi.mosiPortSet = swspi.mosiPinMask ;
2265
2265
#endif
2266
- #else // !HAS_PORT_SET_CLR
2266
+ #else // !HAS_PORT_SET_CLR
2267
2267
*swspi.mosiPort |= swspi.mosiPinMaskSet ;
2268
2268
#endif // end !HAS_PORT_SET_CLR
2269
- #else // !USE_FAST_PINIO
2269
+ #else // !USE_FAST_PINIO
2270
2270
digitalWrite (swspi._mosi , HIGH);
2271
2271
#if defined(ESP32)
2272
2272
for (volatile uint8_t i = 0 ; i < 1 ; i++)
@@ -2286,10 +2286,10 @@ inline void Adafruit_SPITFT::SPI_MOSI_LOW(void) {
2286
2286
#else // !KINETISK
2287
2287
*swspi.mosiPortClr = swspi.mosiPinMask ;
2288
2288
#endif
2289
- #else // !HAS_PORT_SET_CLR
2289
+ #else // !HAS_PORT_SET_CLR
2290
2290
*swspi.mosiPort &= swspi.mosiPinMaskClr ;
2291
2291
#endif // end !HAS_PORT_SET_CLR
2292
- #else // !USE_FAST_PINIO
2292
+ #else // !USE_FAST_PINIO
2293
2293
digitalWrite (swspi._mosi , LOW);
2294
2294
#if defined(ESP32)
2295
2295
for (volatile uint8_t i = 0 ; i < 1 ; i++)
@@ -2306,17 +2306,17 @@ inline void Adafruit_SPITFT::SPI_SCK_HIGH(void) {
2306
2306
#if defined(HAS_PORT_SET_CLR)
2307
2307
#if defined(KINETISK)
2308
2308
*swspi.sckPortSet = 1 ;
2309
- #else // !KINETISK
2309
+ #else // !KINETISK
2310
2310
*swspi.sckPortSet = swspi.sckPinMask ;
2311
2311
#if defined(__IMXRT1052__) || defined(__IMXRT1062__) // Teensy 4.x
2312
2312
for (volatile uint8_t i = 0 ; i < 1 ; i++)
2313
2313
;
2314
2314
#endif
2315
2315
#endif
2316
- #else // !HAS_PORT_SET_CLR
2316
+ #else // !HAS_PORT_SET_CLR
2317
2317
*swspi.sckPort |= swspi.sckPinMaskSet ;
2318
2318
#endif // end !HAS_PORT_SET_CLR
2319
- #else // !USE_FAST_PINIO
2319
+ #else // !USE_FAST_PINIO
2320
2320
digitalWrite (swspi._sck , HIGH);
2321
2321
#if defined(ESP32)
2322
2322
for (volatile uint8_t i = 0 ; i < 1 ; i++)
@@ -2333,17 +2333,17 @@ inline void Adafruit_SPITFT::SPI_SCK_LOW(void) {
2333
2333
#if defined(HAS_PORT_SET_CLR)
2334
2334
#if defined(KINETISK)
2335
2335
*swspi.sckPortClr = 1 ;
2336
- #else // !KINETISK
2336
+ #else // !KINETISK
2337
2337
*swspi.sckPortClr = swspi.sckPinMask ;
2338
2338
#if defined(__IMXRT1052__) || defined(__IMXRT1062__) // Teensy 4.x
2339
2339
for (volatile uint8_t i = 0 ; i < 1 ; i++)
2340
2340
;
2341
2341
#endif
2342
2342
#endif
2343
- #else // !HAS_PORT_SET_CLR
2343
+ #else // !HAS_PORT_SET_CLR
2344
2344
*swspi.sckPort &= swspi.sckPinMaskClr ;
2345
2345
#endif // end !HAS_PORT_SET_CLR
2346
- #else // !USE_FAST_PINIO
2346
+ #else // !USE_FAST_PINIO
2347
2347
digitalWrite (swspi._sck , LOW);
2348
2348
#if defined(ESP32)
2349
2349
for (volatile uint8_t i = 0 ; i < 1 ; i++)
@@ -2360,10 +2360,10 @@ inline bool Adafruit_SPITFT::SPI_MISO_READ(void) {
2360
2360
#if defined(USE_FAST_PINIO)
2361
2361
#if defined(KINETISK)
2362
2362
return *swspi.misoPort ;
2363
- #else // !KINETISK
2363
+ #else // !KINETISK
2364
2364
return *swspi.misoPort & swspi.misoPinMask ;
2365
2365
#endif // end !KINETISK
2366
- #else // !USE_FAST_PINIO
2366
+ #else // !USE_FAST_PINIO
2367
2367
return digitalRead (swspi._miso );
2368
2368
#endif // end !USE_FAST_PINIO
2369
2369
}
@@ -2491,15 +2491,15 @@ inline void Adafruit_SPITFT::TFT_WR_STROBE(void) {
2491
2491
#if defined(KINETISK)
2492
2492
*tft8.wrPortClr = 1 ;
2493
2493
*tft8.wrPortSet = 1 ;
2494
- #else // !KINETISK
2494
+ #else // !KINETISK
2495
2495
*tft8.wrPortClr = tft8.wrPinMask ;
2496
2496
*tft8.wrPortSet = tft8.wrPinMask ;
2497
2497
#endif // end !KINETISK
2498
- #else // !HAS_PORT_SET_CLR
2498
+ #else // !HAS_PORT_SET_CLR
2499
2499
*tft8.wrPort &= tft8.wrPinMaskClr ;
2500
2500
*tft8.wrPort |= tft8.wrPinMaskSet ;
2501
2501
#endif // end !HAS_PORT_SET_CLR
2502
- #else // !USE_FAST_PINIO
2502
+ #else // !USE_FAST_PINIO
2503
2503
digitalWrite (tft8._wr , LOW);
2504
2504
digitalWrite (tft8._wr , HIGH);
2505
2505
#endif // end !USE_FAST_PINIO
@@ -2513,10 +2513,10 @@ inline void Adafruit_SPITFT::TFT_RD_HIGH(void) {
2513
2513
#if defined(USE_FAST_PINIO)
2514
2514
#if defined(HAS_PORT_SET_CLR)
2515
2515
*tft8.rdPortSet = tft8.rdPinMask ;
2516
- #else // !HAS_PORT_SET_CLR
2516
+ #else // !HAS_PORT_SET_CLR
2517
2517
*tft8.rdPort |= tft8.rdPinMaskSet ;
2518
2518
#endif // end !HAS_PORT_SET_CLR
2519
- #else // !USE_FAST_PINIO
2519
+ #else // !USE_FAST_PINIO
2520
2520
digitalWrite (tft8._rd , HIGH);
2521
2521
#endif // end !USE_FAST_PINIO
2522
2522
}
@@ -2529,10 +2529,10 @@ inline void Adafruit_SPITFT::TFT_RD_LOW(void) {
2529
2529
#if defined(USE_FAST_PINIO)
2530
2530
#if defined(HAS_PORT_SET_CLR)
2531
2531
*tft8.rdPortClr = tft8.rdPinMask ;
2532
- #else // !HAS_PORT_SET_CLR
2532
+ #else // !HAS_PORT_SET_CLR
2533
2533
*tft8.rdPort &= tft8.rdPinMaskClr ;
2534
2534
#endif // end !HAS_PORT_SET_CLR
2535
- #else // !USE_FAST_PINIO
2535
+ #else // !USE_FAST_PINIO
2536
2536
digitalWrite (tft8._rd , LOW);
2537
2537
#endif // end !USE_FAST_PINIO
2538
2538
}
0 commit comments