Skip to content
This repository has been archived by the owner on Apr 13, 2021. It is now read-only.

Commit

Permalink
Merge pull request #624 from jacobmcnamee/track
Browse files Browse the repository at this point in the history
Tracking channel refactor, specialize by code type
  • Loading branch information
jacobmcnamee committed Mar 11, 2016
2 parents 031af6f + 139296d commit 84e74b5
Show file tree
Hide file tree
Showing 19 changed files with 2,304 additions and 933 deletions.
3 changes: 3 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ CSRC := $(PORTSRC) \
$(SWIFTNAV_ROOT)/src/sbp_utils.o \
$(SWIFTNAV_ROOT)/src/error.o \
$(SWIFTNAV_ROOT)/src/track.o \
$(SWIFTNAV_ROOT)/src/track_internal.o \
$(SWIFTNAV_ROOT)/src/track_api.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
17 changes: 1 addition & 16 deletions src/board/nap/nap_exti.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,22 +106,7 @@ static void handle_nap_exti(void)

/* Mask off everything but tracking irqs. */
irq &= NAP_IRQ_TRACK_MASK;

/* Loop over tracking irq bit flags. */
for (u8 n = 0; n < nap_track_n_channels; n++) {
/* Save a bit of time by seeing if the rest of the bits
* are zero in one go so we don't have to loop over all
* of them.
*/
if (!(irq >> n))
break;

/* Test if the nth tracking irq flag is set, if so service it. */
if ((irq >> n) & 1) {
tracking_channel_get_corrs(n);
tracking_channel_update(n);
}
}
tracking_channels_update(irq);

watchdog_notify(WD_NOTIFY_NAP_ISR);
nap_exti_count++;
Expand Down
7 changes: 2 additions & 5 deletions src/decode_gps_l1.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,8 @@ static void decoder_gps_l1_process(const decoder_channel_info_t *channel_info,
}
}

/* Check if there is a new nav msg subframe to process.
* TODO: move this into a function */
tracking_channel_t *ch = &tracking_channel[channel_info->tracking_channel];
if ((ch->state != TRACKING_RUNNING) ||
!subframe_ready(&data->nav_msg))
/* Check if there is a new nav msg subframe to process. */
if (!subframe_ready(&data->nav_msg))
return;

/* Decode ephemeris to temporary struct */
Expand Down
6 changes: 4 additions & 2 deletions 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 @@ -178,15 +179,16 @@ int main(void)
static s32 serial_number;
serial_number = nap_conf_rd_serial_number();

rng_setup();
max2769_setup();
timing_setup();
ext_event_setup();
position_setup();
tracking_setup();
track_setup();
track_gps_l1ca_register();
decode_setup();
decode_gps_l1_register();

rng_setup();
manage_acq_setup();
manage_track_setup();
system_monitor_setup();
Expand Down

0 comments on commit 84e74b5

Please sign in to comment.