Changes between Version 11 and Version 12 of Docs/Prog/Manual/ApplicationLibraries/lib825ev/Weight/StartRepeatMulti
- Timestamp:
- 05/30/14 10:07:58 (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Docs/Prog/Manual/ApplicationLibraries/lib825ev/Weight/StartRepeatMulti
v11 v12 92 92 93 93 MnBdSetEvent(MNBD_REQ_REP_MULTI, MnBdEventMultiRcv); 94 // Set the comm event to our MnBdSerialDataRcv function to receive serial port data from COM3 and COM4 94 95 MnBdSetCommEvent(MnBdSerialDataRcv); 95 96 … … 170 171 } mnbd_serial[2] = { { "", 0 }, { "", 0 } }; 171 172 172 173 // Called automatically during MnBdRead 173 174 int MnBdSerialDataRcv(int nPort, int nLen, unsigned char* data) 174 175 { … … 178 179 if(data[n] == '\r') 179 180 { 180 mnbd_serial[nPort].buffer[mnbd_serial[nPort].pos = '\0';181 mnbd_serial[nPort].buffer[mnbd_serial[nPort].pos] = '\0'; // Terminate the string 181 182 printf("rcv com %d [%s]\r\n", nPort + 3, mnbd_serial[nPort].buffer); 182 183 } 184 else 185 { 186 mnbd_serial[nPort].buffer[mnbd_serial[nPort].pos++] = data[n]; 187 } 188 183 mnbd_serial[nPort].pos = 0; 184 } 185 else if(mnbd_serial[nPort].pos < 99) // prevent buffer overflow 186 { 187 mnbd_serial[nPort].buffer[mnbd_serial[nPort].pos++] = data[n]; 188 } 189 189 } 190 return 0; 190 191 } 191 192 }}}