//From Arduino.hextern const uint16_t PROGMEM port_to_mode_PGM;extern const uint16_t PROGMEM port_to_input_PGM;extern const uint16_t PROGMEM port_to_output_PGM;extern const uint8_t PROGMEM digital_pin_to_port_PGM;
Does the MEGA 1280, MEGA 2560, MEGA ADK have the same port register layouts? and the same question for the Uno revisions.
Also does anybody know how much EEPROM is taken up by the core?
I want to try and create a more efficient set of functions replicating the 'pinMode', 'digitalRead', 'digitalWrite', etc...This will allow me to at least remove some arrays listed below and remove the PROGMEM access overhead.
#define digitalPinToPort(P) ( pgm_read_byte( digital_pin_to_port_PGM + (P) ) )#define digitalPinToBitMask(P) ( pgm_read_byte( digital_pin_to_bit_mask_PGM + (P) ) )#define digitalPinToTimer(P) ( pgm_read_byte( digital_pin_to_timer_PGM + (P) ) )
Thanks for the reply, I am still learning about arduino, but as these macros below are used by 'pinMode' and stuff, does this not mean the use EEPROM?
Also those arrays I posted above use the PROGMEM keyword.
The digitalWriteFast looks great, in fact it was a really great read. I need to test it and see how much runtime code is generated to do its final port manipulation.
My plans will hopefully shave a few more instructions off into compile time. But it may have already knocked these ideas on their head.
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16