Teensy LC/Encoder library won't compile. What do I need to add to direct_pin_read.h?

Status
Not open for further replies.

howiemnet

Active member
Swapping a Teensy 3.1 for a Teensy LC in a working project, but the Encoder library won't compile, "IO_REG_TYPE doesn't name a type" etc.

Tracked it down to "utility/direct_pin_read.h" - there are different defines for different processor families, but there isn't one for the LC as far as I can see. I'm looking at this chunk:

Code:
#if defined(__AVR__) || defined(__MK20DX128__) || defined(__MK20DX256__)

#define IO_REG_TYPE			uint8_t
#define PIN_TO_BASEREG(pin)             (portInputRegister(digitalPinToPort(pin)))
#define PIN_TO_BITMASK(pin)             (digitalPinToBitMask(pin))
#define DIRECT_PIN_READ(base, mask)     (((*(base)) & (mask)) ? 1 : 0)

I'm guessing I need to add another || defined() bit to the first line for the LC, but I've no idea what the __MK20DX256__ equivalent is for the LC's processor. Any help?
 
Status
Not open for further replies.
Back
Top