Added the ability to invert SD_DETECT for cardholders with a normally open contact to determine the presence of a card.

This commit is contained in:
Dmitriy Logachov 2021-01-13 15:10:59 +05:00
parent 596539f0cd
commit 7f8dfae211
5 changed files with 28 additions and 3 deletions

View file

@ -613,6 +613,15 @@ void kiss_serialCallback(uint8_t sbyte) {
if (sbyte == 0x00) {
kiss_output_modem_mode();
}
} else if (command == CMD_INVERT_SDDETECT) {
if (sbyte == FESC) { ESCAPE = true; } else {
if (ESCAPE) {
if (sbyte == TFEND) sbyte = FEND;
if (sbyte == TFESC) sbyte = FESC;
ESCAPE = false;
}
config_set_invert_sddetect(sbyte);
}
}
}
}

View file

@ -37,6 +37,7 @@
#define CMD_NMEA 0x40
#define CMD_PRINT_CONFIG 0xF0
#define CMD_RETURN 0xFF
#define CMD_INVERT_SDDETECT 0x15
void kiss_init(AX25Ctx *ax25, Afsk *afsk, Serial *ser);
void kiss_messageCallback(AX25Ctx *ctx);