To define macro to set and clear the pin
HI, I am using Macro to set and clear my pin using stm32f103. This is the macro i defined
#define SET(PIN,N) (PIN |= (1<<N))
#define CLR(PIN,N) (PIN &= ~(1<<N))
where ,
- PIN is the value whose bit to set or/and clear
- N is the bit number to set or/and clear
i have done the code like,
if(Drive _Enabled==1)
{
Status _Register[2] = SET(1,0);
}
//Status _Register[2] = CLR(1,0);
if(drive_ motion _complete==1) //to read whether motion is complete or not
{
Status _Register[2] = SET(1,1);
}
but i am getting error can anyone help me how to solve this error and what i need to add to my code please.
i have attached the picture showing the error below.
