summaryrefslogtreecommitdiffstats
path: root/firmware/x300
diff options
context:
space:
mode:
authormichael-west <michael.west@ettus.com>2014-05-10 19:40:15 -0700
committerBen Hilburn <ben.hilburn@ettus.com>2014-07-17 18:16:04 -0700
commit8f6e2ac9972151318bf6883d45ee099a5013ae1e (patch)
tree7a600c625e9111387386874bc8ea9505466576d7 /firmware/x300
parent0efddecd45ff4756b046e5ebeb8626e54ffb19ff (diff)
downloaduhd-8f6e2ac9972151318bf6883d45ee099a5013ae1e.tar.gz
uhd-8f6e2ac9972151318bf6883d45ee099a5013ae1e.tar.bz2
uhd-8f6e2ac9972151318bf6883d45ee099a5013ae1e.zip
Fix for BUG #469: Bad/Empty GPS NMEA strings returned when the queries are made in a random wait iterative fashion
Fix for BUG #460: X300: GPGGA sensor most often empty, while RMC is usually OK - Added checksum verification of NMEA strings - Improved handling of short or malformed strings - Fixed GPSDO data synchronization between X300 firmware and host
Diffstat (limited to 'firmware/x300')
-rw-r--r--firmware/x300/x300/x300_main.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/firmware/x300/x300/x300_main.c b/firmware/x300/x300/x300_main.c
index d7fd32ac3..8717bf690 100644
--- a/firmware/x300/x300/x300_main.c
+++ b/firmware/x300/x300/x300_main.c
@@ -345,12 +345,12 @@ static void handle_uarts(void)
static uint32_t rxoffset = 0;
for (int rxch = wb_uart_getc(UART0_BASE); rxch != -1; rxch = wb_uart_getc(UART0_BASE))
{
- rxoffset = (rxoffset+1) % (NUM_POOL_WORDS32*4);
+ rxoffset++;
const int shift = ((rxoffset%4) * 8);
static uint32_t rxword32 = 0;
if (shift == 0) rxword32 = 0;
- rxword32 |= ((uint32_t) rxch) << ((rxoffset%4) * 8);
- rxpool[rxoffset/4] = rxword32;
+ rxword32 |= ((uint32_t) rxch & 0xFF) << shift;
+ rxpool[(rxoffset/4) % NUM_POOL_WORDS32] = rxword32;
shmem[X300_FW_SHMEM_UART_RX_INDEX] = rxoffset;
}
@@ -445,17 +445,24 @@ int main(void)
static const uint32_t tick_delta = CPU_CLOCK/1000;
if (ticks_passed > tick_delta)
{
- handle_link_state(); //deal with router table update
+// handle_link_state(); //deal with router table update
handle_claim(); //deal with the host claim register
+handle_uarts(); //udp_uart_poll();
update_leds(); //run the link and activity leds
+handle_uarts(); //udp_uart_poll();
garp(); //send periodic garps
+handle_uarts(); //udp_uart_poll();
xge_poll_sfpp_status(0); // Every so often poll XGE Phy to look for SFP+ hotplug events.
+handle_uarts(); //udp_uart_poll();
xge_poll_sfpp_status(1); // Every so often poll XGE Phy to look for SFP+ hotplug events.
+handle_uarts(); //udp_uart_poll();
last_cronjob = wb_peek32(SR_ADDR(RB0_BASE, RB_COUNTER));
}
+//handle_uarts(); //udp_uart_poll();
//run the network stack - poll and handle
u3_net_stack_handle_one();
+handle_uarts(); //udp_uart_poll();
//run the PCIe listener - poll and fwd to wishbone
forward_pcie_user_xact_to_wb();