Skip to content

Commit b9449da

Browse files
authored
Merge pull request #3628 from LMESTM/fix_warnings
Fix warnings
2 parents 419982c + b63ca7e commit b9449da

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

targets/TARGET_STM/TARGET_STM32F3/spi_api.c

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,25 +55,31 @@ int spi_get_clock_freq(spi_t *obj) {
5555
/* Get source clock depending on SPI instance */
5656
switch ((int)spiobj->spi) {
5757
#if defined SPI1_BASE
58-
case SPI_1:
59-
/* SPI_1. Source CLK is PCKL2 */
60-
spi_hz = HAL_RCC_GetPCLK2Freq();
61-
break;
58+
case SPI_1:
59+
/* SPI_1. Source CLK is PCKL2 */
60+
spi_hz = HAL_RCC_GetPCLK2Freq();
61+
break;
6262
#endif
6363
#if defined SPI2_BASE
64-
case SPI_2:
64+
case SPI_2:
65+
/* SPI_2 and SPI_3. Source CLK is PCKL1 */
66+
spi_hz = HAL_RCC_GetPCLK1Freq();
67+
break;
6568
#endif
6669
#if defined SPI3_BASE
67-
case SPI_3:
70+
case SPI_3:
71+
/* SPI_2 and SPI_3. Source CLK is PCKL1 */
72+
spi_hz = HAL_RCC_GetPCLK1Freq();
73+
break;
6874
#endif
6975
#if defined SPI4_BASE
70-
case SPI_4:
76+
case SPI_4:
77+
/* SPI_4. Source CLK is PCKL2 */
78+
spi_hz = HAL_RCC_GetPCLK2Freq();
79+
break;
7180
#endif
72-
/* SPI_2 and SPI_3. Source CLK is PCKL1 */
73-
spi_hz = HAL_RCC_GetPCLK1Freq();
74-
break;
75-
default:
76-
error("CLK: SPI instance not set");
81+
default:
82+
error("CLK: SPI instance not set");
7783
break;
7884
}
7985
return spi_hz;

targets/TARGET_STM/i2c_api.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -492,14 +492,12 @@ int i2c_start(i2c_t *obj) {
492492
int i2c_stop(i2c_t *obj) {
493493
struct i2c_s *obj_s = I2C_S(obj);
494494
I2C_TypeDef *i2c = (I2C_TypeDef *)obj_s->i2c;
495-
I2C_HandleTypeDef *handle = &(obj_s->handle);
496-
int timeout;
497495

498496
// Generate the STOP condition
499497
i2c->CR1 |= I2C_CR1_STOP;
500498

501499
/* In case of mixed usage of the APIs (unitary + SYNC)
502-
* re-inti HAL state
500+
* re-init HAL state
503501
*/
504502
if(obj_s->XferOperation != I2C_FIRST_AND_LAST_FRAME)
505503
i2c_init(obj, obj_s->sda, obj_s->scl);

0 commit comments

Comments
 (0)