Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: CANInterface.cpp
- Revision:
- 1:abf508583871
- Parent:
- 0:1ce2190bc4d2
--- a/CANInterface.cpp Wed Apr 30 13:51:22 2014 +0000 +++ b/CANInterface.cpp Wed Apr 30 15:30:46 2014 +0000 @@ -9,7 +9,7 @@ int CANInterface::makeRequest(uint8_t pid, uint8_t *outBuf, int *outLen) { char canMsg[8] = {0x02,0x01,pid,0x00,0x00,0x00,0x00,0x00}; - int readOK = 0; + int ret = 1; // write request CANMessage request(CAN_PID_REQUEST,canMsg,8); @@ -29,7 +29,7 @@ // try and read response if(_can->read(response)) { - readOK = 1; + ret = 0; _timer->stop(); if((response.id == CAN_PID_REPLY) && (response.data[2] == pid)) { memcpy(outBuf,response.data,response.len-2); @@ -40,5 +40,5 @@ } } } - return readOK; + return ret; } \ No newline at end of file