Added querying packet buffer state as KISS command

This commit is contained in:
Mark Qvist 2020-05-20 16:16:04 +02:00
parent b3b87bd7c5
commit 2b25762060
3 changed files with 14 additions and 1 deletions

View File

@ -4,7 +4,7 @@
#define CONFIG_H
#define MAJ_VERS 0x01
#define MIN_VERS 0x0B
#define MIN_VERS 0x0C
#define MCU_328P 0x90
#define MCU_1284P 0x91

View File

@ -468,6 +468,12 @@ void serialCallback(uint8_t sbyte) {
promisc_disable();
}
kiss_indicate_promisc();
} else if (command == CMD_READY) {
if (!queueFull()) {
kiss_indicate_ready();
} else {
kiss_indicate_not_ready();
}
} else if (command == CMD_UNLOCK_ROM) {
if (sbyte == ROM_UNLOCK_BYTE) {
unlock_rom();

View File

@ -207,6 +207,13 @@ void kiss_indicate_ready() {
Serial.write(FEND);
}
void kiss_indicate_not_ready() {
Serial.write(FEND);
Serial.write(CMD_READY);
Serial.write(0x00);
Serial.write(FEND);
}
void kiss_indicate_promisc() {
Serial.write(FEND);
Serial.write(CMD_PROMISC);