MCPcopy Create free account
hub / github.com/LowPowerLab/RFM69 / chooseResolutionAndCoef

Function chooseResolutionAndCoef

RFM69.cpp:1118–1130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1116}
1117
1118static 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
1132bool 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 };

Callers 1

Calls 1

getCoefForResolutionFunction · 0.85

Tested by

no test coverage detected