51 static size_t _writes(
void *ip,
const uint8_t *bp,
size_t n) {
53 return bsap->bssp->
vmt->write(bsap->bssp, bp, n);
56 static size_t _reads(
void *ip, uint8_t *bp,
size_t n) {
67 bsap->ndx += buffered;
69 return buffered + bsap->bssp->
vmt->read(bsap->bssp, bp + buffered, n - buffered);
72 static msg_t _put(
void *ip, uint8_t b) {
74 return bsap->bssp->
vmt->put(bsap->bssp, b);
77 static msg_t _get(
void *ip) {
81 return bsap->bssp->
vmt->get(bsap->bssp);
84 return bsap->buffer[bsap->ndx++];
87 static msg_t _unget(
void* ip, uint8_t b) {
90 if (((int8_t)b == STM_RESET) || (bsap->ndx == 0)) {
94 bsap->buffer[--(bsap->ndx)] = b;
100 (size_t)0, _writes, _reads, _put, _get, _unget