diff options
Diffstat (limited to 'firmware/x300')
-rw-r--r-- | firmware/x300/x300/x300_main.c | 15 |
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(); |