mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
Make dhcp client implementation available
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include "rtl837x_port.h"
|
||||
#include "rtl837x_stp.h"
|
||||
#include "rtl837x_igmp.h"
|
||||
#include "dhcp.h"
|
||||
#include "cmd_parser.h"
|
||||
#include "uip/uipopt.h"
|
||||
#include "uip/uip.h"
|
||||
@@ -80,6 +81,7 @@ volatile __xdata uint32_t ticks;
|
||||
volatile __xdata uint8_t sec_counter;
|
||||
volatile __xdata uint16_t sleep_ticks;
|
||||
__xdata uint8_t stp_clock;
|
||||
extern __xdata struct dhcp_state dhcp_state;
|
||||
|
||||
#define STP_TICK_DIVIDER 3
|
||||
|
||||
@@ -926,6 +928,10 @@ void handle_rx(void)
|
||||
uip_arp_out();
|
||||
tcpip_output();
|
||||
}
|
||||
} else {
|
||||
#ifdef RXTXDBG
|
||||
print_string("Unknown RX on port "); print_byte(rx_headers[3] & 0xf); write_char('\n');
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -943,6 +949,13 @@ void handle_tx(void)
|
||||
tcpip_output();
|
||||
}
|
||||
}
|
||||
for(uint8_t i = 0; i < UIP_UDP_CONNS; i++) {
|
||||
uip_udp_periodic(i);
|
||||
if(uip_len > 0) {
|
||||
uip_arp_out();
|
||||
tcpip_output();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1755,6 +1768,7 @@ void bootloader(void)
|
||||
{
|
||||
ticks = 0;
|
||||
stp_clock = STP_TICK_DIVIDER;
|
||||
dhcp_state.state = DHCP_OFF;
|
||||
sbuf_ptr = 0;
|
||||
|
||||
CKCON = 0; // Initial Clock configuration
|
||||
|
||||
Reference in New Issue
Block a user