Skip to content

Commit 8323e9a

Browse files
Sadik.OzerSadik.Ozer
authored andcommitted
Fix GCC_ARM warnings
Signed-off-by: Sadik.Ozer <Sadik.Ozer@maximintegrated.com>
1 parent 2f813fc commit 8323e9a

File tree

5 files changed

+11
-16
lines changed

5 files changed

+11
-16
lines changed

targets/TARGET_Maxim/TARGET_MAX32670/Libraries/PeriphDrivers/Source/RTC/rtc_reva.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ int MXC_RTC_RevA_GetTime(uint32_t* sec, uint32_t* subsec)
325325
// Read the seconds count.
326326
temp_sec = MXC_RTC_RevA_GetSecond();
327327

328-
if (temp_sec == E_BUSY) {
328+
if ((int)temp_sec == E_BUSY) {
329329
return E_BUSY;
330330
}
331331

targets/TARGET_Maxim/TARGET_MAX32670/Libraries/PeriphDrivers/Source/SPI/spi_me15.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,7 @@
5151
int MXC_SPI_Init(mxc_spi_regs_t* spi, int masterMode, int quadModeUsed, int numSlaves,
5252
unsigned ssPolarity, unsigned int hz, unsigned int drv_ssel)
5353
{
54-
int spi_num;
55-
56-
spi_num = MXC_SPI_GET_IDX(spi);
57-
MXC_ASSERT(spi_num >= 0);
58-
54+
5955
if (numSlaves > MXC_SPI_SS_INSTANCES) {
6056
return E_BAD_PARAM;
6157
}
@@ -91,11 +87,7 @@ int MXC_SPI_Init(mxc_spi_regs_t* spi, int masterMode, int quadModeUsed, int numS
9187
}
9288

9389
int MXC_SPI_Shutdown(mxc_spi_regs_t* spi)
94-
{
95-
int spi_num;
96-
spi_num = MXC_SPI_GET_IDX(spi);
97-
MXC_ASSERT(spi_num >= 0);
98-
90+
{
9991
MXC_SPI_RevA_Shutdown ((mxc_spi_reva_regs_t*) spi);
10092

10193
if (spi == MXC_SPI0) {

targets/TARGET_Maxim/TARGET_MAX32670/Libraries/PeriphDrivers/Source/SPI/spi_reva.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,10 @@ uint32_t MXC_SPI_RevA_TransHandler (mxc_spi_reva_regs_t *spi, mxc_spi_reva_req_t
803803
uint32_t tx_length = 0, rx_length = 0;
804804
uint8_t bits;
805805
spi_num = MXC_SPI_GET_IDX ((mxc_spi_regs_t*) spi);
806-
806+
if (spi_num == -1) {
807+
return E_BAD_PARAM;
808+
}
809+
807810
bits = MXC_SPI_GetDataSize ((mxc_spi_regs_t*) req->spi);
808811

809812
//MXC_F_SPI_REVA_CTRL2_NUMBITS data bits

targets/TARGET_Maxim/TARGET_MAX32670/Libraries/PeriphDrivers/Source/UART/uart_me15.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ int MXC_UART_ReadyForSleep(mxc_uart_regs_t* uart)
167167
int MXC_UART_SetFrequency(mxc_uart_regs_t* uart, unsigned int baud, mxc_uart_clock_t clock)
168168
{
169169
int freq;
170-
int mod = 0;
171-
int clkdiv = 0;
170+
unsigned int mod = 0;
171+
unsigned int clkdiv = 0;
172172
int div = 8;
173173

174174
if (MXC_UART_GET_IDX (uart) < 0) {
@@ -230,7 +230,7 @@ int MXC_UART_SetFrequency(mxc_uart_regs_t* uart, unsigned int baud, mxc_uart_clo
230230
freq = MXC_UART_GetFrequency (uart);
231231
}
232232
else {
233-
int clkDiv = 0, mod = 0;
233+
unsigned int clkDiv = 0, mod = 0;
234234
if (MXC_UART_GET_IDX ((mxc_uart_regs_t*) uart) < 0) {
235235
return E_BAD_PARAM;
236236
}

targets/TARGET_Maxim/TARGET_MAX32670/Libraries/PeriphDrivers/Source/UART/uart_revb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ int MXC_UART_RevB_ReadyForSleep (mxc_uart_revb_regs_t* uart)
115115

116116
int MXC_UART_RevB_SetFrequency (mxc_uart_revb_regs_t* uart, unsigned int baud, mxc_uart_revb_clock_t clock)
117117
{
118-
int clkDiv = 0, mod = 0;
118+
unsigned int clkDiv = 0, mod = 0;
119119
if (MXC_UART_GET_IDX ((mxc_uart_regs_t*) uart) < 0) {
120120
return E_BAD_PARAM;
121121
}

0 commit comments

Comments
 (0)