Arduino Due External Interrupts

For future reference, when using global variables shared by both the ISR and main loop you should define the variable as volatile. In your example it should be:

 volatile int state = 0;

http://arduino.cc/en/Reference/Volatile

Lefty