I'd like to simplify code that I'm working on by using bit manipulation macros similar to:
#define BIT_MACRO PORTD |= (1 << 5)
However, I'd like to combine multiple bit manipulations into a single macro:
#define MULTIBIT_MACRO PORTD |= (1 << 5) && PORTB |= (1 << 2)
From there I'd like to use the Macro in a statement such as:
void Function(void) { // Turn on multiple bits at once MULTIBIT_MACRO; }
Is this possible?
Thanks,
Ben