mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-01 13:10:43 +00:00
Move mip/ -> src/tcpip/, rename mip_ -> mg_tcpip_
This commit is contained in:
1 parent
efc54375dd
commit
2c62e58dbd
64 files changed
+515
-516
No files matched your search
@@ -4,7 +4,7 @@ CFLAGS ?= -W -Wall -Wextra -Werror -Wundef -Wshadow -Wdouble-promotion \
|
||||
-Wformat-truncation -fno-common -Wconversion \
|
||||
-g3 -Os -ffunction-sections -fdata-sections -I. -I$(ROOT) \
|
||||
-DMG_ARCH=MG_ARCH_NEWLIB -DMIP_DEBUG=1 -DMG_ENABLE_PACKED_FS=1 \
|
||||
-DMG_ENABLE_CUSTOM_MILLIS=1 -DxMG_ENABLE_LINES=1 -DMG_ENABLE_MIP=1 -DMG_ENABLE_DRIVER_TM4C=1\
|
||||
-DMG_ENABLE_CUSTOM_MILLIS=1 -DxMG_ENABLE_LINES=1 -DMG_ENABLE_TCPIP=1 -DMG_ENABLE_DRIVER_TM4C=1\
|
||||
-mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 $(EXTRA_CFLAGS)
|
||||
LDFLAGS ?= -Tlink.ld -nostartfiles -nostdlib --specs nano.specs -lc -lgcc -Wl,--gc-sections -Wl,-Map=$@.map
|
||||
SOURCES = boot.c main.c syscalls.c \
|
||||
|
||||
@@ -10,7 +10,7 @@ which implements the following:
|
||||
- MQTT communication with a remote MQTT server
|
||||
- No dependencies: no HAL, no CMSIS, no RTOS
|
||||
- Hand-written [mcu.h](mcu.h) header based on the [datasheet](https://www.ti.com/lit/pdf/spms433)
|
||||
- Interrupt-driven [Ethernet driver](../../../drivers/mip_driver_tm4c.c)
|
||||
- Interrupt-driven Ethernet driver
|
||||
- LED blinky, based on SysTick interrupt
|
||||
- User button handler, turns off/on an LED, based on GPIO IRQs (interrupt-driven)
|
||||
- HardFault handler alternate blinks LEDs
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
static uint64_t s_ticks, s_exti; // Counters, increased by IRQ handlers
|
||||
|
||||
static void blink_cb(void *arg) { // Blink periodically
|
||||
struct mip_if *ifp = arg;
|
||||
struct mg_tcpip_if *ifp = arg;
|
||||
gpio_toggle(LED1);
|
||||
MG_INFO(("Ethernet: %s", ifp->driver->up(ifp) ? "up": "down"));
|
||||
}
|
||||
@@ -86,13 +86,13 @@ int main(void) {
|
||||
// Initialize Mongoose network stack
|
||||
// Specify MAC address, and IP/mask/GW in network byte order for static
|
||||
// IP configuration. If IP/mask/GW are unset, DHCP is going to be used
|
||||
struct mip_driver_tm4c_data driver_data = {.mdc_cr = 1}; // See driver_tm4c.h
|
||||
struct mip_if mif = {
|
||||
struct mg_tcpip_driver_tm4c_data driver_data = {.mdc_cr = 1}; // See driver_tm4c.h
|
||||
struct mg_tcpip_if mif = {
|
||||
.mac = {2, 0, 1, 2, 3, 5},
|
||||
.driver = &mip_driver_tm4c,
|
||||
.driver = &mg_tcpip_driver_tm4c,
|
||||
.driver_data = &driver_data,
|
||||
};
|
||||
mip_init(&mgr, &mif);
|
||||
mg_tcpip_init(&mgr, &mif);
|
||||
val = IMC[0xFC8 / sizeof(*IMC)]; // Turn Flash Prefetch on again
|
||||
val &= ~BIT(16);
|
||||
val |= BIT(17);
|
||||
|
||||
@@ -6,7 +6,7 @@ It implements the following:
|
||||
- Minimal elementary web server, as simple as possible
|
||||
- No dependencies: no HAL, no CMSIS
|
||||
- Hand-written [mcu.h](mcu.h) header based on the [datasheet](https://www.ti.com/lit/pdf/spms433)
|
||||
- Interrupt-driven [Ethernet driver](../../../drivers/mip_driver_tm4c.c)
|
||||
- Interrupt-driven Ethernet driver
|
||||
- LED blinky, based on another FreeRTOS task
|
||||
- Debug log on UART0 (ICDI)
|
||||
|
||||
|
||||
@@ -60,13 +60,13 @@ static void server(void *args) {
|
||||
// IP configuration. If IP/mask/GW are unset, DHCP is going to be used
|
||||
MG_INFO(("Initializing Ethernet driver"));
|
||||
ethernet_init();
|
||||
struct mip_driver_tm4c_data driver_data = {.mdc_cr = 1}; // See driver_tm4c.h
|
||||
struct mip_if mif = {
|
||||
struct mg_tcpip_driver_tm4c_data driver_data = {.mdc_cr = 1}; // See driver_tm4c.h
|
||||
struct mg_tcpip_if mif = {
|
||||
.mac = {2, 0, 1, 2, 3, 5},
|
||||
.driver = &mip_driver_tm4c,
|
||||
.driver = &mg_tcpip_driver_tm4c,
|
||||
.driver_data = &driver_data,
|
||||
};
|
||||
mip_init(&mgr, &mif);
|
||||
mg_tcpip_init(&mgr, &mif);
|
||||
volatile uint32_t *IMC = (uint32_t *) 0x400FD000;
|
||||
uint32_t val = IMC[0xFC8 / sizeof(*IMC)]; // Turn Flash Prefetch on again
|
||||
val &= ~BIT(16);
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
#include <errno.h> // we are not using lwIP
|
||||
|
||||
#define MG_ARCH MG_ARCH_FREERTOS
|
||||
#define MG_ENABLE_MIP 1
|
||||
#define MG_ENABLE_TCPIP 1
|
||||
#define MG_ENABLE_DRIVER_TM4C 1
|
||||
#define MG_IO_SIZE 256
|
||||
Reference in new issue
Block a user