Skip to content

Commit abd9db1

Browse files
committed
Fix issue on write error
1 parent 1c539c0 commit abd9db1

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

binary/wifiHD.elf

0 Bytes
Binary file not shown.

wifiHD/Release/wifiHD.elf

0 Bytes
Binary file not shown.

wifiHD/src/ard_spi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,7 +1476,7 @@ bool checkMsgFormat(uint8_t* _recv, int len, int* offset)
14761476
unsigned char* recv = getStartCmdSeq(_recv, len, offset);
14771477
if ((recv == NULL)||(recv!=_recv))
14781478
{
1479-
if ((INFO_WARN_FLAG)&&(len < 20)) //TODO stamp only short messages wrong
1479+
if ((enableDebug & INFO_WARN_FLAG)&&(len < 20)) //TODO stamp only short messages wrong
14801480
dump((char*)_recv, len);
14811481

14821482
if (recv == NULL)
@@ -1551,7 +1551,7 @@ void spi_poll(struct netif* netif) {
15511551
{
15521552
sendError();
15531553
WARN("Check format msg failed!\n");
1554-
if (INFO_WARN_FLAG)
1554+
if (enableDebug & INFO_WARN_FLAG)
15551555
dump((char*)_receiveBuffer, receivedChars);
15561556
state = SPI_CMD_IDLE;
15571557
count=0;

wifiHD/src/ard_tcp.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ static void tcp_send_data(struct ttcp *ttcp) {
142142
uint32_t len, orig_len;
143143

144144
len = ttcp->left;
145+
ttcp->buff_sent = 0;
145146
INFO_TCP_VER("left=%d len:%d tcp_sndbuf:%d\n", ttcp->left, len, tcp_sndbuf(ttcp->tpcb));
146147

147148

@@ -164,7 +165,7 @@ static void tcp_send_data(struct ttcp *ttcp) {
164165
{
165166
len /= 2;
166167
ttcp->buff_sent = 0;
167-
}else{
168+
}else if (err == ERR_OK){
168169
ttcp->buff_sent = 1;
169170
isDataSentCount = 0;
170171
}
@@ -758,9 +759,13 @@ static err_t tcp_data_sent(void *arg, struct tcp_pcb *pcb, u16_t len) {
758759
_ttcp = arg;
759760

760761
tcp_poll_retries = 0;
762+
if (_ttcp) _ttcp->buff_sent = 1;
761763

762-
INFO_TCP("Packet sent pcb:%p len:%d dur:%d left:%d\n", pcb, len, timer_get_ms() - startTime,
763-
(_ttcp)?(_ttcp->left):0);
764+
765+
INFO_TCP("Packet sent pcb:%p len:%d dur:%d left:%d count:%d\n", pcb, len, timer_get_ms() - startTime,
766+
(_ttcp)?(_ttcp->left):0, isDataSentCount);
767+
768+
isDataSentCount = 0;
764769

765770
if ((_ttcp)&&(_ttcp->left > 0)) {
766771
tcp_send_data(_ttcp);

0 commit comments

Comments
 (0)