- ao_mmc5983_done = 0;
- ao_exti_enable(AO_MMC5983_INT_PORT, AO_MMC5983_INT_PIN);
- ao_mmc5983_reg_write(MMC5983_CONTROL_0,
- (1 << MMC5983_CONTROL_0_INT_MEAS_DONE_EN) |
- (1 << MMC5983_CONTROL_0_TM_M));
- ao_arch_block_interrupts();
- while (!ao_mmc5983_done)
- if (ao_sleep_for(&ao_mmc5983_done, AO_MS_TO_TICKS(10)))
- ++ao_mmc5983_missed_irq;
- ao_arch_release_interrupts();