MCPcopy Create free account
hub / github.com/SlimeVR/SlimeVR-Tracker-ESP / nbrequestFrom

Method nbrequestFrom

lib/i2cdev/I2Cdev.cpp:1451–1470  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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;

Callers

nothing calls this directly

Calls 1

twi_readFromFunction · 0.85

Tested by

no test coverage detected