Fix issue on write error

This commit is contained in:
Mimmo La Fauci 2012-06-07 00:55:35 +02:00
parent 1c539c0840
commit abd9db126b
4 changed files with 10 additions and 5 deletions

Binary file not shown.

Binary file not shown.

View File

@ -1476,7 +1476,7 @@ bool checkMsgFormat(uint8_t* _recv, int len, int* offset)
unsigned char* recv = getStartCmdSeq(_recv, len, offset);
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);
if (recv == NULL)
@ -1551,7 +1551,7 @@ void spi_poll(struct netif* netif) {
{
sendError();
WARN("Check format msg failed!\n");
if (INFO_WARN_FLAG)
if (enableDebug & INFO_WARN_FLAG)
dump((char*)_receiveBuffer, receivedChars);
state = SPI_CMD_IDLE;
count=0;

View File

@ -142,6 +142,7 @@ static void tcp_send_data(struct ttcp *ttcp) {
uint32_t len, orig_len;
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));
@ -164,7 +165,7 @@ static void tcp_send_data(struct ttcp *ttcp) {
{
len /= 2;
ttcp->buff_sent = 0;
}else{
}else if (err == ERR_OK){
ttcp->buff_sent = 1;
isDataSentCount = 0;
}
@ -758,9 +759,13 @@ static err_t tcp_data_sent(void *arg, struct tcp_pcb *pcb, u16_t len) {
_ttcp = arg;
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)) {
tcp_send_data(_ttcp);