mDot / Mbed OS Honneywell_Dust_Simple
Committer:
Roietronics
Date:
Sun Dec 03 00:05:11 2017 +0000
Revision:
15:5ba877be4304
Parent:
13:e5f9b5ec30e1
Child:
16:6550040fbdf4
Fixed round off issue in character transfer time calculation
; Added comments
; Version 2.2

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Roietronics 11:00cb0217ce8a 1 /* Run Honeywell Dust Sensor in continous Sampling Mode on a mDot or
Roietronics 11:00cb0217ce8a 2 Freedom K64 board
Roietronics 15:5ba877be4304 3 Version 2.2
Roietronics 15:5ba877be4304 4 Steve Mylroie Roitronic December 2 2017
Roietronics 15:5ba877be4304 5 @C Copyright 2017 Global Quality Corp
Roietronics 0:8326629a1b97 6 */
Roietronics 0:8326629a1b97 7
Roietronics 0:8326629a1b97 8 #include "mbed.h"
Roietronics 0:8326629a1b97 9 #include "stdlib.h"
Roietronics 0:8326629a1b97 10
Roietronics 15:5ba877be4304 11 #define VERSION "2.2"
Roietronics 4:12dfd9a8ee76 12
Roietronics 0:8326629a1b97 13 #define TRACE_MODE
Roietronics 0:8326629a1b97 14
Roietronics 0:8326629a1b97 15 //Turn on trace logging to the PC USB port
Roietronics 0:8326629a1b97 16 #ifdef TRACE_MODE
Roietronics 11:00cb0217ce8a 17 //Log level need to be set one level higher than the highest level to be output
Roietronics 5:7cabc36d4352 18 #define LOG_LEVEL 2
Roietronics 0:8326629a1b97 19 #define DEBUG
Roietronics 0:8326629a1b97 20 #endif
Roietronics 0:8326629a1b97 21
Roietronics 3:1ba96949e2fd 22
Roietronics 0:8326629a1b97 23 const uint8_t* measureCommand = "68014057";
Roietronics 0:8326629a1b97 24 const uint8_t* stopCommand = "68012077";
Roietronics 0:8326629a1b97 25
Roietronics 5:7cabc36d4352 26 //Sensor command response codes
Roietronics 0:8326629a1b97 27 #define OK 0xA5A5
Roietronics 0:8326629a1b97 28 #define BAD 0x9696
Roietronics 0:8326629a1b97 29
Roietronics 15:5ba877be4304 30 //Maximum response message lenght
Roietronics 0:8326629a1b97 31 #define MESSAGE_LEN 32
Roietronics 5:7cabc36d4352 32
Roietronics 0:8326629a1b97 33 //sensor measurement cycle in millseconds
Roietronics 0:8326629a1b97 34 #define MEASURE_DELAY 1500
Roietronics 0:8326629a1b97 35
Roietronics 3:1ba96949e2fd 36 Serial pc(USBTX, USBRX, 115200);
Roietronics 3:1ba96949e2fd 37
Roietronics 0:8326629a1b97 38 //Use USB debug pott for the debug stream
Roietronics 0:8326629a1b97 39 #ifdef DEBUG
Roietronics 3:1ba96949e2fd 40 uint32_t debugLevel = LOG_LEVEL;
Roietronics 3:1ba96949e2fd 41 #else
Roietronics 3:1ba96949e2fd 42 uint32_t debugLevel = 0;
Roietronics 0:8326629a1b97 43 #endif
Roietronics 0:8326629a1b97 44
Roietronics 3:1ba96949e2fd 45 void logInfo(char* text) {
Roietronics 3:1ba96949e2fd 46 if ( debugLevel > 0 ) {
Roietronics 3:1ba96949e2fd 47 pc.printf("\n%s\n", text );
Roietronics 3:1ba96949e2fd 48 }
Roietronics 3:1ba96949e2fd 49 return;
Roietronics 5:7cabc36d4352 50 }
Roietronics 3:1ba96949e2fd 51
Roietronics 3:1ba96949e2fd 52 void logTrace(uint8_t data) {
Roietronics 3:1ba96949e2fd 53 if (debugLevel > 2 ){ pc.putc( data );
Roietronics 3:1ba96949e2fd 54 }
Roietronics 3:1ba96949e2fd 55 return;
Roietronics 3:1ba96949e2fd 56 }
Roietronics 3:1ba96949e2fd 57
Roietronics 5:7cabc36d4352 58 //Board specfic serial port pin definitions
Roietronics 3:1ba96949e2fd 59
Roietronics 5:7cabc36d4352 60 #ifdef TARGET_Freescale //Freedom Board
Roietronics 5:7cabc36d4352 61
Roietronics 5:7cabc36d4352 62 #define SENSOR_XMT D1
Roietronics 5:7cabc36d4352 63 #define SENSOR_RCV D0
Roietronics 5:7cabc36d4352 64
Roietronics 5:7cabc36d4352 65 #endif
Roietronics 5:7cabc36d4352 66
Roietronics 5:7cabc36d4352 67 #ifdef TARGET_MTS_MDOT_F411RE //Multi Tech mDot
Roietronics 5:7cabc36d4352 68
Roietronics 5:7cabc36d4352 69 #define SENSOR_XMT PA_2
Roietronics 5:7cabc36d4352 70 #define SENSOR_RCV PA_3
Roietronics 5:7cabc36d4352 71
Roietronics 5:7cabc36d4352 72 #endif
Roietronics 5:7cabc36d4352 73
Roietronics 15:5ba877be4304 74 //Number of character following the
Roietronics 8:494f6fcecfbc 75 #define RESPONSE_MSG_LEN 2
Roietronics 15:5ba877be4304 76 #define AUTO_MSG_LEN 32
Roietronics 8:494f6fcecfbc 77
Roietronics 8:494f6fcecfbc 78 //Time required to receive one character at 9600 baud
Roietronics 15:5ba877be4304 79 #define CHAR_TIME (1000 * 10)/9600
Roietronics 8:494f6fcecfbc 80
Roietronics 8:494f6fcecfbc 81 enum MSG_TYPE{ UNKNOWN,
Roietronics 8:494f6fcecfbc 82 ACK_MSG,
Roietronics 8:494f6fcecfbc 83 NAK_MSG,
Roietronics 8:494f6fcecfbc 84 AUTO_MSG,
Roietronics 8:494f6fcecfbc 85 READ_ERROR } msgType;
Roietronics 8:494f6fcecfbc 86
Roietronics 8:494f6fcecfbc 87
Roietronics 8:494f6fcecfbc 88 uint8_t dataBuffer[AUTO_MSG_LEN];
Roietronics 8:494f6fcecfbc 89 uint8_t* bufferPtr;
Roietronics 8:494f6fcecfbc 90 uint32_t msgLen;
Roietronics 8:494f6fcecfbc 91
Roietronics 8:494f6fcecfbc 92
Roietronics 5:7cabc36d4352 93 //Use a boards second UART to communicate witb the Honneywell sensor
Roietronics 0:8326629a1b97 94 //Default UART setting are 8,N,1
Roietronics 8:494f6fcecfbc 95 RawSerial sensor( SENSOR_XMT, SENSOR_RCV, 9600);
Roietronics 8:494f6fcecfbc 96
Roietronics 11:00cb0217ce8a 97 //Serial Received chararter interupt handler
Roietronics 8:494f6fcecfbc 98
Roietronics 8:494f6fcecfbc 99 void receiveInterrupt() {
Roietronics 8:494f6fcecfbc 100 uint8_t data;
Roietronics 8:494f6fcecfbc 101 if(sensor.readable()) {
Roietronics 8:494f6fcecfbc 102 data = sensor.getc();
Roietronics 11:00cb0217ce8a 103 if(msgType == UNKNOWN) { //Start of a new message
Roietronics 11:00cb0217ce8a 104 bufferPtr = dataBuffer;
Roietronics 15:5ba877be4304 105 switch(data) { //Switch on message type character
Roietronics 8:494f6fcecfbc 106 case 0x42:
Roietronics 8:494f6fcecfbc 107 msgType = AUTO_MSG;
Roietronics 8:494f6fcecfbc 108 msgLen = AUTO_MSG_LEN;
Roietronics 8:494f6fcecfbc 109 break;
Roietronics 8:494f6fcecfbc 110 case 0xA5:
Roietronics 8:494f6fcecfbc 111 msgType = ACK_MSG;
Roietronics 8:494f6fcecfbc 112 msgLen = RESPONSE_MSG_LEN;
Roietronics 8:494f6fcecfbc 113 break;
Roietronics 8:494f6fcecfbc 114 case 0x69:
Roietronics 8:494f6fcecfbc 115 msgType = NAK_MSG;
Roietronics 8:494f6fcecfbc 116 msgLen = RESPONSE_MSG_LEN;
Roietronics 8:494f6fcecfbc 117 break;
Roietronics 8:494f6fcecfbc 118 }
Roietronics 8:494f6fcecfbc 119 }
Roietronics 11:00cb0217ce8a 120 if(msgLen-- > 0 ) { //Insert Character into type ahead buffer
Roietronics 8:494f6fcecfbc 121 *bufferPtr++ = data;
Roietronics 8:494f6fcecfbc 122 }
Roietronics 8:494f6fcecfbc 123 }
Roietronics 8:494f6fcecfbc 124 return;
Roietronics 8:494f6fcecfbc 125 }
Roietronics 0:8326629a1b97 126
Roietronics 11:00cb0217ce8a 127 //Read last message received from type ahead message buffer
Roietronics 0:8326629a1b97 128 //Mbed 5 Serial class only supports single character read and writes or
Roietronics 10:43337cc2ac79 129 // async buffer reads and wrutes
Roietronics 8:494f6fcecfbc 130 MSG_TYPE readBuffer(uint8_t* buffer, uint16_t count)
Roietronics 0:8326629a1b97 131 {
Roietronics 11:00cb0217ce8a 132 if(buffer == NULL || count > AUTO_MSG_LEN ) { //Calling without buffer or
Roietronics 11:00cb0217ce8a 133 return READ_ERROR; //asking for too many chars
Roietronics 11:00cb0217ce8a 134 } //is an error
Roietronics 8:494f6fcecfbc 135 int counter = 0;
Roietronics 8:494f6fcecfbc 136 uint8_t* inPointer;
Roietronics 8:494f6fcecfbc 137 uint8_t* outPointer;
Roietronics 8:494f6fcecfbc 138 int delay;
Roietronics 11:00cb0217ce8a 139 logInfo( "Reading last message from sensor\n");
Roietronics 11:00cb0217ce8a 140 while(msgType == UNKNOWN ) { //No message received since last read
Roietronics 11:00cb0217ce8a 141 Thread::wait(CHAR_TIME); //Wait for new message
Roietronics 8:494f6fcecfbc 142 counter++;
Roietronics 11:00cb0217ce8a 143 if(counter > 40) { //Timeout exit after 40 character 40 Charcter times
Roietronics 8:494f6fcecfbc 144 break;
Roietronics 0:8326629a1b97 145 }
Roietronics 0:8326629a1b97 146 }
Roietronics 11:00cb0217ce8a 147 counter = 0;
Roietronics 11:00cb0217ce8a 148 while(msgLen > 0 ) { //Wait for complete message to arrive
Roietronics 8:494f6fcecfbc 149 delay = CHAR_TIME * msgLen;
Roietronics 11:00cb0217ce8a 150 Thread::wait(delay);
Roietronics 8:494f6fcecfbc 151 counter++;
Roietronics 11:00cb0217ce8a 152 if(counter > 40) { //Time out exit after 40 character times
Roietronics 8:494f6fcecfbc 153 break;
Roietronics 8:494f6fcecfbc 154 }
Roietronics 8:494f6fcecfbc 155 }
Roietronics 11:00cb0217ce8a 156 if(counter > 40 ) { //Report timeout error
Roietronics 8:494f6fcecfbc 157 msgType = UNKNOWN;
Roietronics 8:494f6fcecfbc 158 return READ_ERROR;
Roietronics 8:494f6fcecfbc 159 }
Roietronics 8:494f6fcecfbc 160 else {
Roietronics 15:5ba877be4304 161 //Copy the message minus type flag to the requesters buffer
Roietronics 8:494f6fcecfbc 162 inPointer = &dataBuffer[1];
Roietronics 8:494f6fcecfbc 163 outPointer = buffer;
Roietronics 8:494f6fcecfbc 164 for(int i = 0; i < count; i++) {
Roietronics 8:494f6fcecfbc 165 *outPointer++ = *inPointer++;
Roietronics 8:494f6fcecfbc 166 }
Roietronics 8:494f6fcecfbc 167 }
Roietronics 8:494f6fcecfbc 168 MSG_TYPE temp = msgType;
Roietronics 8:494f6fcecfbc 169 //Start Search for the next message
Roietronics 8:494f6fcecfbc 170 msgType = UNKNOWN;
Roietronics 8:494f6fcecfbc 171 return temp;
Roietronics 0:8326629a1b97 172 }
Roietronics 0:8326629a1b97 173
Roietronics 8:494f6fcecfbc 174
Roietronics 0:8326629a1b97 175 void writeBuffer(const uint8_t* buffer, uint16_t count)
Roietronics 0:8326629a1b97 176 {
Roietronics 11:00cb0217ce8a 177 logInfo( "Sending Command to sensor\n");
Roietronics 0:8326629a1b97 178 uint8_t* pointer = (uint8_t*)buffer;
Roietronics 0:8326629a1b97 179 uint16_t counter = count;
Roietronics 0:8326629a1b97 180 while(1)
Roietronics 0:8326629a1b97 181 {
Roietronics 0:8326629a1b97 182 if(sensor.writeable())
Roietronics 0:8326629a1b97 183 {
Roietronics 3:1ba96949e2fd 184 logTrace(*pointer);
Roietronics 0:8326629a1b97 185 sensor.putc(*pointer++);
Roietronics 0:8326629a1b97 186 counter--;
Roietronics 0:8326629a1b97 187 }
Roietronics 4:12dfd9a8ee76 188 if(counter == 0) {
Roietronics 0:8326629a1b97 189 return;
Roietronics 0:8326629a1b97 190 }
Roietronics 0:8326629a1b97 191 }
Roietronics 0:8326629a1b97 192 }
Roietronics 0:8326629a1b97 193
Roietronics 4:12dfd9a8ee76 194 //Validate the received mesurements checksum
Roietronics 0:8326629a1b97 195
Roietronics 0:8326629a1b97 196 bool checkValue(uint8_t *thebuf, uint8_t leng)
Roietronics 0:8326629a1b97 197 {
Roietronics 0:8326629a1b97 198 bool receiveflag = false;
Roietronics 7:5f612ed18852 199 uint16_t receiveSum = 0;
Roietronics 0:8326629a1b97 200
Roietronics 6:6aa9d16e27bc 201 //Don't include the checksum bytes in the sum
Roietronics 6:6aa9d16e27bc 202 for(int i=0; i<(leng-3); i++){
Roietronics 0:8326629a1b97 203 receiveSum=receiveSum+thebuf[i];
Roietronics 0:8326629a1b97 204 }
Roietronics 0:8326629a1b97 205 receiveSum=receiveSum + 0x42;
Roietronics 0:8326629a1b97 206
Roietronics 0:8326629a1b97 207 if(receiveSum == ((thebuf[leng-2]<<8)+thebuf[leng-1])) //check the debug data
Roietronics 0:8326629a1b97 208 {
Roietronics 0:8326629a1b97 209 receiveSum = 0;
Roietronics 0:8326629a1b97 210 receiveflag = true;
Roietronics 0:8326629a1b97 211 }
Roietronics 0:8326629a1b97 212 return receiveflag;
Roietronics 0:8326629a1b97 213 }
Roietronics 0:8326629a1b97 214
Roietronics 0:8326629a1b97 215 //Extract the 1 micron particle count from the messaage
Roietronics 0:8326629a1b97 216 uint16_t transmitPM01(uint8_t *thebuf)
Roietronics 0:8326629a1b97 217 {
Roietronics 0:8326629a1b97 218 uint16_t PM01Val;
Roietronics 0:8326629a1b97 219 PM01Val=((thebuf[3]<<8) + thebuf[4]); //count PM1.0 value of the air detector module
Roietronics 0:8326629a1b97 220 return PM01Val;
Roietronics 0:8326629a1b97 221 }
Roietronics 0:8326629a1b97 222
Roietronics 0:8326629a1b97 223 //Extract the 2.5 micron particle count from the messaage
Roietronics 0:8326629a1b97 224 uint16_t transmitPM2_5(uint8_t *thebuf)
Roietronics 0:8326629a1b97 225 {
Roietronics 0:8326629a1b97 226 uint16_t PM2_5Val;
Roietronics 0:8326629a1b97 227 PM2_5Val=((thebuf[5]<<8) + thebuf[6]);//count PM2.5 value of the air detector module
Roietronics 0:8326629a1b97 228 return PM2_5Val;
Roietronics 0:8326629a1b97 229 }
Roietronics 0:8326629a1b97 230
Roietronics 0:8326629a1b97 231 //Extract the 10 micron particle count from the messaage
Roietronics 0:8326629a1b97 232 uint16_t transmitPM10(uint8_t *thebuf)
Roietronics 0:8326629a1b97 233 {
Roietronics 0:8326629a1b97 234 uint16_t PM10Val;
Roietronics 0:8326629a1b97 235 PM10Val=((thebuf[7]<<8) + thebuf[8]); //count PM10 value of the air detector module
Roietronics 0:8326629a1b97 236 return PM10Val;
Roietronics 0:8326629a1b97 237 }
Roietronics 0:8326629a1b97 238
Roietronics 0:8326629a1b97 239 int main()
Roietronics 0:8326629a1b97 240 {
Roietronics 5:7cabc36d4352 241 uint8_t dataBuffer[MESSAGE_LEN];
Roietronics 8:494f6fcecfbc 242 MSG_TYPE mType;
Roietronics 0:8326629a1b97 243 uint16_t PM01Value=0; //define PM1.0 value of the air detector module
Roietronics 0:8326629a1b97 244 uint16_t PM2_5Value=0; //define PM2.5 value of the air detector module
Roietronics 0:8326629a1b97 245 uint16_t PM10Value=0; //define PM10 value of the air detector module
Roietronics 4:12dfd9a8ee76 246
Roietronics 7:5f612ed18852 247 pc.printf("Starting Honeywell Dust Sesor App version %\n", VERSION);
Roietronics 15:5ba877be4304 248
Roietronics 15:5ba877be4304 249 #ifdef DEBIG
Roietronics 15:5ba877be4304 250 pc.printf("Character wait time is %d millseconds", CHAR_TIME);
Roietronics 15:5ba877be4304 251 #endif
Roietronics 8:494f6fcecfbc 252 //Attach a receive interrupt handler
Roietronics 8:494f6fcecfbc 253 sensor.attach(receiveInterrupt, Serial::RxIrq);
Roietronics 8:494f6fcecfbc 254 msgType = UNKNOWN;
Roietronics 0:8326629a1b97 255 //Send start command to the sensor
Roietronics 0:8326629a1b97 256 writeBuffer(measureCommand, 4);
Roietronics 5:7cabc36d4352 257 /*
Roietronics 5:7cabc36d4352 258 Not geting response from sensor - first characters received are measurement data
Roietronics 0:8326629a1b97 259 //Wait for sensors response
Roietronics 0:8326629a1b97 260 //while(!sensor.readable());
Roietronics 0:8326629a1b97 261 readBuffer(dataBuffer, 2);
Roietronics 0:8326629a1b97 262 response = dataBuffer[0] << 8 || dataBuffer[1];
Roietronics 0:8326629a1b97 263
Roietronics 0:8326629a1b97 264 switch(response) {
Roietronics 0:8326629a1b97 265 case OK:
Roietronics 0:8326629a1b97 266 logInfo("Sensor Auto Measurement Started");
Roietronics 0:8326629a1b97 267 break;
Roietronics 0:8326629a1b97 268 case BAD:
Roietronics 0:8326629a1b97 269 logInfo("Sensor rejected Start Measurement Commmand");
Roietronics 0:8326629a1b97 270 return -1;
Roietronics 0:8326629a1b97 271 default:
Roietronics 0:8326629a1b97 272 logInfo("Communication Error: Invalid Sensor Response");
Roietronics 0:8326629a1b97 273 return -2;
Roietronics 0:8326629a1b97 274 }
Roietronics 5:7cabc36d4352 275 */
Roietronics 4:12dfd9a8ee76 276
Roietronics 0:8326629a1b97 277 //Start continous loop
Roietronics 8:494f6fcecfbc 278 while(1) {
Roietronics 8:494f6fcecfbc 279 if((mType = readBuffer(dataBuffer,MESSAGE_LEN -1)) == AUTO_MSG) {
Roietronics 0:8326629a1b97 280 if(dataBuffer[0] == 0x4d){
Roietronics 6:6aa9d16e27bc 281 if(checkValue(dataBuffer, MESSAGE_LEN-1)){
Roietronics 7:5f612ed18852 282 PM01Value = transmitPM01(dataBuffer); //count PM1.0 value of the air detector module
Roietronics 7:5f612ed18852 283 PM2_5Value = transmitPM2_5(dataBuffer);//count PM2.5 value of the air detector module
Roietronics 7:5f612ed18852 284 PM10Value = transmitPM10(dataBuffer); //count PM10 value of the air detector module
Roietronics 8:494f6fcecfbc 285 }
Roietronics 6:6aa9d16e27bc 286 else {
Roietronics 8:494f6fcecfbc 287 pc.puts("Message checksum error\n");
Roietronics 8:494f6fcecfbc 288 }
Roietronics 6:6aa9d16e27bc 289 }
Roietronics 7:5f612ed18852 290 else {
Roietronics 15:5ba877be4304 291 pc.printf("Error Second Character not 0x4d but #x\n", dataBuffer[0]);
Roietronics 7:5f612ed18852 292 }
Roietronics 7:5f612ed18852 293 //Check for exit request
Roietronics 7:5f612ed18852 294 if(pc.readable()) {
Roietronics 7:5f612ed18852 295 char input = pc.getc();
Roietronics 7:5f612ed18852 296 if(input == 'Q' || input == 'q')
Roietronics 7:5f612ed18852 297 {
Roietronics 8:494f6fcecfbc 298 //Shutdown the sensor
Roietronics 7:5f612ed18852 299 writeBuffer(stopCommand, 4);
Roietronics 8:494f6fcecfbc 300 //Unlink the receive interrupt handler
Roietronics 8:494f6fcecfbc 301 sensor.attach(0, Serial::RxIrq);
Roietronics 8:494f6fcecfbc 302 pc.puts("Exit request received\n");
Roietronics 7:5f612ed18852 303 return 0;
Roietronics 8:494f6fcecfbc 304 }
Roietronics 7:5f612ed18852 305 }
Roietronics 8:494f6fcecfbc 306 // Use MBed wait function instead of Arduino delay loop
Roietronics 8:494f6fcecfbc 307 wait_ms(1000);
Roietronics 8:494f6fcecfbc 308
Roietronics 8:494f6fcecfbc 309 pc.printf("PM1.0: %d ug/m3\n", PM01Value);
Roietronics 8:494f6fcecfbc 310
Roietronics 8:494f6fcecfbc 311 pc.printf("PM2.5: %d ug/m3\n", PM2_5Value);
Roietronics 8:494f6fcecfbc 312
Roietronics 8:494f6fcecfbc 313 pc.printf("PM10: %d ug/m3\n", PM10Value);
Roietronics 8:494f6fcecfbc 314
Roietronics 8:494f6fcecfbc 315 pc.printf("\n");
Roietronics 5:7cabc36d4352 316 }
Roietronics 8:494f6fcecfbc 317 else {
Roietronics 8:494f6fcecfbc 318 switch(mType) {
Roietronics 8:494f6fcecfbc 319 case ACK_MSG:
Roietronics 8:494f6fcecfbc 320 if(dataBuffer[0] == 0xA5) {
Roietronics 8:494f6fcecfbc 321 pc.puts("Recived ACK response'\n");
Roietronics 8:494f6fcecfbc 322 }
Roietronics 8:494f6fcecfbc 323 else {
Roietronics 8:494f6fcecfbc 324 pc.puts("Received corrupt ACK Response\n");
Roietronics 8:494f6fcecfbc 325 }
Roietronics 8:494f6fcecfbc 326 break;
Roietronics 8:494f6fcecfbc 327 case NAK_MSG:
Roietronics 8:494f6fcecfbc 328 if(dataBuffer[0] == 0x69) {
Roietronics 8:494f6fcecfbc 329 pc.puts("Recived NAK response'\n");
Roietronics 8:494f6fcecfbc 330 }
Roietronics 8:494f6fcecfbc 331 else {
Roietronics 8:494f6fcecfbc 332 pc.puts("Received corrupt NAK Response\n");
Roietronics 8:494f6fcecfbc 333 }
Roietronics 8:494f6fcecfbc 334 break;
Roietronics 8:494f6fcecfbc 335 case READ_ERROR:
Roietronics 15:5ba877be4304 336 pc.puts("Data Reading Error\n");
Roietronics 8:494f6fcecfbc 337 break;
Roietronics 8:494f6fcecfbc 338 }
Roietronics 8:494f6fcecfbc 339 }
Roietronics 8:494f6fcecfbc 340 }
Roietronics 8:494f6fcecfbc 341 }