Skip to content
Snippets Groups Projects
Commit 14834a47 authored by Wesley W. Terpstra's avatar Wesley W. Terpstra
Browse files

Fix two latent bugs reading undefined register bits.

parent cac1837b
Branches
Tags
No related merge requests found
......@@ -250,7 +250,7 @@ int minic_rx_frame(uint8_t *hdr, uint8_t *payload, uint32_t buf_size, struct hw_
minic_rxbuf_free(num_words);
minic.rx_head = (uint32_t *)((uint32_t)minic.rx_base + ((uint32_t)minic.rx_head+(num_words<<2) - (uint32_t)minic.rx_base) % (minic.rx_size<<2));
cur_avail = minic_readl(MINIC_REG_RX_AVAIL);
cur_avail = minic_readl(MINIC_REG_RX_AVAIL) & 0xFFFFFF; /* 24-bit field */
/*empty buffer->no more received packets, or packet reception in progress but not done*/
if( !RX_DESC_VALID(*minic.rx_head))
......
......@@ -92,7 +92,7 @@ void pps_gen_get_time(uint64_t *seconds, uint32_t *nanoseconds)
do {
sec1 = pps_get_utc();
ns_cnt = ppsg_read(CNTR_NSEC);
ns_cnt = ppsg_read(CNTR_NSEC) & 0xFFFFFFFUL; /* 28-bit wide register */
sec2 = pps_get_utc();
} while(sec2 != sec1);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment