| 1116 | } |
| 1117 | |
| 1118 | static bool chooseResolutionAndCoef(uint8_t *resolutions, uint32_t duration, uint8_t& resolOut, uint8_t& coefOut) { |
| 1119 | for (int i = 0; resolutions[i]; i++) { |
| 1120 | uint32_t coef = getCoefForResolution(resolutions[i], duration); |
| 1121 | if (coef <= 255) { |
| 1122 | coefOut = coef; |
| 1123 | resolOut = resolutions[i]; |
| 1124 | return true; |
| 1125 | } |
| 1126 | } |
| 1127 | |
| 1128 | // out of range |
| 1129 | return false; |
| 1130 | } |
| 1131 | |
| 1132 | bool RFM69::listenModeSetDurations(uint32_t& rxDuration, uint32_t& idleDuration) { |
| 1133 | uint8_t rxResolutions[] = { RF_LISTEN1_RESOL_RX_64, RF_LISTEN1_RESOL_RX_4100, RF_LISTEN1_RESOL_RX_262000, 0 }; |
no test coverage detected