Why are PINBemulation and PINCemulation in avr_emulation.h reading the same ports?

Status
Not open for further replies.

alpage

Member
Both class PINCemulation and class PINBEmulation contain identical code that access digitalReadFast(8) through digitalReadFast(13)

inline int operator & (int val) const __attribute__((always_inline)) {
int ret = 0;
if ((val & (1<<0)) && digitalReadFast(8)) ret |= (1<<0);
if ((val & (1<<1)) && digitalReadFast(9)) ret |= (1<<1);
if ((val & (1<<2)) && digitalReadFast(10)) ret |= (1<<2);
if ((val & (1<<3)) && digitalReadFast(11)) ret |= (1<<3);
if ((val & (1<<4)) && digitalReadFast(12)) ret |= (1<<4);
if ((val & (1<<5)) && digitalReadFast(13)) ret |= (1<<5);
return ret;
}

But the DDRB emulation works with CORE_PIN8 through CORE_PIN 13 and DDRC emulation works with CORE_PIN14 through CORE_PIN19

What am I missing here?
 
Status
Not open for further replies.
Back
Top