Skip to content

Commit

Permalink
WIP specialize tracking channels per code type
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobmcnamee committed Mar 3, 2016
1 parent 9fe2e8c commit 53f4e76
Show file tree
Hide file tree
Showing 7 changed files with 1,401 additions and 816 deletions.
1 change: 1 addition & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ CSRC := $(PORTSRC) \
$(SWIFTNAV_ROOT)/src/sbp_utils.o \
$(SWIFTNAV_ROOT)/src/error.o \
$(SWIFTNAV_ROOT)/src/track.o \
$(SWIFTNAV_ROOT)/src/track_gps_l1ca.o \
$(SWIFTNAV_ROOT)/src/acq.o \
$(SWIFTNAV_ROOT)/src/manage.o \
$(SWIFTNAV_ROOT)/src/settings.o \
Expand Down
4 changes: 3 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "init.h"
#include "manage.h"
#include "track.h"
#include "track_gps_l1ca.h"
#include "timing.h"
#include "ext_events.h"
#include "solution.h"
Expand Down Expand Up @@ -183,7 +184,8 @@ int main(void)
timing_setup();
ext_event_setup();
position_setup();
tracking_setup();
track_setup();
track_gps_l1ca_register();
decode_setup();
decode_gps_l1_register();

Expand Down
12 changes: 5 additions & 7 deletions src/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,8 @@ static void manage_acq()
track_count += 16*(1023.0-cp)*(1.0 + cf / GPS_L1_HZ);

/* Start the tracking channel */
tracking_channel_init(chan, acq->sid, cf, track_count, cn0,
TRACKING_ELEVATION_UNKNOWN);
tracker_channel_init(chan, acq->sid, cf, track_count, cn0,
TRACKING_ELEVATION_UNKNOWN);
/* TODO: Initialize elevation from ephemeris if we know it precisely */

/* Start the decoder channel */
Expand All @@ -415,7 +415,7 @@ static u8 manage_track_new_acq(gnss_signal_t sid)
* a newly acquired satellite into.
*/
for (u8 i=0; i<nap_track_n_channels; i++) {
if (tracking_channel_available(i, sid) &&
if (tracker_channel_available(i, sid) &&
decoder_channel_available(i, sid)) {
return i;
}
Expand Down Expand Up @@ -489,7 +489,7 @@ static void drop_channel(u8 channel_id) {

/* Finally disable the decoder and tracking channels */
decoder_channel_disable(channel_id);
tracking_channel_disable(channel_id);
tracker_channel_disable(channel_id);
}

/** Disable any tracking channel that has lost phase lock or is
Expand Down Expand Up @@ -587,9 +587,7 @@ s8 use_tracking_channel(u8 i)
/* Channel time of week has been decoded. */
&& (tracking_channel_tow_ms_get(i) != TOW_INVALID)
/* Nav bit polarity is known, i.e. half-cycles have been resolved. */
&& tracking_channel_bit_polarity_resolved(i)
/* Estimated C/N0 is above some threshold */
&& tracking_channel_cn0_useable(i))
&& tracking_channel_bit_polarity_resolved(i))
/* TODO: Alert flag is not set */
{
/* Ephemeris must be valid, not stale. Satellite must be healthy.
Expand Down
Loading

0 comments on commit 53f4e76

Please sign in to comment.