static void nap_exti_thread(void *arg) { (void)arg; chRegSetThreadName("NAP ISR"); while (TRUE) { /* Waiting for the IRQ to happen.*/ chBSemWaitTimeout(&nap_exti_sem, MS2ST(PROCESS_PERIOD_ms)); handle_nap_exti(); tracking_channels_process(); } }
static void nap_exti_thread(void *arg) { (void)arg; chRegSetThreadName("NAP ISR"); while (TRUE) { /* Waiting for the IRQ to happen.*/ chBSemWaitTimeout(&nap_exti_sem, MS2ST(PROCESS_PERIOD_ms)); /* We need a level (not edge) sensitive interrupt - * if there is another interrupt pending on the Swift * NAP then the IRQ line will stay high. Therefore if * the line is still high, don't suspend the thread. */ spi_lock(SPI_SLAVE_FPGA); while (palReadLine(LINE_NAP_IRQ)) { handle_nap_exti(); } tracking_channels_process(); spi_unlock(SPI_SLAVE_FPGA); } }