mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-28 07:28:13 +08:00
commit
3801e1eade
@ -173,3 +173,13 @@ static inline int uart_read_ready(UART0_Type *uart) {
|
|||||||
static inline uint8_t uart_read_byte(UART0_Type *uart) {
|
static inline uint8_t uart_read_byte(UART0_Type *uart) {
|
||||||
return (uint8_t) (uart->DR & 0xFF);
|
return (uint8_t) (uart->DR & 0xFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Helper macro for reading pre-flashed MAC from user registers
|
||||||
|
#define READ_PREFLASHED_MAC() \
|
||||||
|
{ \
|
||||||
|
(FLASH_CTRL->USERREG0 >> 0) & 0xFF, (FLASH_CTRL->USERREG0 >> 8) & 0xFF, \
|
||||||
|
(FLASH_CTRL->USERREG0 >> 16) & 0xFF, \
|
||||||
|
(FLASH_CTRL->USERREG1 >> 0) & 0xFF, \
|
||||||
|
(FLASH_CTRL->USERREG1 >> 8) & 0xFF, \
|
||||||
|
(FLASH_CTRL->USERREG1 >> 16) & 0xFF \
|
||||||
|
}
|
||||||
|
@ -72,7 +72,7 @@ int main(void) {
|
|||||||
struct mg_tcpip_driver_tm4c_data driver_data = {.mdc_cr =
|
struct mg_tcpip_driver_tm4c_data driver_data = {.mdc_cr =
|
||||||
1}; // See driver_tm4c.h
|
1}; // See driver_tm4c.h
|
||||||
struct mg_tcpip_if mif = {
|
struct mg_tcpip_if mif = {
|
||||||
.mac = {2, 0, 1, 2, 3, 5},
|
.mac = READ_PREFLASHED_MAC(),
|
||||||
.driver = &mg_tcpip_driver_tm4c,
|
.driver = &mg_tcpip_driver_tm4c,
|
||||||
.driver_data = &driver_data,
|
.driver_data = &driver_data,
|
||||||
};
|
};
|
||||||
|
@ -173,3 +173,13 @@ static inline int uart_read_ready(UART0_Type *uart) {
|
|||||||
static inline uint8_t uart_read_byte(UART0_Type *uart) {
|
static inline uint8_t uart_read_byte(UART0_Type *uart) {
|
||||||
return (uint8_t) (uart->DR & 0xFF);
|
return (uint8_t) (uart->DR & 0xFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Helper macro for reading pre-flashed MAC from user registers
|
||||||
|
#define READ_PREFLASHED_MAC() \
|
||||||
|
{ \
|
||||||
|
(FLASH_CTRL->USERREG0 >> 0) & 0xFF, (FLASH_CTRL->USERREG0 >> 8) & 0xFF, \
|
||||||
|
(FLASH_CTRL->USERREG0 >> 16) & 0xFF, \
|
||||||
|
(FLASH_CTRL->USERREG1 >> 0) & 0xFF, \
|
||||||
|
(FLASH_CTRL->USERREG1 >> 8) & 0xFF, \
|
||||||
|
(FLASH_CTRL->USERREG1 >> 16) & 0xFF \
|
||||||
|
}
|
||||||
|
@ -57,7 +57,7 @@ static void server(void *args) {
|
|||||||
ethernet_init();
|
ethernet_init();
|
||||||
struct mg_tcpip_driver_tm4c_data driver_data = {.mdc_cr = 1};
|
struct mg_tcpip_driver_tm4c_data driver_data = {.mdc_cr = 1};
|
||||||
struct mg_tcpip_if mif = {
|
struct mg_tcpip_if mif = {
|
||||||
.mac = {2, 0, 1, 2, 3, 5},
|
.mac = READ_PREFLASHED_MAC(),
|
||||||
.driver = &mg_tcpip_driver_tm4c,
|
.driver = &mg_tcpip_driver_tm4c,
|
||||||
.driver_data = &driver_data,
|
.driver_data = &driver_data,
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user