void EXTI15_10_IRQHandler(void) { if (EXTI_GetITStatus(EXTI_Line10) == SET) { jshPushIOWatchEvent(EV_EXTI10); EXTI_ClearITPendingBit(EXTI_Line10); } if (EXTI_GetITStatus(EXTI_Line11) == SET) { jshPushIOWatchEvent(EV_EXTI11); EXTI_ClearITPendingBit(EXTI_Line11); } if (EXTI_GetITStatus(EXTI_Line12) == SET) { jshPushIOWatchEvent(EV_EXTI12); EXTI_ClearITPendingBit(EXTI_Line12); } if (EXTI_GetITStatus(EXTI_Line13) == SET) { jshPushIOWatchEvent(EV_EXTI13); EXTI_ClearITPendingBit(EXTI_Line13); } if (EXTI_GetITStatus(EXTI_Line14) == SET) { jshPushIOWatchEvent(EV_EXTI14); EXTI_ClearITPendingBit(EXTI_Line14); } if (EXTI_GetITStatus(EXTI_Line15) == SET) { jshPushIOWatchEvent(EV_EXTI15); EXTI_ClearITPendingBit(EXTI_Line15); } }
void EXTI9_5_IRQHandler(void) { if (EXTI_GetITStatus(EXTI_Line5) == SET) { jshPushIOWatchEvent(EV_EXTI5); EXTI_ClearITPendingBit(EXTI_Line5); } if (EXTI_GetITStatus(EXTI_Line6) == SET) { jshPushIOWatchEvent(EV_EXTI6); EXTI_ClearITPendingBit(EXTI_Line6); } if (EXTI_GetITStatus(EXTI_Line7) == SET) { jshPushIOWatchEvent(EV_EXTI7); EXTI_ClearITPendingBit(EXTI_Line7); } if (EXTI_GetITStatus(EXTI_Line8) == SET) { jshPushIOWatchEvent(EV_EXTI8); EXTI_ClearITPendingBit(EXTI_Line8); } if (EXTI_GetITStatus(EXTI_Line9) == SET) { jshPushIOWatchEvent(EV_EXTI9); EXTI_ClearITPendingBit(EXTI_Line9); } }
/** * Handle a GPIO interrupt. * We have arrived in this callback function because the state of a GPIO pin has changed * and it is time to record that change. */ static void CALLED_FROM_INTERRUPT intrHandlerCB( uint32 interruptMask, //!< A mask indicating which GPIOs have changed. void *arg //!< Optional argument. ) { // Given the interrupt mask, we as if bit "x" is on. If it is, then that is defined as meaning // that the state of GPIO "x" has changed so we want to raised an event that indicates that this // has happened... // Once we have handled the interrupt flags, we need to acknowledge the interrupts so // that the ESP8266 will once again cause future interrupts to be processed. //os_printf_plus(">> intrHandlerCB\n"); gpio_intr_ack(interruptMask); // We have a mask of interrupts that have happened. Go through each bit in the mask // and, if it is on, then an interrupt has occurred on the corresponding pin. int pin; for (pin=0; pin<JSH_PIN_COUNT; pin++) { if ((interruptMask & (1<<pin)) != 0) { // Pin has changed so push the event that says pin has changed. jshPushIOWatchEvent(pinToEV_EXTI(pin)); gpio_pin_intr_state_set(GPIO_ID_PIN(pin), GPIO_PIN_INTR_ANYEDGE); } } //os_printf_plus("<< intrHandlerCB\n"); }
void irqEXTI2() { jshPushIOWatchEvent(EV_EXTI2); }
void irqEXTI1() { jshPushIOWatchEvent(EV_EXTI1); }
void irqEXTI0() { jshPushIOWatchEvent(EV_EXTI0); }
void irqEXTI9() { jshPushIOWatchEvent(EV_EXTI9); }
void irqEXTI8() { jshPushIOWatchEvent(EV_EXTI8); }
void irqEXTI7() { jshPushIOWatchEvent(EV_EXTI7); }
void irqEXTI6() { jshPushIOWatchEvent(EV_EXTI6); }
void irqEXTI5() { jshPushIOWatchEvent(EV_EXTI5); }
void irqEXTI4() { jshPushIOWatchEvent(EV_EXTI4); }
void irqEXTI3() { jshPushIOWatchEvent(EV_EXTI3); }
void EXTI4_IRQHandler(void) { if (EXTI_GetITStatus(EXTI_Line4) == SET) { jshPushIOWatchEvent(EV_EXTI4); EXTI_ClearITPendingBit(EXTI_Line4); } }
static void jsvPinWatchHandler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action) { lastHandledPinState = (bool)nrf_gpio_pin_read(pin); IOEventFlags evt = jshGetEventFlagsForWatchedPin(pin); jshPushIOWatchEvent(evt); }