I writing a program to control several pumps and monitor a switches, and my goal is twofold: first, to reduce the amount of code and second to make it easier to remember and keep track of which pin is which LED/switch.
I have two methods and can't determine which would be better in the long run, ie maintaining the code in the future.
The first is to create function blocks, such as:
void pump_on(void)
{
PORTC |= _BV(PC5);
}
The second would be a define:
#define pump_on PORTC |= _BV(PC5)
Is one preferable over the other?