Skip to content

Commit

Permalink
Merge pull request #555 from d-a-v/warningless
Browse files Browse the repository at this point in the history
remove warnings
  • Loading branch information
terrillmoore authored May 10, 2020
2 parents b5a2315 + 06b53c7 commit 59df2fa
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/arduino_lmic_hal_configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ class HalConfiguration_t
uint32_t frequency
)
{
LMIC_API_PARAMETER(policy);
LMIC_API_PARAMETER(requestedPower);
LMIC_API_PARAMETER(frequency);
// default: use PA_BOOST exclusively
return TxPowerPolicy_t::PA_BOOST;
}
Expand Down
20 changes: 14 additions & 6 deletions src/lmic/lmic.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ ostime_t calcAirTime (rps_t rps, u1_t plen) {
//

static void setRxsyms (ostime_t rxsyms) {
if (rxsyms >= (1u << 10u)) {
if (rxsyms >= (((ostime_t)1) << 10u)) {
LMIC.rxsyms = (1u << 10u) - 1;
} else if (rxsyms < 0) {
LMIC.rxsyms = 0;
Expand Down Expand Up @@ -721,11 +721,17 @@ static CONST_TABLE(u1_t, macCmdSize)[] = {
};

static u1_t getMacCmdSize(u1_t macCmd) {
if (macCmd < 2)
return 0;
if ((macCmd - 2) >= LENOF_TABLE(macCmdSize))
return 0;
return TABLE_GET_U1(macCmdSize, macCmd - 2);
if (macCmd >= 2) {
const unsigned macCmdMinus2 = macCmd - 2u;
if (macCmdMinus2 < LENOF_TABLE(macCmdSize)) {
// macCmd in table, fetch it's size.
return TABLE_GET_U1(macCmdSize, macCmdMinus2);
}
}
// macCmd too small or too large: return zero. Zero is
// never a legal command size, so it signals an error
// to the caller.
return 0;
}

static bit_t
Expand Down Expand Up @@ -3080,6 +3086,8 @@ int LMIC_getNetworkTimeReference(lmic_time_reference_t *pReference) {
pReference->tNetwork = LMIC.netDeviceTime;
return 1;
}
#else
LMIC_API_PARAMETER(pReference);
#endif // LMIC_ENABLE_DeviceTimeReq
return 0;
}
3 changes: 3 additions & 0 deletions src/lmic/lmic_compliance.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,7 @@ void acSetTimer(ostime_t delay) {
}

static void timerExpiredCb(osjob_t *j) {
LMIC_API_PARAMETER(j);
LMIC_Compliance.eventflags |= LMIC_COMPLIANCE_EVENT_TIMER_EXPIRED;
fsmEval();
}
Expand Down Expand Up @@ -734,6 +735,8 @@ static void acSendUplink(void) {
}

static void sendUplinkCompleteCb(void *pUserData, int fSuccess) {
LMIC_API_PARAMETER(pUserData);
LMIC_API_PARAMETER(fSuccess);
LMIC_Compliance.eventflags |= LMIC_COMPLIANCE_EVENT_UPLINK_COMPLETE;
LMIC_COMPLIANCE_PRINTF("%s(%s)\n", __func__, LMICcompliance_txSuccessToString(fSuccess));
fsmEvalDeferred();
Expand Down

0 comments on commit 59df2fa

Please sign in to comment.