Adding LEDs selftest blink

This commit is contained in:
Andy CA6JAU 2017-08-20 13:22:34 -03:00
parent c74b374636
commit 2befa42405
2 changed files with 59 additions and 26 deletions

34
IO.cpp
View file

@ -57,10 +57,42 @@ m_watchdog(0U)
SCLK_pin(LOW);
SDATA_pin(LOW);
SLE_pin(LOW);
selfTest();
m_modeTimerCnt = 0;
}
void CIO::selfTest()
{
bool ledValue = false;
uint32_t ledCount = 0;
uint32_t blinks = 0;
while(true) {
ledCount++;
delay_us(1000);
if(ledCount >= 125U) {
ledCount = 0U;
ledValue = !ledValue;
LED_pin(!ledValue);
PTT_pin(ledValue);
DSTAR_pin(ledValue);
DMR_pin(ledValue);
YSF_pin(ledValue);
P25_pin(ledValue);
COS_pin(ledValue);
blinks++;
if(blinks > 5)
break;
}
}
}
void CIO::process()
{
uint8_t bit;