kopia lustrzana https://github.com/bristol-seds/pico-tracker
[New Feature] LED indicates position lock
Signed-off-by: Richard Eoin Meadows <richardeoin@gmail.com>rocketry
rodzic
64e7847459
commit
a5389fbb99
|
@ -40,6 +40,8 @@ struct ubx_nav_posllh gps_get_nav_posllh();
|
|||
struct ubx_nav_sol gps_get_nav_sol();
|
||||
struct ubx_nav_timeutc gps_get_nav_timeutc();
|
||||
|
||||
uint8_t gps_is_locked(void);
|
||||
|
||||
void gps_init(void);
|
||||
void usart_loopback_test(void);
|
||||
|
||||
|
|
|
@ -315,6 +315,15 @@ struct ubx_nav_timeutc gps_get_nav_timeutc()
|
|||
{
|
||||
return ubx_nav_timeutc;
|
||||
}
|
||||
/**
|
||||
* Returns if the GPS has a position lock
|
||||
*/
|
||||
uint8_t gps_is_locked(void)
|
||||
{
|
||||
return (ubx_nav_sol.payload.gpsFix == 0x2) ||
|
||||
(ubx_nav_sol.payload.gpsFix == 0x3) ||
|
||||
(ubx_nav_sol.payload.gpsFix == 0x4);
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify that the uBlox 6 GPS receiver is set to the <1g airborne
|
||||
|
|
|
@ -236,11 +236,19 @@ int main(void)
|
|||
|
||||
gps_update(); /* Request updates from the gps */
|
||||
|
||||
led_on();
|
||||
if (gps_is_locked()) {
|
||||
led_on();
|
||||
} else {
|
||||
led_off();
|
||||
}
|
||||
|
||||
gps_update_wait(); /* Wait for the gps update */
|
||||
|
||||
led_off();
|
||||
if (gps_is_locked()) {
|
||||
led_off();
|
||||
} else {
|
||||
led_on();
|
||||
}
|
||||
|
||||
/* Set the next packet */
|
||||
set_telemetry_string();
|
||||
|
|
Ładowanie…
Reference in New Issue