This commit is contained in:
Andrey 2023-03-02 21:29:40 -05:00
parent 48ff799ce7
commit 157e5fcf9e
1 changed files with 11 additions and 0 deletions

View File

@ -8,6 +8,8 @@ static SerialDriver* const klDriver = KLINE_SERIAL_DEVICE;
static THD_WORKING_AREA(klThreadStack, UTILITY_THREAD_STACK_SIZE);
static int totalBytes = 0;
static bool kLineOutPending = false;
static int kLineOut;
void kLineThread(void*)
{
@ -20,6 +22,11 @@ void kLineThread(void*)
efiPrintf("kline: 0x%02x", ch);
totalBytes++;
}
if (kLineOutPending) {
kLineOutPending = false;
efiPrintf("kline OUT: 0x%02x", kLineOut);
chnWrite(klDriver, (const uint8_t *)kLineOut, 1);
}
}
}
#endif
@ -47,6 +54,10 @@ void startKLine() {
addConsoleAction("kline", [](){
efiPrintf("kline totalBytes %d", totalBytes);
});
addConsoleActionI("klinesend", [](int value){
kLineOutPending = true;
kLineOut = value;
});
#endif
}