Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Silabs][SiWx917] Fixing uart to read only once #25902

Merged
merged 10 commits into from
Apr 11, 2023
9 changes: 0 additions & 9 deletions examples/platform/silabs/SiWx917/uart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,8 @@ extern ARM_DRIVER_USART Driver_USART0;
static ARM_DRIVER_USART * UARTdrv = &Driver_USART0;

ARM_USART_CAPABILITIES drv_capabilities;
ARM_USART_STATUS status;

#define BUFFER_SIZE 1
uint8_t rx_buffer;

#define BAUD_VALUE 115200

#define UART_CONSOLE_ERR -1 // Negative value in case of UART Console action failed. Triggers a failure for PW_RPC

void ARM_USART_SignalEvent(uint32_t event);
Expand Down Expand Up @@ -141,10 +136,6 @@ void uartConsoleInit(void)
DEBUGOUT("\r\n Receives data success \r\n");
}

// Creating the receive event as a temp buffer
// this is not used anywhere
status = UARTdrv->Receive(&rx_buffer, 1);

NVIC_EnableIRQ(USART0_IRQn);

NVIC_SetPriority(USART0_IRQn, 7);
Expand Down
12 changes: 4 additions & 8 deletions src/lib/shell/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,11 @@ static_library("shell") {
"MainLoopESP32.cpp",
"streamer_esp32.cpp",
]
} else if (chip_device_platform == "efr32") {
} else if (chip_device_platform == "efr32" ||
chip_device_platform == "SiWx917") {
sources += [
"MainLoopEFR32.cpp",
"streamer_efr32.cpp",
]
} else if (chip_device_platform == "SiWx917") {
sources += [
"MainLoopEFR32.cpp",
"streamer_efr32.cpp",
"MainLoopSilabs.cpp",
"streamer_silabs.cpp",
]
} else if (chip_device_platform == "k32w0") {
sources += [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,19 @@ void ReadLine(char * buffer, size_t max)
break;
}

#ifdef BRD4325A
chirag-silabs marked this conversation as resolved.
Show resolved Hide resolved
if (streamer_read(streamer_get(), buffer + line_sz, 1) != 1)
{
continue;
}
#endif
chip::WaitForShellActivity();
#ifndef BRD4325A
if (streamer_read(streamer_get(), buffer + line_sz, 1) != 1)
{
continue;
}
#endif

// Process character we just read.
switch (buffer[line_sz])
Expand Down
File renamed without changes.