If you have many inputs scattered around various ports and you want to "gather them" in one consecutive block so you can iterate over them using a loop then sure, why not. Otherwise I must say I don't see the point of doing that. You might as well simply alias the bit variable directly to the port bit/pin and be done (after all, the Port registers is just another byte in memory - right).
You'll save RAM, FLASH and processor cycles by not first copying the value of one bit variable (PortC.3) to another (Button4) only to then evaluate the state of Button4 variable.Code:Button4 VAR PortC.3
But, I might be missing the point alltogether, in which case I apologise.
/Henrik,




Bookmarks