int registerInterruptHandler(void* InterruptHdl , void* pValue) { delay(100); DEBUG_TRACE("INTERRUPT REGISTER"); // //the IRQ line may already be high //in this case, manually call the interrupt first // if (digitalRead(WiFiClass::pin_irq) && InterruptHdl != NULL) { void (*interruptFunction)(void) = (void (*)())InterruptHdl; interruptFunction(); } if (InterruptHdl == NULL) { // //according to documentation, a NULL pointer means remove the interrupt // detachInterrupt(WiFiClass::pin_irq); } else { // //Register the IRQ interrupt handler // attachInterrupt(WiFiClass::pin_irq, (void (*)())InterruptHdl, RISING); } delay(100); return 0; }
//-------------------------------------------------------------- void Wait::resetFunction(Command* command) { interruptFunction(command); }