Merge pull request #3390 from jeromecoutant/PR_ST_F3_ASSERT

STM32F3 : map ST HAL assert into MBED assert
pull/3451/head
Anna Bridge 2016-12-19 17:24:26 +00:00 committed by GitHub
commit a915fa86e4
7 changed files with 10 additions and 11 deletions

View File

@ -11857,7 +11857,7 @@ typedef struct
#define IS_ADC_COMMON_INSTANCE(INSTANCE) ((INSTANCE) == ADC1_COMMON) #define IS_ADC_COMMON_INSTANCE(INSTANCE) ((INSTANCE) == ADC1_COMMON)
/****************************** CAN Instances *********************************/ /****************************** CAN Instances *********************************/
#define IS_CAN_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CAN) #define IS_CAN_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CAN1)
/****************************** COMP Instances ********************************/ /****************************** COMP Instances ********************************/
#define IS_COMP_ALL_INSTANCE(INSTANCE) (((INSTANCE) == COMP2) || \ #define IS_COMP_ALL_INSTANCE(INSTANCE) (((INSTANCE) == COMP2) || \

View File

@ -11626,7 +11626,7 @@ typedef struct
#define IS_ADC_COMMON_INSTANCE(INSTANCE) ((INSTANCE) == ADC12_COMMON) #define IS_ADC_COMMON_INSTANCE(INSTANCE) ((INSTANCE) == ADC12_COMMON)
/****************************** CAN Instances *********************************/ /****************************** CAN Instances *********************************/
#define IS_CAN_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CAN) #define IS_CAN_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CAN1)
/****************************** COMP Instances ********************************/ /****************************** COMP Instances ********************************/
#define IS_COMP_ALL_INSTANCE(INSTANCE) (((INSTANCE) == COMP2) || \ #define IS_COMP_ALL_INSTANCE(INSTANCE) (((INSTANCE) == COMP2) || \

View File

@ -14509,7 +14509,7 @@ typedef struct
((INSTANCE) == ADC34_COMMON)) ((INSTANCE) == ADC34_COMMON))
/****************************** CAN Instances *********************************/ /****************************** CAN Instances *********************************/
#define IS_CAN_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CAN) #define IS_CAN_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CAN1)
/****************************** COMP Instances ********************************/ /****************************** COMP Instances ********************************/
#define IS_COMP_ALL_INSTANCE(INSTANCE) (((INSTANCE) == COMP1) || \ #define IS_COMP_ALL_INSTANCE(INSTANCE) (((INSTANCE) == COMP1) || \

View File

@ -14509,7 +14509,7 @@ typedef struct
((INSTANCE) == ADC34_COMMON)) ((INSTANCE) == ADC34_COMMON))
/****************************** CAN Instances *********************************/ /****************************** CAN Instances *********************************/
#define IS_CAN_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CAN) #define IS_CAN_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CAN1)
/****************************** COMP Instances ********************************/ /****************************** COMP Instances ********************************/
#define IS_COMP_ALL_INSTANCE(INSTANCE) (((INSTANCE) == COMP1) || \ #define IS_COMP_ALL_INSTANCE(INSTANCE) (((INSTANCE) == COMP1) || \

View File

@ -14581,7 +14581,7 @@ typedef struct
#define IS_ADC_COMMON_INSTANCE(INSTANCE) ((INSTANCE) == ADC12_COMMON) #define IS_ADC_COMMON_INSTANCE(INSTANCE) ((INSTANCE) == ADC12_COMMON)
/****************************** CAN Instances *********************************/ /****************************** CAN Instances *********************************/
#define IS_CAN_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CAN) #define IS_CAN_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CAN1)
/****************************** COMP Instances ********************************/ /****************************** COMP Instances ********************************/
#define IS_COMP_ALL_INSTANCE(INSTANCE) (((INSTANCE) == COMP2) || \ #define IS_COMP_ALL_INSTANCE(INSTANCE) (((INSTANCE) == COMP2) || \

View File

@ -321,9 +321,8 @@
* If expr is true, it returns no value. * If expr is true, it returns no value.
* @retval None * @retval None
*/ */
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) #include "mbed_assert.h"
/* Exported functions ------------------------------------------------------- */ #define assert_param(expr) MBED_ASSERT(expr)
void assert_failed(uint8_t* file, uint32_t line);
#else #else
#define assert_param(expr) ((void)0U) #define assert_param(expr) ((void)0U)
#endif /* USE_FULL_ASSERT */ #endif /* USE_FULL_ASSERT */

View File

@ -277,7 +277,7 @@ void gpio_irq_free(gpio_irq_t *obj)
void gpio_irq_set(gpio_irq_t *obj, gpio_irq_event event, uint32_t enable) void gpio_irq_set(gpio_irq_t *obj, gpio_irq_event event, uint32_t enable)
{ {
uint32_t mode = STM_MODE_IT_EVT_RESET; uint32_t mode = STM_MODE_INPUT;
if (enable) { if (enable) {
if (event == IRQ_RISE) { if (event == IRQ_RISE) {
@ -304,7 +304,7 @@ void gpio_irq_set(gpio_irq_t *obj, gpio_irq_event event, uint32_t enable)
mode = STM_MODE_IT_FALLING; mode = STM_MODE_IT_FALLING;
obj->event = EDGE_FALL; obj->event = EDGE_FALL;
} else { // NONE or RISE } else { // NONE or RISE
mode = STM_MODE_IT_EVT_RESET; mode = STM_MODE_INPUT;
obj->event = EDGE_NONE; obj->event = EDGE_NONE;
} }
} }
@ -313,7 +313,7 @@ void gpio_irq_set(gpio_irq_t *obj, gpio_irq_event event, uint32_t enable)
mode = STM_MODE_IT_RISING; mode = STM_MODE_IT_RISING;
obj->event = EDGE_RISE; obj->event = EDGE_RISE;
} else { // NONE or FALL } else { // NONE or FALL
mode = STM_MODE_IT_EVT_RESET; mode = STM_MODE_INPUT;
obj->event = EDGE_NONE; obj->event = EDGE_NONE;
} }
} }