const int pin_dio = 2;
const int pin_led_rx = 5;
const int pin_led_tx = 4;
+
+ #define FLOW_CONTROL_ENABLED true
+ #define QUEUE_SIZE 0
#endif
#if MCU_VARIANT == MCU_1284P
const int pin_dio = 2;
const int pin_led_rx = 12;
const int pin_led_tx = 13;
+
+ #define FLOW_CONTROL_ENABLED true
+ #define QUEUE_SIZE 24
#endif
// MCU independent configuration parameters
// Default LoRa settings
int lora_sf = 0;
+ int lora_cr = 5;
int lora_txp = 0xFF;
uint32_t lora_bw = 0;
uint32_t lora_freq = 0;
#define CMD_SF 0x04
#define CMD_RADIO_STATE 0x05
#define CMD_RADIO_LOCK 0x06
+ #define CMD_READY 0x0F
#define CMD_STAT_RX 0x21
#define CMD_STAT_TX 0x22
setTXPower();
setBandwidth();
setSpreadingFactor();
+ setCodingRate();
getFrequency();
LoRa.enableCrc();
LoRa.endPacket();
led_tx_off();
LoRa.receive();
+
+ if (FLOW_CONTROL_ENABLED)
+ kiss_indicate_ready();
+
} else {
kiss_indicate_error(ERROR_TXFAILED);
led_indicate_error(5);
Serial.write(FEND);
}
+void kiss_indicate_ready() {
+ Serial.write(FEND);
+ Serial.write(CMD_READY);
+ Serial.write(0x01);
+ Serial.write(FEND);
+}
+
bool isSplitPacket(uint8_t header) {
return (header & FLAG_SPLIT);
}
if (radio_online) LoRa.setSpreadingFactor(lora_sf);
}
+void setCodingRate() {
+ if (radio_online) LoRa.setCodingRate4(lora_cr);
+}
+
void setTXPower() {
if (radio_online) LoRa.setTxPower(lora_txp);
}