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 2 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
12 changes: 9 additions & 3 deletions targets/TARGET_STM/TARGET_STM32F3/spi_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,22 @@ int spi_get_clock_freq(spi_t *obj) {
#endif
#if defined SPI2_BASE
case SPI_2:
/* SPI_2 and SPI_3. Source CLK is PCKL1 */
spi_hz = HAL_RCC_GetPCLK1Freq();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: comment is not aligned

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! I fixed indent issues

break;
#endif
#if defined SPI3_BASE
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:
#endif
/* SPI_2 and SPI_3. Source CLK is PCKL1 */
spi_hz = HAL_RCC_GetPCLK1Freq();
/* SPI_4. Source CLK is PCKL2 */
spi_hz = HAL_RCC_GetPCLK2Freq();
break;
#endif
default:
error("CLK: SPI instance not set");
break;
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