]> mj.ucw.cz Git - home-hw.git/blobdiff - usb/Src/bmp085.c
BMP read after each USB update
[home-hw.git] / usb / Src / bmp085.c
index c5712c962adc4e5368839a4dd2d8e403b3591ae0..45039b7dbc7f31521218c3f4a025e243539bc88a 100644 (file)
@@ -161,6 +161,7 @@ enum bmp_state {
   BMP_PRESSURE,
 };
 
+byte bmp_request;
 static byte bmp_state = BMP_IDLE;
 static u16 raw_temp;
 static u32 raw_press;
@@ -173,6 +174,9 @@ void bmp_step(void)
   switch (bmp_state)
     {
     case BMP_IDLE:
+      if (!bmp_request)
+       return;
+      bmp_request = 0;
       bmp_debug("BMP: Start measure\n");
       bmp_start_measure(0x2e);
       bmp_state++;