- uint8_t addr, data;
- struct ao_hmc5883_sample sample;
-
- if (!ao_hmc5883_setup()) {
- printf("hmc5883 not present\n");
- return;
- }
-#if 0
- for (addr = 0; addr <= 12; addr++) {
- ao_hmc5883_read(addr, &data, 1);
- printf ("hmc5883 register %2d: %02x\n",
- addr, data);
+ struct ao_hmc5883_sample sample;
+ ao_hmc5883_setup();
+ for (;;) {
+ ao_hmc5883_sample(&sample);
+ ao_arch_block_interrupts();
+ ao_hmc5883_current = sample;
+ AO_DATA_PRESENT(AO_DATA_HMC5883);
+ AO_DATA_WAIT();
+ ao_arch_release_interrupts();