assorted patches

This commit is contained in:
Sergio R. Caprile authored and Sergio R. Caprile committed 2026-06-23 13:38:35 -03:00
1 parent 07a49a7a2d
commit a9df523f76
34 files changed
+1240 -592

No files matched your search

+1 -1
View File
@@ -1054,7 +1054,7 @@ static size_t cyw_spi_poll(uint8_t *response) {
}
static size_t cyw_spi_tx(uint32_t *data, uint16_t len) {
while (len & 3) data[len++] = 0; // SPI 32-bit padding
while (len & 3) ((uint8_t *)data)[len++] = 0; // SPI 32-bit padding
return cyw_spi_write(CYW_SPID_FUNC_WLAN, 0, data, len) ? len: 0;
}
+4 -4
View File
@@ -182,11 +182,11 @@ void ENET_IRQHandler(void) {
(MG_BIT(21) | MG_BIT(20) | MG_BIT(18) | MG_BIT(17) | MG_BIT(16)))) {
size_t len = s_rxdesc[s_rxno][0] & 0xffff;
mg_tcpip_qwrite(s_rxbuf[s_rxno], len, s_ifp);
s_rxdesc[s_rxno][0] |= MG_BIT(31); // OWN bit: handle control to DMA
MG_DSB();
ENET->RDAR = 0;
if (++s_rxno >= ETH_DESC_CNT) s_rxno = 0;
}
s_rxdesc[s_rxno][0] |= MG_BIT(31); // OWN bit: handle control to DMA
MG_DSB();
ENET->RDAR = 0;
if (++s_rxno >= ETH_DESC_CNT) s_rxno = 0;
}
}
}
+4 -1
View File
@@ -155,7 +155,10 @@ static size_t mg_tcpip_driver_tms570_tx(const void *buf, size_t len,
len = 0; // fail
} else {
memcpy(s_txbuf[s_txno], buf, len); // Copy data
if (len < 128) len = 128;
if (len < 128) {
memset(s_txbuf[s_txno] + len, 0, 128 - len);
len = 128;
}
s_txdesc[s_txno][2] = SWAP32((uint32_t) len); // Set data len
s_txdesc[s_txno][3] =
SWAP32(MG_BIT(31) | MG_BIT(30) | MG_BIT(29) | len); // SOP, EOP, OWN, length
+1 -1
View File
@@ -39,7 +39,7 @@ static size_t w5100_rx(void *buf, size_t buflen, struct mg_tcpip_if *ifp) {
} else {
uint16_t remaining_len = rxbuf_size - ptr_ofs;
w5100_rn(s, rxbuf_addr + ptr_ofs, buf, remaining_len);
w5100_rn(s, rxbuf_addr, buf + remaining_len, n - remaining_len);
w5100_rn(s, rxbuf_addr, buf + remaining_len, r - remaining_len);
}
w5100_w2(s, 0x428, (uint16_t) (ptr + n));
w5100_w1(s, 0x401, 0x40); // Sock0 CR -> RECV