maniacbug/mighty-1284p

digitalPinToPCMSK errors

Opened this issue · 2 comments

It seems to me that the digitalPinToPCMSK macro in all Mighty 1284P variants have never been used, let alone been tested.

The bobuino version will probably give a compilation failure if you would try to use it.
#define digitalPinToPCMSK(p) ifpin(p,__pcmsk[digital_pin_to_pcint[]],(uint8_t *)0)
There is a p missing.

The standard and avr_developers variants will return an incorrect PCMSKx. The macro expansion should match digitalPinToPCMSK right above it. I think that this is what is should be:

#define digitalPinToPCICRbit(p) (((p) <= 7) ? 1 : (((p) <= 15) ? 3 : (((p) <= 23) ? 2 : 0)))
#define digitalPinToPCMSK(p) (((p) <= 7) ? (&PCMSK1) : (((p) <= 15) ? (&PCMSK3) : (((p) <= 23) ? (&PCMSK2) : (&PCMSK0))))

I will test it since i having problems to get the bobuino to work with the CC3000 wifi shield and this might be the cause.

@avandun I apologize if this is not an appropriate comment for the repository, but have you considered WildFire (wildfire.wickeddevice.com) which is a Mega1284P integrated with a CC3000 on one board?