Beispiel #1
0
  public static void gps_init() {
    gps.fix = GPS_FIX_NONE;
    gps.week = 0;
    gps.tow = 0;
    gps.cacc = 0;

    gps.last_3dfix_ticks = 0;
    gps.last_3dfix_time = 0;
    gps.last_msg_ticks = 0;
    gps.last_msg_time = 0;

    //		#ifdef GPS_POWER_GPIO
    //		  gpio_setup_output(GPS_POWER_GPIO);
    //		  GPS_POWER_GPIO_ON(GPS_POWER_GPIO);
    //		#endif
    //		#ifdef GPS_LED
    //		  LED_OFF(GPS_LED);
    //		#endif
    //		#ifdef GPS_TYPE_H
    gps_impl_init();
    //		#endif
    //
    //		#if PERIODIC_TELEMETRY
    //		  register_periodic_telemetry(DefaultPeriodic, "GPS", send_gps);
    //		  register_periodic_telemetry(DefaultPeriodic, "GPS_INT", send_gps_int);
    //		  register_periodic_telemetry(DefaultPeriodic, "GPS_LLA", send_gps_lla);
    //		  register_periodic_telemetry(DefaultPeriodic, "GPS_SOL", send_gps_sol);
    //		#endif
  }
Beispiel #2
0
 public static void gps_periodic_check() {
   // TODO sys_time.nb_sec -> System.nanoTime()
   if (System.nanoTime() - gps.last_msg_time > GPS_TIMEOUT) {
     gps.fix = GPS_FIX_NONE;
   }
 }