Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
markqvist committed Jan 17, 2025
1 parent 458e40c commit 919bddb
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions sx126x.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,30 +389,12 @@ int sx126x::endPacket() {
if (timed_out) { return 0; } else { return 1; }
}

/////////////////////////////////////////
// #define PIN_PREAMBLE 46
// #define PIN_HEADER 45
// #define PIN_FALSE 48
// #define PIN_DCD 47
// bool ps = false;
/////////////////////////////////////////

unsigned long preamble_detected_at = 0;
extern long lora_preamble_time_ms;
extern long lora_header_time_ms;
bool false_preamble_detected = false;

bool sx126x::dcd() {
/////////////////////////////////////////
// if (!ps) {
// pinMode(PIN_PREAMBLE, OUTPUT);
// pinMode(PIN_HEADER, OUTPUT);
// pinMode(PIN_FALSE, OUTPUT);
// pinMode(PIN_DCD, OUTPUT);
// ps = true;
// }
/////////////////////////////////////////

uint8_t buf[2] = {0}; executeOpcodeRead(OP_GET_IRQ_STATUS_6X, buf, 2);
uint32_t now = millis();

Expand All @@ -434,11 +416,6 @@ bool sx126x::dcd() {
}
}

// if (preamble_detected_at != 0) { digitalWrite(PIN_PREAMBLE, HIGH); } else { digitalWrite(PIN_PREAMBLE, LOW); }
// if (header_detected) { digitalWrite(PIN_HEADER, HIGH); } else { digitalWrite(PIN_HEADER, LOW); }
// if (false_preamble_detected) { digitalWrite(PIN_FALSE, HIGH); } else { digitalWrite(PIN_FALSE, LOW); }
// if (carrier_detected) { digitalWrite(PIN_DCD, HIGH); } else { digitalWrite(PIN_DCD, LOW); }

// TODO: Maybe there's a way of unlatching the RSSI
// status without re-activating receive mode?
if (false_preamble_detected) { sx126x_modem.receive(); false_preamble_detected = false; }
Expand Down

0 comments on commit 919bddb

Please sign in to comment.