Skip to content

Commit a915fa8

Browse files
authored
Merge pull request #3390 from jeromecoutant/PR_ST_F3_ASSERT
STM32F3 : map ST HAL assert into MBED assert
2 parents 42389c1 + 4ea65df commit a915fa8

File tree

7 files changed

+10
-11
lines changed

7 files changed

+10
-11
lines changed

targets/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F302R8/device/stm32f302x8.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11857,7 +11857,7 @@ typedef struct
1185711857
#define IS_ADC_COMMON_INSTANCE(INSTANCE) ((INSTANCE) == ADC1_COMMON)
1185811858

1185911859
/****************************** CAN Instances *********************************/
11860-
#define IS_CAN_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CAN)
11860+
#define IS_CAN_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CAN1)
1186111861

1186211862
/****************************** COMP Instances ********************************/
1186311863
#define IS_COMP_ALL_INSTANCE(INSTANCE) (((INSTANCE) == COMP2) || \

targets/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F303K8/device/stm32f303x8.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11626,7 +11626,7 @@ typedef struct
1162611626

1162711627
#define IS_ADC_COMMON_INSTANCE(INSTANCE) ((INSTANCE) == ADC12_COMMON)
1162811628
/****************************** CAN Instances *********************************/
11629-
#define IS_CAN_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CAN)
11629+
#define IS_CAN_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CAN1)
1163011630

1163111631
/****************************** COMP Instances ********************************/
1163211632
#define IS_COMP_ALL_INSTANCE(INSTANCE) (((INSTANCE) == COMP2) || \

targets/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F303RE/device/stm32f303xe.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14509,7 +14509,7 @@ typedef struct
1450914509
((INSTANCE) == ADC34_COMMON))
1451014510

1451114511
/****************************** CAN Instances *********************************/
14512-
#define IS_CAN_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CAN)
14512+
#define IS_CAN_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CAN1)
1451314513

1451414514
/****************************** COMP Instances ********************************/
1451514515
#define IS_COMP_ALL_INSTANCE(INSTANCE) (((INSTANCE) == COMP1) || \

targets/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F303ZE/device/stm32f303xe.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14509,7 +14509,7 @@ typedef struct
1450914509
((INSTANCE) == ADC34_COMMON))
1451014510

1451114511
/****************************** CAN Instances *********************************/
14512-
#define IS_CAN_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CAN)
14512+
#define IS_CAN_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CAN1)
1451314513

1451414514
/****************************** COMP Instances ********************************/
1451514515
#define IS_COMP_ALL_INSTANCE(INSTANCE) (((INSTANCE) == COMP1) || \

targets/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F334R8/device/stm32f334x8.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14581,7 +14581,7 @@ typedef struct
1458114581

1458214582
#define IS_ADC_COMMON_INSTANCE(INSTANCE) ((INSTANCE) == ADC12_COMMON)
1458314583
/****************************** CAN Instances *********************************/
14584-
#define IS_CAN_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CAN)
14584+
#define IS_CAN_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CAN1)
1458514585

1458614586
/****************************** COMP Instances ********************************/
1458714587
#define IS_COMP_ALL_INSTANCE(INSTANCE) (((INSTANCE) == COMP2) || \

targets/TARGET_STM/TARGET_STM32F3/device/stm32f3xx_hal_conf.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,8 @@
321321
* If expr is true, it returns no value.
322322
* @retval None
323323
*/
324-
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
325-
/* Exported functions ------------------------------------------------------- */
326-
void assert_failed(uint8_t* file, uint32_t line);
324+
#include "mbed_assert.h"
325+
#define assert_param(expr) MBED_ASSERT(expr)
327326
#else
328327
#define assert_param(expr) ((void)0U)
329328
#endif /* USE_FULL_ASSERT */

targets/TARGET_STM/TARGET_STM32F3/gpio_irq_api.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ void gpio_irq_free(gpio_irq_t *obj)
277277

278278
void gpio_irq_set(gpio_irq_t *obj, gpio_irq_event event, uint32_t enable)
279279
{
280-
uint32_t mode = STM_MODE_IT_EVT_RESET;
280+
uint32_t mode = STM_MODE_INPUT;
281281

282282
if (enable) {
283283
if (event == IRQ_RISE) {
@@ -304,7 +304,7 @@ void gpio_irq_set(gpio_irq_t *obj, gpio_irq_event event, uint32_t enable)
304304
mode = STM_MODE_IT_FALLING;
305305
obj->event = EDGE_FALL;
306306
} else { // NONE or RISE
307-
mode = STM_MODE_IT_EVT_RESET;
307+
mode = STM_MODE_INPUT;
308308
obj->event = EDGE_NONE;
309309
}
310310
}
@@ -313,7 +313,7 @@ void gpio_irq_set(gpio_irq_t *obj, gpio_irq_event event, uint32_t enable)
313313
mode = STM_MODE_IT_RISING;
314314
obj->event = EDGE_RISE;
315315
} else { // NONE or FALL
316-
mode = STM_MODE_IT_EVT_RESET;
316+
mode = STM_MODE_INPUT;
317317
obj->event = EDGE_NONE;
318318
}
319319
}

0 commit comments

Comments
 (0)