AVR build fixes

This commit is contained in:
cpq committed 2023-07-20 16:07:53 +01:00
1 parent 09ce6ae1c5
commit 0a761c09e3
37 files changed
+58 -83

No files matched your search

+1 -1
View File
@@ -90,7 +90,7 @@
#endif
#ifndef MG_MAX_RECV_SIZE
#define MG_MAX_RECV_SIZE (3 * 1024 * 1024) // Maximum recv IO buffer size
#define MG_MAX_RECV_SIZE (3UL * 1024UL * 1024UL) // Maximum recv IO buffer size
#endif
#ifndef MG_DATA_SIZE
+1 -1
View File
@@ -1,6 +1,6 @@
#include "tcpip.h"
#if MG_ENABLE_TCPIP && MG_ENABLE_DRIVER_STM32
#if MG_ENABLE_TCPIP && defined(MG_ENABLE_DRIVER_STM32) && MG_ENABLE_DRIVER_STM32
struct stm32_eth {
volatile uint32_t MACCR, MACFFR, MACHTHR, MACHTLR, MACMIIAR, MACMIIDR, MACFCR,
MACVLANTR, RESERVED0[2], MACRWUFFR, MACPMTCSR, RESERVED1, MACDBGR, MACSR,
+4 -3
View File
@@ -582,8 +582,9 @@ static void read_conn(struct mg_connection *c, struct pkt *pkt) {
uint32_t rem_ip;
memcpy(&rem_ip, c->rem.ip, sizeof(uint32_t));
MG_DEBUG(("SEQ != ACK: %x %x %x", seq, s->ack, ack));
tx_tcp((struct mg_tcpip_if *) c->mgr->priv, s->mac, rem_ip, TH_ACK, c->loc.port,
c->rem.port, mg_htonl(s->seq), mg_htonl(s->ack), "", 0);
tx_tcp((struct mg_tcpip_if *) c->mgr->priv, s->mac, rem_ip, TH_ACK,
c->loc.port, c->rem.port, mg_htonl(s->seq), mg_htonl(s->ack), "",
0);
}
} else if (io->size - io->len < pkt->pay.len &&
!mg_iobuf_resize(io, io->len + pkt->pay.len)) {
@@ -809,7 +810,7 @@ static void mg_tcpip_poll(struct mg_tcpip_if *ifp, uint64_t uptime_ms) {
if (ifp->now >= ifp->lease_expire) {
ifp->state = MG_TCPIP_STATE_UP, ifp->ip = 0; // expired, release IP
onstatechange(ifp);
} else if (ifp->now + 30 * 60 * 1000 > ifp->lease_expire &&
} else if (ifp->now + 30UL * 60UL * 1000UL > ifp->lease_expire &&
((ifp->now / 1000) % 60) == 0) {
// hack: 30 min before deadline, try to rebind (4.3.6) every min
tx_dhcp_request_re(ifp, (uint8_t *) broadcast, ifp->ip, 0xffffffff);
+3 -9
View File
@@ -5,7 +5,7 @@
#include "net.h"
#include "queue.h"
struct mg_tcpip_if; // MIP network interface
struct mg_tcpip_if; // Mongoose TCP/IP network interface
struct mg_tcpip_driver {
bool (*init)(struct mg_tcpip_if *); // Init driver
@@ -21,8 +21,8 @@ struct mg_tcpip_if {
struct mg_str tx; // Output (TX) buffer
bool enable_dhcp_client; // Enable DCHP client
bool enable_dhcp_server; // Enable DCHP server
bool enable_crc32_check; // Do a CRC check on rx frames and strip it
bool enable_mac_check; // Do a MAC check on rx frames
bool enable_crc32_check; // Do a CRC check on RX frames and strip it
bool enable_mac_check; // Do a MAC check on RX frames
struct mg_tcpip_driver *driver; // Low level driver
void *driver_data; // Driver-specific data
struct mg_mgr *mgr; // Mongoose event manager
@@ -62,10 +62,4 @@ struct mg_tcpip_spi {
void (*end)(void *); // SPI end: slave select high
uint8_t (*txn)(void *, uint8_t); // SPI transaction: write 1 byte, read reply
};
#if !defined(MG_ENABLE_DRIVER_STM32H) && !defined(MG_ENABLE_DRIVER_TM4C)
#define MG_ENABLE_DRIVER_STM32 1
#else
#define MG_ENABLE_DRIVER_STM32 0
#endif
#endif