mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-19 09:42:11 +03:00
Fix issue on write error
This commit is contained in:
Binary file not shown.
Binary file not shown.
@ -1476,7 +1476,7 @@ bool checkMsgFormat(uint8_t* _recv, int len, int* offset)
|
|||||||
unsigned char* recv = getStartCmdSeq(_recv, len, offset);
|
unsigned char* recv = getStartCmdSeq(_recv, len, offset);
|
||||||
if ((recv == NULL)||(recv!=_recv))
|
if ((recv == NULL)||(recv!=_recv))
|
||||||
{
|
{
|
||||||
if ((INFO_WARN_FLAG)&&(len < 20)) //TODO stamp only short messages wrong
|
if ((enableDebug & INFO_WARN_FLAG)&&(len < 20)) //TODO stamp only short messages wrong
|
||||||
dump((char*)_recv, len);
|
dump((char*)_recv, len);
|
||||||
|
|
||||||
if (recv == NULL)
|
if (recv == NULL)
|
||||||
@ -1551,7 +1551,7 @@ void spi_poll(struct netif* netif) {
|
|||||||
{
|
{
|
||||||
sendError();
|
sendError();
|
||||||
WARN("Check format msg failed!\n");
|
WARN("Check format msg failed!\n");
|
||||||
if (INFO_WARN_FLAG)
|
if (enableDebug & INFO_WARN_FLAG)
|
||||||
dump((char*)_receiveBuffer, receivedChars);
|
dump((char*)_receiveBuffer, receivedChars);
|
||||||
state = SPI_CMD_IDLE;
|
state = SPI_CMD_IDLE;
|
||||||
count=0;
|
count=0;
|
||||||
|
@ -142,6 +142,7 @@ static void tcp_send_data(struct ttcp *ttcp) {
|
|||||||
uint32_t len, orig_len;
|
uint32_t len, orig_len;
|
||||||
|
|
||||||
len = ttcp->left;
|
len = ttcp->left;
|
||||||
|
ttcp->buff_sent = 0;
|
||||||
INFO_TCP_VER("left=%d len:%d tcp_sndbuf:%d\n", ttcp->left, len, tcp_sndbuf(ttcp->tpcb));
|
INFO_TCP_VER("left=%d len:%d tcp_sndbuf:%d\n", ttcp->left, len, tcp_sndbuf(ttcp->tpcb));
|
||||||
|
|
||||||
|
|
||||||
@ -164,7 +165,7 @@ static void tcp_send_data(struct ttcp *ttcp) {
|
|||||||
{
|
{
|
||||||
len /= 2;
|
len /= 2;
|
||||||
ttcp->buff_sent = 0;
|
ttcp->buff_sent = 0;
|
||||||
}else{
|
}else if (err == ERR_OK){
|
||||||
ttcp->buff_sent = 1;
|
ttcp->buff_sent = 1;
|
||||||
isDataSentCount = 0;
|
isDataSentCount = 0;
|
||||||
}
|
}
|
||||||
@ -758,9 +759,13 @@ static err_t tcp_data_sent(void *arg, struct tcp_pcb *pcb, u16_t len) {
|
|||||||
_ttcp = arg;
|
_ttcp = arg;
|
||||||
|
|
||||||
tcp_poll_retries = 0;
|
tcp_poll_retries = 0;
|
||||||
|
if (_ttcp) _ttcp->buff_sent = 1;
|
||||||
|
|
||||||
INFO_TCP("Packet sent pcb:%p len:%d dur:%d left:%d\n", pcb, len, timer_get_ms() - startTime,
|
|
||||||
(_ttcp)?(_ttcp->left):0);
|
INFO_TCP("Packet sent pcb:%p len:%d dur:%d left:%d count:%d\n", pcb, len, timer_get_ms() - startTime,
|
||||||
|
(_ttcp)?(_ttcp->left):0, isDataSentCount);
|
||||||
|
|
||||||
|
isDataSentCount = 0;
|
||||||
|
|
||||||
if ((_ttcp)&&(_ttcp->left > 0)) {
|
if ((_ttcp)&&(_ttcp->left > 0)) {
|
||||||
tcp_send_data(_ttcp);
|
tcp_send_data(_ttcp);
|
||||||
|
Reference in New Issue
Block a user