Subversion Repositories HomeAutomation

Rev

Rev 1559 | Rev 1561 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 1559 Rev 1560
Line 103... Line 103...
103
#endif
103
#endif
104
            // insert it into the message
104
            // insert it into the message
105
            msg.Data[(uint8_t)msg.Length] = c;
105
            msg.Data[(uint8_t)msg.Length] = c;
106
            msg.Length++;
106
            msg.Length++;
107
           
107
           
-
 
108
#if sns_Serial_FORCE_SEND_TIME_MS > 0
108
            Timer_SetTimeout(sns_Serial_FORCE_SEND_TIMER, sns_Serial_FORCE_SEND_TIME_MS , TimerTypeOneShot, 0);
109
            Timer_SetTimeout(sns_Serial_FORCE_SEND_TIMER, sns_Serial_FORCE_SEND_TIME_MS , TimerTypeOneShot, 0);
-
 
110
#endif
109
        }
111
        }
110
    // keep going until max data length reached, or until uart RXBUF is empty
112
    // keep going until max data length reached, or until uart RXBUF is empty
111
    } while (status == 0 && msg.Length < 8);
113
    } while (status == 0 && msg.Length < 8);
112
   
114
   
113
    // check if force send or send-frame full
115
    // check if force send or send-frame full
114
    if (Timer_Expired(sns_Serial_FORCE_SEND_TIMER) || msg.Length == 8)
116
    if (Timer_Expired(sns_Serial_FORCE_SEND_TIMER) || msg.Length == 8 || (sns_Serial_FORCE_SEND_TIME_MS == 0 && msg.Length>0))
115
    {
117
    {
116
        // transmit this chunk of data (max 8 chars)
118
        // transmit this chunk of data (max 8 chars)
117
        while(StdCan_Put(&msg) != StdCan_Ret_OK);
119
        while(StdCan_Put(&msg) != StdCan_Ret_OK);
118
        msg.Length = 0; // no data so far
120
        msg.Length = 0; // no data so far
119
    }
121
    }