| 1449 | } |
| 1450 | |
| 1451 | void TwoWire::nbrequestFrom(uint8_t address, int quantity, void (*function)(int)) { |
| 1452 | // clamp to buffer length |
| 1453 | if (quantity > NBWIRE_BUFFER_LENGTH) { |
| 1454 | quantity = NBWIRE_BUFFER_LENGTH; |
| 1455 | } |
| 1456 | |
| 1457 | // perform blocking read into buffer |
| 1458 | twi_cbreadFromDone = function; |
| 1459 | twi_readFrom(address, rxBuffer, quantity); |
| 1460 | //uint8_t read = twii_WaitForDone(); |
| 1461 | |
| 1462 | // set rx buffer iterator vars |
| 1463 | //rxBufferIndex = 0; |
| 1464 | //rxBufferLength = read; |
| 1465 | |
| 1466 | rxBufferIndex = 0; |
| 1467 | rxBufferLength = quantity; // this is a hack |
| 1468 | |
| 1469 | return; //read; |
| 1470 | } |
| 1471 | |
| 1472 | uint8_t TwoWire::available(void) { |
| 1473 | return rxBufferLength - rxBufferIndex; |
nothing calls this directly
no test coverage detected