staticQueueHandle_tShellSymbol_Queue;staticSemaphoreHandle_tShellCommand_Mutex;boolShellRoot_SendChar(charch,u32waitTmo){if(xSemaphoreTake(ShellCommand_Mutex,waitTmo)!=pdTRUE)returnfalse;// Need mutex here in case of ShellRoot_SendCommand simultaneous usingboolret=(bool)(xQueueSend(ShellSymbol_Queue,&ch,waitTmo)==pdPASS);xSemaphoreGive(ShellCommand_Mutex);returnret;}boolShellRoot_SendCharFromISR(charch,BaseType_t*pWoken){if(xSemaphoreTakeFromISR(ShellCommand_Mutex,pWoken)!=pdTRUE)returnfalse;// Need mutex here in case of ShellRoot_SendCommand simultaneous usingboolret=(bool)(xQueueSendFromISR(ShellSymbol_Queue,&ch,pWoken)==pdPASS);xSemaphoreGiveFromISR(ShellCommand_Mutex,pWoken);returnret;}boolShellRoot_SendCommand(char*pCmd,u32waitTmo){ASSERT_CHECK(pCmd);if(!pCmd)returnfalse;if(!WshShell_IsAuth(&ShellRoot))returnfalse;if(xSemaphoreTake(ShellCommand_Mutex,waitTmo)!=pdTRUE)returnfalse;u32cmdLen=strlen(pCmd);if(cmdLen>=Shell_Hardware_GetRxBuffLen()){xSemaphoreGive(ShellCommand_Mutex);PANIC();returnfalse;}for(u32i=0;i<cmdLen;i++){if(xQueueSend(ShellSymbol_Queue,&pCmd[i],waitTmo)!=pdTRUE){xSemaphoreGive(ShellCommand_Mutex);PANIC();returnfalse;}}// Send trailing '\n' to simulate Enter keycharnewLine='\n';if(xQueueSend(ShellSymbol_Queue,&newLine,waitTmo)!=pdTRUE){xSemaphoreGive(ShellCommand_Mutex);PANIC();returnfalse;}xSemaphoreGive(ShellCommand_Mutex);returntrue;}