| 63 | } |
| 64 | |
| 65 | void Controller::getResponse(PIO pio, uint sm, uint8_t *response, |
| 66 | uint8_t responseLength) { |
| 67 | int16_t remainingResponseBytes = responseLength; |
| 68 | while (remainingResponseBytes > 0) { |
| 69 | absolute_time_t timeout_us = make_timeout_time_us(600); |
| 70 | bool timedOut = false; |
| 71 | while (pio_sm_is_rx_fifo_empty(pio, sm) && !timedOut) { |
| 72 | timedOut = time_reached(timeout_us); |
| 73 | } |
| 74 | if (timedOut) { |
| 75 | // throw 0; |
| 76 | } |
| 77 | uint32_t data = pio_sm_get(pio, sm); |
| 78 | response[responseLength - remainingResponseBytes] = (uint8_t)(data & 0xFF); |
| 79 | remainingResponseBytes--; |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | double Controller::getScaledAnalogAxis(double axisPos, double *minAxis, |
| 84 | double *maxAxis) { |
nothing calls this directly
no outgoing calls
no test coverage detected