C error : lvalue required as left operand of assignment

I’m getting an error on this line !!! and I guess that my code is correct !
#define GPIO_SET_INPUT(PORT_BASE, PIN_MASK) \
do { REG((PORT_BASE) + GPIO_DIR) &= ~(PIN_MASK); } while(0)
PS: I’m compiling using avr-gcc Thank you in advance.

Add Comment
1 Answer(s)
Best answer
The REG macro was missing in cpu/avr on contikios, I defined it now as :
#define REG(x)         (*((volatile unsigned long *)(x)))

the error is resolved.

Beginner Answered on March 15, 2018.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.