Rev 113 | Rev 153 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 113 | Rev 151 | ||
---|---|---|---|
Line 89... | Line 89... | ||
89 | u8* pdata = NULL; |
89 | u8* pdata = NULL; |
90 | int len = 0; |
90 | int len = 0; |
Line 91... | Line 91... | ||
91 | 91 | ||
92 | if(pTxBuff->Locked == FALSE) |
92 | if(pTxBuff->Locked == FALSE) |
- | 93 | { // tx-buffer is not in use |
|
- | 94 | // lock the buffer |
|
93 | { // tx-buffer is not in use |
95 | pTxBuff->Locked = TRUE; |
94 | pTxBuff->Position = 0; |
96 | pTxBuff->Position = 0; |
95 | pTxBuff->pData[pTxBuff->Position++] = '#'; // Start character |
97 | pTxBuff->pData[pTxBuff->Position++] = '#'; // Start character |
96 | pTxBuff->pData[pTxBuff->Position++] = 'a' + Address; // Address (a=0; b=1,...) |
98 | pTxBuff->pData[pTxBuff->Position++] = 'a' + Address; // Address (a=0; b=1,...) |
Line 160... | Line 162... | ||
160 | pTxBuff->pData[pTxBuff->Position++] = '=' + tmpCRC / 64; |
162 | pTxBuff->pData[pTxBuff->Position++] = '=' + tmpCRC / 64; |
161 | pTxBuff->pData[pTxBuff->Position++] = '=' + tmpCRC % 64; |
163 | pTxBuff->pData[pTxBuff->Position++] = '=' + tmpCRC % 64; |
162 | pTxBuff->pData[pTxBuff->Position++] = '\r'; |
164 | pTxBuff->pData[pTxBuff->Position++] = '\r'; |
163 | pTxBuff->DataBytes = pTxBuff->Position; |
165 | pTxBuff->DataBytes = pTxBuff->Position; |
164 | pTxBuff->Position = 0; // reset buffer position for transmision |
166 | pTxBuff->Position = 0; // reset buffer position for transmision |
165 | pTxBuff->Locked = TRUE; // mark as used |
- | |
166 | } // EOF buffer not in use |
167 | } // EOF buffer not in use |
167 | } |
168 | } |
Line 168... | Line 169... | ||
168 | 169 | ||
169 | // typical called in an UART Rx ISR |
170 | // typical called in an UART Rx ISR |