Merge pull request #11 from tkerby/master

Bug fixes - frame counter, link checking and battery charge status
This commit is contained in:
Kyle Gabriel 2020-01-20 11:11:15 -05:00 committed by GitHub
commit 4d4f0545f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 1 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
main/configuration.h
main/credentials.h

View File

@ -263,6 +263,9 @@ void setup() {
ttn_join(); ttn_join();
ttn_sf(LORAWAN_SF); ttn_sf(LORAWAN_SF);
ttn_adr(LORAWAN_ADR); ttn_adr(LORAWAN_ADR);
if(!LORAWAN_ADR){
LMIC_setLinkCheckMode(0); // Link check problematic if not using ADR. Must be set after join
}
} }
void loop() { void loop() {

View File

@ -115,6 +115,7 @@ void screen_loop() {
if (axp.isVbusRemoveIRQ()) { if (axp.isVbusRemoveIRQ()) {
baChStatus = "No Charging"; baChStatus = "No Charging";
} }
Serial.println(baChStatus); //Prints charging status to screen
digitalWrite(2, !digitalRead(2)); digitalWrite(2, !digitalRead(2));
axp.clearIRQ(); axp.clearIRQ();
} }

View File

@ -230,9 +230,10 @@ void ttn_sf(unsigned char sf) {
void ttn_adr(bool enabled) { void ttn_adr(bool enabled) {
LMIC_setAdrMode(enabled); LMIC_setAdrMode(enabled);
LMIC_setLinkCheckMode(!enabled);
} }
void ttn_cnt(unsigned char num) { void ttn_cnt(uint32_t num) {
LMIC_setSeqnoUp(num); LMIC_setSeqnoUp(num);
} }