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

Commit

Permalink
Tracking bug is still present (I think?) but is being a total PITA, t…
Browse files Browse the repository at this point in the history
…hese changes are related to playing with that.
  • Loading branch information
fnoble committed Feb 1, 2012
1 parent b0f3a65 commit de4eabe
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
11 changes: 9 additions & 2 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ int main(void)

debug_setup();

/*while(1) {*/
/*printf("Foo\n");*/
/*for (u32 i = 0; i < 300000; i++)*/
/*__asm__("nop");*/
/*}*/

printf("\n\n# Firmware info - git: " GIT_VERSION ", built: " __DATE__ " " __TIME__ "\n");

swift_nap_setup();
Expand All @@ -103,7 +109,7 @@ int main(void)

led_toggle(LED_RED);

u8 prn = 32-1;
u8 prn = 20-1;

/* Initial coarse acq. */
float coarse_acq_code_phase;
Expand Down Expand Up @@ -156,7 +162,8 @@ int main(void)
for (u32 i = 0; i < 600000; i++)
__asm__("nop");

printf("%.2f\n", tracking_channel_snr(0));
/*printf("%.2f\n", tracking_channel_snr(0));*/
printf("Foo\n");
/*printf("%.2f\n", tracking_channel[0].carrier_freq);*/
/*printf(" (%d, %d),\n", (unsigned int)tracking_channel[0].cs[0].I, (unsigned int)tracking_channel[0].cs[0].Q);*/
}
Expand Down
6 changes: 6 additions & 0 deletions src/swift_nap_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,12 @@ void track_write_update_blocking(u8 channel, s32 carrier_freq, u32 code_phase_ra
temp[4] = (carrier_freq >> 8);
temp[5] = carrier_freq;

/*printf("%d, %d", (int)carrier_freq, (unsigned int)code_phase_rate);*/
/*printf("0x");*/
/*for(u8 i=0; i<6; i++)*/
/*printf("%02X", temp[i]);*/
/*printf("\n");*/

swift_nap_xfer_blocking(SPI_ID_TRACK_BASE + channel*TRACK_SIZE + TRACK_UPDATE_OFFSET, 6, 0, temp);
}

Expand Down
10 changes: 5 additions & 5 deletions src/track.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,19 @@ void tracking_channel_init(u8 channel, u8 prn, float code_phase, float carrier_f

void tracking_channel_get_corrs(u8 channel)
{
corr_t cs[3];
cs[0].I=0;
/*corr_t cs[3];*/
/*cs[0].I=0;*/
tracking_channel_t* chan = &tracking_channel[channel];

switch(chan->state)
{
case TRACKING_FIRST_LOOP: {
/* First set of correlations are junk so do one open loop update. */
/*tracking_channel_update(channel);*/
//track_read_corr_blocking(channel, cs);
//track_read_corr_blocking(channel, chan->cs);
/*track_read_corr_blocking(channel, cs);*/
track_read_corr_blocking(channel, chan->cs);

//memcpy(chan->cs,cs,sizeof(cs));
/*memcpy(chan->cs,cs,sizeof(cs));*/

/*printf("%d,%d %d,%d %d,%d\n", (int)chan->cs[0].I, (int)chan->cs[0].Q, (int)chan->cs[1].I, (int)chan->cs[1].Q, (int)chan->cs[2].I, (int)chan->cs[2].Q);*/
break;
Expand Down

0 comments on commit de4eabe

Please sign in to comment.