Skip to content

Commit

Permalink
catch up with current version
Browse files Browse the repository at this point in the history
Remove references to culled code.
  • Loading branch information
stickbreaker authored Nov 24, 2017
1 parent e5f56eb commit 89ab899
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ uint8_t err =Wire.endTransmission(false); // don't send a STOP, just Pause I2C o
if(err==7){ // Prior Operation has been queued, it is NOT guaranteed that it will
// successfully occur!
err=Wire.requestFrom(addr,len);
if(err!=len){ // complete/partial read failure
Serial.print("Bad Stuff!! Read Failed lastError=");
Serial.print(Wire.lastError(),DEC);
if(Wire.lastError()!=0){ // complete/partial read failure
Serial.printf("Bad Stuff!!\nRead of (%d) bytes read %d bytes\nFailed lastError=%d,"
" text=%s\n",len,err,Wire.lastError(),Wire.getErrorText(Wire.lastError()));
}
// some of the read may have executed
while(Wire.avaiable()){
Expand All @@ -70,13 +70,8 @@ Additionally I have expanded the ability of `Wire()` to handle larger Reads and

I have create a few new methods for Wire:
```c++
uint8_t oldEndTransmission(uint8_t); //released implementation
size_t oldRequestFrom(uint8_t address, size_t size, bool sendStop); //released implementation
//@stickBreaker for big blocks and ISR model
uint8_t writeTransaction(uint8_t address, uint8_t* buff, size_t size, bool sendStop);// big block handling
size_t requestFrom(uint8_t address, size_t size, bool sendStop);
size_t requestFrom(uint8_t address, uint8_t* buf, size_t size, bool sendStop);
size_t polledRequestFrom(uint8_t address, uint8_t* buf, size_t size, bool sendStop);//a BigBlock test case Not USING ISR
size_t transact(size_t readLen); // replacement for endTransmission(false),requestFrom(ID,readLen,true);
size_t transact(uint8_t* readBuff, size_t readLen);// bigger Block read
i2c_err_t lastError(); // Expose complete error
Expand All @@ -91,10 +86,9 @@ Wire.beginTransmission(ID);
Wire.write(highByte(addr));
Wire.write(lowByte(addr));
uint8_t err=Wire.transact(len);
if(err!=len){ // complete/partial read failure
Serial.print("Bad Stuff!! Read Failed lastError=");
Serial.print(Wire.lastError(),DEC);
uint8_t err=Wire.transact(len); // transact() does both Wire.endTransmission(false); and Wire.requestFrom(ID,len,true);
if(Wire.lastError != 0){ // complete/partial read failure
Serial.printf("Bad Stuff!! Read Failed lastError=%d\n",Wire.lastError());
}
// some of the read may have executed
while(Wire.avaiable()){
Expand All @@ -110,5 +104,4 @@ Set the "core debug level" to 'error'
There is MINIMAL to NO ERROR detection, BUS, BUSY. because I have not encounter any of them!



Chuck.

0 comments on commit 89ab899

Please sign in to comment.