If I use "5==6" as the condition no error. "DetectorInterrupt==18" also cause no error. But comparing any two interrupt vectors returns "true" and the wrong branch is compiled. Why?
I found likely cause.
At time of compile of this part of code PCINT0_vect expands to __vector_2 (on Digispark) which is undefined (yet). Not even adding ISR(PCINT0_vect) makes the interrupt vector defined. So comparing any two interrupt vectors ends in expanding undefined macros (__vector_x) which is expanded to 0.
I will have to find some workaround
septillion:
But that still doesn't answer larryd's question.
I did. INT0==__vector_1==0==__vector_2==PCINT0. "Defining" the interrupt vectors by ISR() makes no difference (meaning it is not because both are undefined and point to the same "bad interrupt vector"). Also I tried to check them by #ifdef. PCINT0, INT0 are defined while __vector_1 and __vector_2 are not.
septillion:
Why are you checking two different macros? INT0_vect and PCINT0_vect
I want to use Digispark for debugging part of the code and then use it on ATTiny13A. AFAIK Digispark needs Pin Change interrupt for USB functionality so I must use External Interrupt. But I will use both PWM pins on the Tiny and so I cannot use the External interrupt (they share pin). So I wanted to define used interrupt by macro and when it matters (when setting interrupts in the code) check which one is in use.
I will probably do it this way:
Sketch uses 1694 bytes (5%) of program storage space. Maximum is 32256 bytes.
Global variables use 188 bytes (9%) of dynamic memory, leaving 1860 bytes for local variables. Maximum is 2048 bytes.