Skip to content

Commit 0a40444

Browse files
authored
Merge pull request #3379 from jeromecoutant/PR_ST_F0_ASSERT
STM32F0 : map ST HAL assert into MBED assert
2 parents 38411e9 + 6aef533 commit 0a40444

File tree

6 files changed

+8
-9
lines changed

6 files changed

+8
-9
lines changed

targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F042K6/device/stm32f042x6.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10274,7 +10274,7 @@ typedef struct
1027410274
#define IS_ADC_COMMON_INSTANCE(INSTANCE) ((INSTANCE) == ADC)
1027510275

1027610276
/******************************* CAN Instances ********************************/
10277-
#define IS_CAN_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CAN)
10277+
#define IS_CAN_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CAN1)
1027810278

1027910279
/****************************** CEC Instances *********************************/
1028010280
#define IS_CEC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CEC)

targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F072RB/device/stm32f072xb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10849,7 +10849,7 @@ typedef struct
1084910849
#define IS_ADC_COMMON_INSTANCE(INSTANCE) ((INSTANCE) == ADC)
1085010850

1085110851
/******************************* CAN Instances ********************************/
10852-
#define IS_CAN_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CAN)
10852+
#define IS_CAN_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CAN1)
1085310853

1085410854
/****************************** COMP Instances *********************************/
1085510855
#define IS_COMP_ALL_INSTANCE(INSTANCE) (((INSTANCE) == COMP1) || \

targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F091RC/device/stm32f091xc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11384,7 +11384,7 @@ typedef struct
1138411384
#define IS_ADC_COMMON_INSTANCE(INSTANCE) ((INSTANCE) == ADC)
1138511385

1138611386
/******************************* CAN Instances ********************************/
11387-
#define IS_CAN_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CAN)
11387+
#define IS_CAN_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CAN1)
1138811388

1138911389
/****************************** COMP Instances *********************************/
1139011390
#define IS_COMP_ALL_INSTANCE(INSTANCE) (((INSTANCE) == COMP1) || \

targets/TARGET_STM/TARGET_STM32F0/analogin_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void analogin_init(analogin_t *obj, PinName pin) {
7171
AdcHandle.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV4;
7272
AdcHandle.Init.Resolution = ADC_RESOLUTION12b;
7373
AdcHandle.Init.DataAlign = ADC_DATAALIGN_RIGHT;
74-
AdcHandle.Init.ScanConvMode = DISABLE;
74+
AdcHandle.Init.ScanConvMode = ADC_SCAN_DIRECTION_FORWARD;
7575
AdcHandle.Init.EOCSelection = EOC_SINGLE_CONV;
7676
AdcHandle.Init.LowPowerAutoWait = DISABLE;
7777
AdcHandle.Init.LowPowerAutoPowerOff = DISABLE;

targets/TARGET_STM/TARGET_STM32F0/device/stm32f0xx_hal_conf.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,8 @@
296296
* If expr is true, it returns no value.
297297
* @retval None
298298
*/
299-
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
300-
/* Exported functions ------------------------------------------------------- */
301-
void assert_failed(uint8_t* file, uint32_t line);
299+
#include "mbed_assert.h"
300+
#define assert_param(expr) MBED_ASSERT(expr)
302301
#else
303302
#define assert_param(expr) ((void)0U)
304303
#endif /* USE_FULL_ASSERT */

targets/TARGET_STM/TARGET_STM32F0/gpio_irq_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ void gpio_irq_set(gpio_irq_t *obj, gpio_irq_event event, uint32_t enable)
240240
mode = STM_MODE_IT_FALLING;
241241
obj->event = EDGE_FALL;
242242
} else { // NONE or RISE
243-
mode = STM_MODE_IT_EVT_RESET;
243+
mode = STM_MODE_INPUT;
244244
obj->event = EDGE_NONE;
245245
}
246246
}
@@ -249,7 +249,7 @@ void gpio_irq_set(gpio_irq_t *obj, gpio_irq_event event, uint32_t enable)
249249
mode = STM_MODE_IT_RISING;
250250
obj->event = EDGE_RISE;
251251
} else { // NONE or FALL
252-
mode = STM_MODE_IT_EVT_RESET;
252+
mode = STM_MODE_INPUT;
253253
obj->event = EDGE_NONE;
254254
}
255255
}

0 commit comments

Comments
 (0)