compiler warning sanitizations
This commit is contained in:
parent
438b3485e5
commit
a6cbc2479e
@ -206,7 +206,7 @@ uint8_t GetCharWidth(char cChar) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ScrollMatrixLeft(uint8_t *buf, const uint16_t cols, const uint16_t rows) {
|
void ScrollMatrixLeft(uint8_t *buf, const uint16_t cols, const uint16_t rows) {
|
||||||
uint32_t i, k, idx;
|
uint32_t i, k, idx = 0;
|
||||||
const uint32_t x = cols / 8;
|
const uint32_t x = cols / 8;
|
||||||
|
|
||||||
for (k = 0; k < rows; k++) {
|
for (k = 0; k < rows; k++) {
|
||||||
|
@ -22,6 +22,12 @@
|
|||||||
#define LMIC_USE_INTERRUPTS 1
|
#define LMIC_USE_INTERRUPTS 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// avoid lmic warning if we don't configure radio because we don't have one
|
||||||
|
#define CFG_sx1276_radio 1
|
||||||
|
#if ! (defined(CFG_sx1272_radio) || defined(CFG_sx1276_radio))
|
||||||
|
#define CFG_sx1276_radio 1
|
||||||
|
#endif
|
||||||
|
|
||||||
// time sync via LoRaWAN network, note: not supported by TTNv2
|
// time sync via LoRaWAN network, note: not supported by TTNv2
|
||||||
#define LMIC_ENABLE_DeviceTimeReq 1
|
#define LMIC_ENABLE_DeviceTimeReq 1
|
||||||
|
|
||||||
|
@ -136,9 +136,9 @@ void RevBytes(unsigned char *b, size_t c) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// LMIC callback functions
|
// LMIC callback functions
|
||||||
void os_getDevKey(u1_t *buf) {
|
void os_getDevKey(u1_t *buf) {
|
||||||
#ifndef LORA_ABP
|
#ifndef LORA_ABP
|
||||||
memcpy(buf, APPKEY, 16);
|
memcpy(buf, APPKEY, 16);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -306,30 +306,30 @@ esp_err_t lora_stack_init(bool do_join) {
|
|||||||
&lmicTask, // task handle
|
&lmicTask, // task handle
|
||||||
1); // CPU core
|
1); // CPU core
|
||||||
|
|
||||||
#ifdef LORA_ABP
|
#ifdef LORA_ABP
|
||||||
// Pass ABP parameters to LMIC_setSession
|
// Pass ABP parameters to LMIC_setSession
|
||||||
|
LMIC_reset();
|
||||||
|
uint8_t appskey[sizeof(APPSKEY)];
|
||||||
|
uint8_t nwkskey[sizeof(NWKSKEY)];
|
||||||
|
memcpy_P(appskey, APPSKEY, sizeof(APPSKEY));
|
||||||
|
memcpy_P(nwkskey, NWKSKEY, sizeof(NWKSKEY));
|
||||||
|
LMIC_setSession(NETID, DEVADDR, nwkskey, appskey);
|
||||||
|
// These parameters are defined as macro in loraconf.h
|
||||||
|
setABPParamaters();
|
||||||
|
#else
|
||||||
|
// Start join procedure if not already joined,
|
||||||
|
// lora_setupForNetwork(true) is called by eventhandler when joined
|
||||||
|
// else continue current session
|
||||||
|
if (do_join) {
|
||||||
|
if (!LMIC_startJoining())
|
||||||
|
ESP_LOGI(TAG, "Already joined");
|
||||||
|
} else {
|
||||||
LMIC_reset();
|
LMIC_reset();
|
||||||
uint8_t appskey[sizeof(APPSKEY)];
|
LMIC_setSession(RTCnetid, RTCdevaddr, RTCnwkKey, RTCartKey);
|
||||||
uint8_t nwkskey[sizeof(NWKSKEY)];
|
LMIC.seqnoUp = RTCseqnoUp;
|
||||||
memcpy_P(appskey, APPSKEY, sizeof(APPSKEY));
|
LMIC.seqnoDn = RTCseqnoDn;
|
||||||
memcpy_P(nwkskey, NWKSKEY, sizeof(NWKSKEY));
|
}
|
||||||
LMIC_setSession (NETID, DEVADDR, nwkskey, appskey);
|
#endif
|
||||||
// These parameters are defined as macro in loraconf.h
|
|
||||||
setABPParamaters();
|
|
||||||
#else
|
|
||||||
// Start join procedure if not already joined,
|
|
||||||
// lora_setupForNetwork(true) is called by eventhandler when joined
|
|
||||||
// else continue current session
|
|
||||||
if (do_join) {
|
|
||||||
if (!LMIC_startJoining())
|
|
||||||
ESP_LOGI(TAG, "Already joined");
|
|
||||||
} else {
|
|
||||||
LMIC_reset();
|
|
||||||
LMIC_setSession(RTCnetid, RTCdevaddr, RTCnwkKey, RTCartKey);
|
|
||||||
LMIC.seqnoUp = RTCseqnoUp;
|
|
||||||
LMIC.seqnoDn = RTCseqnoDn;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
// start lmic send task
|
// start lmic send task
|
||||||
xTaskCreatePinnedToCore(lora_send, // task function
|
xTaskCreatePinnedToCore(lora_send, // task function
|
||||||
"lorasendtask", // name of task
|
"lorasendtask", // name of task
|
||||||
|
@ -170,6 +170,8 @@ void timesync_store(uint32_t timestamp, timesync_t timestamp_type) {
|
|||||||
// callback function to receive time answer from network or answer
|
// callback function to receive time answer from network or answer
|
||||||
void IRAM_ATTR timesync_serverAnswer(void *pUserData, int flag) {
|
void IRAM_ATTR timesync_serverAnswer(void *pUserData, int flag) {
|
||||||
|
|
||||||
|
#if (TIME_SYNC_LORASERVER) || (TIME_SYNC_LORAWAN)
|
||||||
|
|
||||||
// if no timesync handshake is pending then exit
|
// if no timesync handshake is pending then exit
|
||||||
if (!timeSyncPending)
|
if (!timeSyncPending)
|
||||||
return;
|
return;
|
||||||
@ -269,4 +271,6 @@ Exit:
|
|||||||
// inform processing task
|
// inform processing task
|
||||||
xTaskNotify(timeSyncProcTask, (rc ? rcv_seqNo : TIME_SYNC_END_FLAG),
|
xTaskNotify(timeSyncProcTask, (rc ? rcv_seqNo : TIME_SYNC_END_FLAG),
|
||||||
eSetBits);
|
eSetBits);
|
||||||
|
|
||||||
|
#endif // (TIME_SYNC_LORASERVER) || (TIME_SYNC_LORAWAN)
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user