From 8ea28ca7e869dc5cc5108b0c1b744168bccdfc44 Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Mon, 8 Aug 2022 10:49:23 -0400 Subject: [PATCH] size of CMD_STATUS was wrong; make startup LED sequence more similar to the regular repeater modem; --- IO.cpp | 102 ++++++++++++++++++++++++++++++++++++++++--------- SerialPort.cpp | 2 +- 2 files changed, 84 insertions(+), 20 deletions(-) diff --git a/IO.cpp b/IO.cpp index b9fc5c0..3ef9499 100644 --- a/IO.cpp +++ b/IO.cpp @@ -344,30 +344,94 @@ uint32_t IO::getWatchdog() void IO::selfTest() { bool ledValue = false; - uint32_t ledCount = 0U; - uint32_t blinks = 0U; - while (true) { - ledCount++; - delayUS(1000U); + for (uint8_t i = 0; i < 6; i++) { + ledValue = !ledValue; - if (ledCount >= 125U) { - ledCount = 0U; - ledValue = !ledValue; + // We exclude PTT to avoid trigger the transmitter + setLEDInt(ledValue); + setCOSInt(ledValue); - setLEDInt(!ledValue); - setPTTInt(ledValue); - setDMRInt(ledValue); - setP25Int(ledValue); - setNXDNInt(ledValue); - setCOSInt(ledValue); + setDMRInt(ledValue); + setP25Int(ledValue); + setNXDNInt(ledValue); - blinks++; - - if (blinks > 5U) - break; - } + delayUS(250); } + + // blinkin lights + setLEDInt(false); + setCOSInt(false); + setDMRInt(false); + setP25Int(false); + setNXDNInt(false); + delayUS(250); + + setLEDInt(true); + setCOSInt(false); + setDMRInt(false); + setP25Int(false); + delayUS(250); + + setLEDInt(false); + setCOSInt(true); + setDMRInt(false); + setP25Int(false); + delayUS(250); + + setLEDInt(false); + setCOSInt(false); + setDMRInt(true); + setP25Int(false); + delayUS(250); + + setLEDInt(false); + setCOSInt(false); + setDMRInt(false); + setP25Int(true); + delayUS(250); + + setLEDInt(false); + setCOSInt(false); + setDMRInt(false); + setP25Int(false); + setNXDNInt(true); + delayUS(250); + + setLEDInt(false); + setCOSInt(false); + setDMRInt(false); + setP25Int(true); + setNXDNInt(false); + delayUS(250); + + setLEDInt(false); + setCOSInt(false); + setDMRInt(true); + setP25Int(false); + setNXDNInt(false); + delayUS(250); + + setLEDInt(false); + setCOSInt(true); + setDMRInt(false); + setP25Int(false); + setNXDNInt(false); + delayUS(250); + + setLEDInt(true); + setCOSInt(false); + setDMRInt(false); + setP25Int(false); + setNXDNInt(false); + delayUS(250); + + setLEDInt(false); + setCOSInt(false); + setDMRInt(false); + setP25Int(false); + setNXDNInt(false); + delayUS(250); } /// diff --git a/SerialPort.cpp b/SerialPort.cpp index 1dad0ad..6123320 100644 --- a/SerialPort.cpp +++ b/SerialPort.cpp @@ -878,7 +878,7 @@ void SerialPort::getStatus() // send all sorts of interesting internal values reply[0U] = DVM_FRAME_START; - reply[1U] = 11U; + reply[1U] = 12U; reply[2U] = CMD_GET_STATUS; reply[3U] = 0x01U;