11/*
2- * Copyright (c) 2015-2022 Arm Limited. All rights reserved.
2+ * Copyright (c) 2015-2024 Arm Limited. All rights reserved.
33 *
44 * SPDX-License-Identifier: Apache-2.0
55 *
@@ -307,15 +307,6 @@ static const char *str_cpha[] = {
307307 "CPHA1"
308308};
309309
310- static const char * str_modem_line [] = {
311- "RTS" ,
312- "CTS" ,
313- "DTR" ,
314- "DSR" ,
315- "DCD" ,
316- "RI"
317- };
318-
319310static const char * str_ret [] = {
320311 "ARM_DRIVER_OK" ,
321312 "ARM_DRIVER_ERROR" ,
@@ -796,7 +787,7 @@ static int32_t ComSendCommand (const void *data_out, uint32_t len) {
796787*/
797788static int32_t ComReceiveResponse (void * data_in , uint32_t len ) {
798789 int32_t ret ;
799- uint32_t flags , num , tout ;
790+ uint32_t flags , num ;
800791
801792 ret = EXIT_SUCCESS ;
802793 num = (len + DataBitsToBytes (USART_CFG_SRV_DATA_BITS ) - 1U ) / DataBitsToBytes (USART_CFG_SRV_DATA_BITS );
@@ -1164,7 +1155,7 @@ static int32_t CmdSetCom (uint32_t mode, uint32_t data_bits, uint32_t parity, ui
11641155 // Send "SET COM" command to USART Server
11651156 memset (ptr_tx_buf , 0 , CMD_LEN );
11661157 stat = snprintf ((char * )ptr_tx_buf , CMD_LEN , "SET COM %i,%i,%i,%i,%i,%i,%i,%i" , mode , data_bits , parity , stop_bits , flow_control , cpol , cpha , baudrate );
1167- if ((stat > 0 ) && (stat < CMD_LEN )) {
1158+ if ((stat > 0 ) && (stat < ( int32_t ) CMD_LEN )) {
11681159 ret = ComSendCommand (ptr_tx_buf , CMD_LEN );
11691160 (void )osDelay (10U );
11701161 } else {
@@ -1641,6 +1632,11 @@ static int32_t SettingsCheck (uint32_t mode, uint32_t data_bits, uint32_t parity
16411632 if (ServerCheck (mode , data_bits , parity , stop_bits , flow_control , modem_line_mask , baudrate ) != EXIT_SUCCESS ) {
16421633 return EXIT_FAILURE ;
16431634 }
1635+ #else
1636+ (void )data_bits ;
1637+ (void )parity ;
1638+ (void )stop_bits ;
1639+ (void )baudrate ;
16441640#endif
16451641
16461642 return EXIT_SUCCESS ;
@@ -1727,10 +1723,10 @@ void USART_DV_Initialize (void) {
17271723
17281724#if (USART_SERVER_USED == 1 ) // If Test Mode USART Server is selected
17291725 // Test communication with USART Server
1730- int32_t server_status ;
1731- uint32_t str_len ;
1726+ int32_t server_status ;
17321727
17331728 // Test communication with USART Server
1729+ server_status = EXIT_FAILURE ;
17341730 if (drv -> Initialize (USART_DrvEvent ) == ARM_DRIVER_OK ) {
17351731 if (drv -> PowerControl (ARM_POWER_FULL ) == ARM_DRIVER_OK ) {
17361732 server_status = ServerInit ();
@@ -1739,8 +1735,10 @@ void USART_DV_Initialize (void) {
17391735 (void )drv -> PowerControl (ARM_POWER_OFF );
17401736 (void )drv -> Uninitialize ();
17411737
1742- //(void)snprintf(msg_buf, sizeof(msg_buf), "Server status: %s\n", str_srv_status[server_status]);
1743- //TEST_GROUP_INFO(msg_buf);
1738+ if (server_status != EXIT_SUCCESS ) {
1739+ (void )snprintf (msg_buf , sizeof (msg_buf ), "Server status: %s\n" , str_srv_status [server_status ]);
1740+ TEST_GROUP_INFO (msg_buf );
1741+ }
17441742#endif
17451743}
17461744
@@ -2400,7 +2398,7 @@ static void USART_DataExchange_Operation (uint32_t operation, uint32_t mode, uin
24002398 volatile ARM_USART_STATUS usart_stat ;
24012399 volatile uint32_t tx_count , rx_count ;
24022400 uint32_t start_cnt ;
2403- uint32_t val , delay , i ;
2401+ uint32_t val , i ;
24042402 volatile uint32_t srv_delay ;
24052403 volatile uint32_t drv_delay ;
24062404 uint8_t chk_tx_data , chk_rx_data ;
@@ -2621,6 +2619,8 @@ static void USART_DataExchange_Operation (uint32_t operation, uint32_t mode, uin
26212619 (void )srv_dir ;
26222620 (void )srv_flow_control ;
26232621 (void )srv_delay ;
2622+ (void )def_tx_stat ;
2623+ (void )curr_tick ;
26242624#endif
26252625 start_tick = osKernelGetTickCount ();
26262626
@@ -4138,7 +4138,6 @@ This test function checks the following requirement:
41384138*/
41394139void USART_Baudrate_Min (void ) {
41404140 volatile uint64_t br ;
4141- volatile int32_t got_baudrate ;
41424141
41434142 if (DriverInit () != EXIT_SUCCESS ) { TEST_FAIL (); return ; }
41444143 if (SettingsCheck (USART_CFG_DEF_MODE , USART_CFG_DEF_DATA_BITS , USART_CFG_DEF_PARITY , USART_CFG_DEF_STOP_BITS , USART_CFG_DEF_FLOW_CONTROL , 0U , USART_CFG_DEF_BAUDRATE ) != EXIT_SUCCESS ) { TEST_FAIL (); return ; }
@@ -4184,7 +4183,6 @@ This test function checks the following requirement:
41844183*/
41854184void USART_Baudrate_Max (void ) {
41864185 volatile uint64_t br ;
4187- volatile int32_t got_baudrate ;
41884186
41894187 if (DriverInit () != EXIT_SUCCESS ) { TEST_FAIL (); return ; }
41904188 if (SettingsCheck (USART_CFG_DEF_MODE , USART_CFG_DEF_DATA_BITS , USART_CFG_DEF_PARITY , USART_CFG_DEF_STOP_BITS , USART_CFG_DEF_FLOW_CONTROL , 0U , USART_CFG_DEF_BAUDRATE ) != EXIT_SUCCESS ) { TEST_FAIL (); return ; }
0 commit comments