Skip to content

Commit

Permalink
[SMC] Fix uart settings not beign set correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
bitsh1ft3r committed Feb 14, 2025
1 parent dca4aa2 commit 2a33139
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Xenon/Core/RootBus/HostBridge/PCIBridge/SMC/SMC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,12 @@ void Xe::PCIDev::SMC::SMCCore::setupUART(u32 uartConfig) {
// Initialize the DCB structure.
SecureZeroMemory(&smcCoreState->comPortDCB, sizeof(DCB));
smcCoreState->comPortDCB.DCBlength = sizeof(DCB);

// Get Current COM Port State
if (!GetCommState(smcCoreState->comPortHandle, &smcCoreState->comPortDCB)) {
LOG_ERROR(SMC, "UART: GetCommState failed with error {:#x}.", GetLastError());
}

switch (uartConfig) {
case 0x1e6:
LOG_INFO(SMC, " * BaudRate: 115200bps, DataSize: 8, Parity: N, StopBits: 1.");
Expand Down Expand Up @@ -314,10 +320,6 @@ void Xe::PCIDev::SMC::SMCCore::setupUART(u32 uartConfig) {
return;
}

// Get Current COM Port State
if (!GetCommState(smcCoreState->comPortHandle, &smcCoreState->comPortDCB)) {
LOG_ERROR(SMC, "UART: GetCommState failed with error {:#x}.", GetLastError());
}
// Set The COM Port State as per config value.
if (!SetCommState(smcCoreState->comPortHandle, &smcCoreState->comPortDCB)) {
LOG_ERROR(SMC, "UART: SetCommState failed with error {:#x}.", GetLastError());
Expand Down

0 comments on commit 2a33139

Please sign in to comment.