I think tou need to read
You are using PORTA to read the input state (smoke) of the pin , this in not correct, the input register is PINA, PINB...
The PORTA sets the pull-up resistor when the pin is set as input.
The above article explains everything.
What is wrong with using define?
Alex
---------- Post added at 15:46 ---------- Previous post was at 15:30 ----------
Sorry , I think you are using PIC, if this is the case ignore what I wrote, they are valid for AVR mcu.
You should include in your message the mcu you are using.
Alex