Evaluation if conditional statement on ST Visual Developer with Cosmic for STM8
I am using STVD IDE to write code for STM8 the compiler I am using is Cosmic STM8 C compiler and the standard peripheral library provided for STM8. The problem I have is while evaluating and if statement for and input pin, if the condition is "== 0" or "== RESET" like the below code the code behaves properly, and the condition is evaluated successfully.
```
if(GPIO_ReadInputPin(GPIOC,GPIO_PIN_2) == RESET)
if(GPIO_ReadInputPin(GPIOC,GPIO_PIN_2) == 0)
```
But when evaluation the if statement with "== 1" or "== SET" as shown below the condition is never met despite measuring high (3.3V) on the actual input itself
```
if(GPIO_ReadInputPin(GPIOC,GPIO_PIN_2) == SET)
if(GPIO_ReadInputPin(GPIOC,GPIO_PIN_2) == 1)
```
I managed to make a workaround that by making the condition "!= 0" or "!= RESET" as shown below it is evaluated successfully and the code behaves properly, but I don't really understand why it works with "!= 0" or "!= and not with "== 0" or "== RESET", does it has anything to do with the compiler?
```
if(GPIO_ReadInputPin(GPIOC,GPIO_PIN_2) != RESET)
if(GPIO_ReadInputPin(GPIOC,GPIO_PIN_2) != 0)
```
