arpruss Sun Nov 26, 2017 9:21 pm
I added a fallback to digitalRead() and digitalWrite() when the argument is not a constant of the format PXxx. This lets one just use DIGITAL_READ() and DIGITAL_WRITE() as pretty much drop-in replacements for digitalRead() and digitalWrite(), saving space and time when the argument is a constant, and being no worse (assuming gcc optimization does its job) otherwise.
arpruss Sun Nov 26, 2017 9:23 pm
[Pito – Sun Nov 26, 2017 4:16 pm] –
..trades space for speed. If you want to trade speed for space,..
How could you trade speed for size and vice versa while manipulating the pins?
The size means clocks here..
As far as I can tell, writing to (and probably reading from, but I haven’t tested this) the bitbanded memory area takes several more clock cycles than writing to ordinary memory. So you can have fewer instructions in the code, but with one of the instructions taking rather longer.