Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove warnings #555

Merged
merged 4 commits into from
May 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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