| 1432 | } |
| 1433 | |
| 1434 | void TwoWire::nbrequestFrom(uint8_t address, int quantity, void (*function)(int)) { |
| 1435 | // clamp to buffer length |
| 1436 | if (quantity > NBWIRE_BUFFER_LENGTH) { |
| 1437 | quantity = NBWIRE_BUFFER_LENGTH; |
| 1438 | } |
| 1439 | |
| 1440 | // perform blocking read into buffer |
| 1441 | twi_cbreadFromDone = function; |
| 1442 | twi_readFrom(address, rxBuffer, quantity); |
| 1443 | //uint8_t read = twii_WaitForDone(); |
| 1444 | |
| 1445 | // set rx buffer iterator vars |
| 1446 | //rxBufferIndex = 0; |
| 1447 | //rxBufferLength = read; |
| 1448 | |
| 1449 | rxBufferIndex = 0; |
| 1450 | rxBufferLength = quantity; // this is a hack |
| 1451 | |
| 1452 | return; //read; |
| 1453 | } |
| 1454 | |
| 1455 | uint8_t TwoWire::available(void) { |
| 1456 | return rxBufferLength - rxBufferIndex; |
nothing calls this directly
no test coverage detected