Skip to content

Commit 6aef533

Browse files
committed
STM32F0 : correct ST HAL API call
- CAN: compilation issue with assert enabled - ADC: init parameter was not allowed by ST HAL API - GPIO: mode was not allowed by ST HAL API
1 parent f015630 commit 6aef533

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
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/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)