Subversion Repositories dashGPS

Rev

Rev 29 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 29 Rev 30
Line 193... Line 193...
193
      dial.draw_needle (dial_ang);
193
      dial.draw_needle (dial_ang);
194
 
194
 
195
      display1.gotoxy (70, 25);
195
      display1.gotoxy (70, 25);
196
      if (loc.valid == 'A')
196
      if (loc.valid == 'A')
197
        {
197
        {
-
 
198
          if (heading < 100)
-
 
199
            display1.moveby (2, 0);
-
 
200
          if (heading < 10)
-
 
201
            display1.moveby (2, 0);
-
 
202
 
198
          display1.fontDigits (large_font, 3, -1, heading);
203
          display1.fontDigits (large_font, 3, -1, heading);
199
        }
204
        }
200
      else
205
      else
201
        display1.printString (large_font, "GPS?", 4, WHITE);
206
        display1.printString (large_font, "GPS?", 4, WHITE);
202
 
207
 
Line 224... Line 229...
224
          IMU.readAcceleration (x, y, z);
229
          IMU.readAcceleration (x, y, z);
225
        }
230
        }
226
 
231
 
227
      struct bmp280_uncomp_data ucomp_data, ucomp_data2;
232
      struct bmp280_uncomp_data ucomp_data, ucomp_data2;
228
 
233
 
229
      if (HAL_GetTick () - lastTick > 100)
234
      if (HAL_GetTick () - lastTick > 200)
230
        {
235
        {
231
          lastTick = HAL_GetTick ();
236
          lastTick = HAL_GetTick ();
232
          /* Reading the raw data from sensor */
237
          /* Reading the raw data from sensor */
233
          rslt = bmp280_get_uncomp_data (&ucomp_data, bmp);
238
          rslt = bmp280_get_uncomp_data (&ucomp_data, bmp);
234
 
239
 
Line 239... Line 244...
239
            {
244
            {
240
              rslt2 = bmp280_get_comp_temp_32bit (&temp32_out,
245
              rslt2 = bmp280_get_comp_temp_32bit (&temp32_out,
241
                                                  ucomp_data2.uncomp_temp,
246
                                                  ucomp_data2.uncomp_temp,
242
                                                  bmp2);
247
                                                  bmp2);
243
            }
248
            }
-
 
249
          // if it returns 128,0,0 for both temperature and pressure at the same time,  then this ends up as the value 524288 which is broken ..
244
          else
250
          if (rslt2 != BMP280_OK
-
 
251
              || (ucomp_data2.uncomp_temp == 524288
-
 
252
                  && ucomp_data2.uncomp_press == 524288))
245
            {
253
            {
246
              /// try to reset the device, its playing up
254
              /// try to reset the device, its playing up
247
              resetBmp2 ();
255
              resetBmp2 ();
248
 
256
 
249
            }
257
            }