int16_t Packet::findLast(uint8_t arr[], const uint8_t &len) Description: ------------ * Finds last instance of the value START_BYTE within the given packet array Inputs: ------- * uint8_t arr[] - Packet array * const uint8_t &len - Number of elements in arr[] Return: ------- * int16_t - Index of last instance of the value START_BYTE within the given packet array */
| 349 | packet array |
| 350 | */ |
| 351 | int16_t Packet::findLast(uint8_t arr[], const uint8_t& len) |
| 352 | { |
| 353 | for (uint8_t i = (len - 1); i != 0xFF; i--) |
| 354 | if (arr[i] == START_BYTE) |
| 355 | return i; |
| 356 | |
| 357 | return -1; |
| 358 | } |
| 359 | |
| 360 | |
| 361 | /* |
nothing calls this directly
no outgoing calls
no test coverage detected