Skip to content

Fix warnings #3628

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

Merged
merged 3 commits into from
Feb 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions targets/TARGET_STM/TARGET_STM32F3/spi_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,31 @@ int spi_get_clock_freq(spi_t *obj) {
/* Get source clock depending on SPI instance */
switch ((int)spiobj->spi) {
#if defined SPI1_BASE
case SPI_1:
/* SPI_1. Source CLK is PCKL2 */
spi_hz = HAL_RCC_GetPCLK2Freq();
break;
case SPI_1:
/* SPI_1. Source CLK is PCKL2 */
spi_hz = HAL_RCC_GetPCLK2Freq();
break;
#endif
#if defined SPI2_BASE
case SPI_2:
case SPI_2:
/* SPI_2 and SPI_3. Source CLK is PCKL1 */
spi_hz = HAL_RCC_GetPCLK1Freq();
break;
#endif
#if defined SPI3_BASE
case SPI_3:
case SPI_3:
/* SPI_2 and SPI_3. Source CLK is PCKL1 */
spi_hz = HAL_RCC_GetPCLK1Freq();
break;
#endif
#if defined SPI4_BASE
case SPI_4:
case SPI_4:
/* SPI_4. Source CLK is PCKL2 */
spi_hz = HAL_RCC_GetPCLK2Freq();
break;
#endif
/* SPI_2 and SPI_3. Source CLK is PCKL1 */
spi_hz = HAL_RCC_GetPCLK1Freq();
break;
default:
error("CLK: SPI instance not set");
default:
error("CLK: SPI instance not set");
break;
}
return spi_hz;
Expand Down
4 changes: 1 addition & 3 deletions targets/TARGET_STM/i2c_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,14 +492,12 @@ int i2c_start(i2c_t *obj) {
int i2c_stop(i2c_t *obj) {
struct i2c_s *obj_s = I2C_S(obj);
I2C_TypeDef *i2c = (I2C_TypeDef *)obj_s->i2c;
I2C_HandleTypeDef *handle = &(obj_s->handle);
int timeout;

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

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