Merge pull request #96 from KurtE/t4x_neutered

T4.x - Software SPI - don't use FAST_PINIO
This commit is contained in:
Limor "Ladyada" Fried 2022-05-02 18:29:41 -04:00 committed by GitHub
commit 02665fd93f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 1 deletions

View File

@ -39,7 +39,19 @@ typedef enum _BitOrder {
typedef BitOrder BusIOBitOrder; typedef BitOrder BusIOBitOrder;
#endif #endif
#if defined(__AVR__) || defined(TEENSYDUINO) #if defined(__IMXRT1062__) // Teensy 4.x
// *Warning* I disabled the usage of FAST_PINIO as the set/clear operations
// used in the cpp file are not atomic and can effect multiple IO pins
// and if an interrupt happens in between the time the code reads the register
// and writes out the updated value, that changes one or more other IO pins
// on that same IO port, those change will be clobbered when the updated
// values are written back. A fast version can be implemented that uses the
// ports set and clear registers which are atomic.
// typedef volatile uint32_t BusIO_PortReg;
// typedef uint32_t BusIO_PortMask;
//#define BUSIO_USE_FAST_PINIO
#elif defined(__AVR__) || defined(TEENSYDUINO)
typedef volatile uint8_t BusIO_PortReg; typedef volatile uint8_t BusIO_PortReg;
typedef uint8_t BusIO_PortMask; typedef uint8_t BusIO_PortMask;
#define BUSIO_USE_FAST_PINIO #define BUSIO_USE_FAST_PINIO