X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fkernel%2Fao_tracker.c;h=46278530843cf36d527297acc0b93e1be1004bdd;hb=40236913922e0395780cd7d90354546ecaf279f9;hp=962f145d39a4b0e21ae6b27017fdc1348a6b92a7;hpb=211cb482e4da04dc032432abc236ef8b5a5e732f;p=fw%2Faltos diff --git a/src/kernel/ao_tracker.c b/src/kernel/ao_tracker.c index 962f145d..46278530 100644 --- a/src/kernel/ao_tracker.c +++ b/src/kernel/ao_tracker.c @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -163,6 +164,25 @@ ao_tracker(void) } } +#ifdef AO_LED_GPS_LOCK + +static struct ao_task ao_gps_lock_task; + +static void +ao_gps_lock(void) +{ + for (;;) { + if ((gps_data.flags & (AO_GPS_VALID|AO_GPS_COURSE_VALID)) == + (AO_GPS_VALID|AO_GPS_COURSE_VALID)) + { + ao_led_for(AO_LED_GPS_LOCK, AO_MS_TO_TICKS(20)); + } + ao_delay(AO_SEC_TO_TICKS(3)); + } +} +#endif + + static uint8_t erasing_current; void @@ -221,4 +241,7 @@ ao_tracker_init(void) #endif ao_cmd_register(&ao_tracker_cmds[0]); ao_add_task(&ao_tracker_task, ao_tracker, "tracker"); +#ifdef AO_LED_GPS_LOCK + ao_add_task(&ao_gps_lock_task, ao_gps_lock, "gps lock"); +#endif }