((void)0)是啥意思?#define assert_param(expr) ((void)0)本程序来自stm32f107/* @brief Enables or disables the High Speed APB (APB2) peripheral clock.*/void RCC_APB2PeriphClockCmd(uint32_t RCC_APB2Periph,FunctionalState NewState){/* Check the pa
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/19 15:54:38
((void)0)是啥意思?#define assert_param(expr) ((void)0)本程序来自stm32f107/* @brief Enables or disables the High Speed APB (APB2) peripheral clock.*/void RCC_APB2PeriphClockCmd(uint32_t RCC_APB2Periph,FunctionalState NewState){/* Check the pa
((void)0)是啥意思?
#define assert_param(expr) ((void)0)
本程序来自stm32f107
/* @brief Enables or disables the High Speed APB (APB2) peripheral clock.
*/
void RCC_APB2PeriphClockCmd(uint32_t RCC_APB2Periph,FunctionalState NewState)
{
/* Check the parameters */
assert_param(IS_RCC_APB2_PERIPH(RCC_APB2Periph));
assert_param(IS_FUNCTIONAL_STATE(NewState));
if (NewState = DISABLE)
{
RCC->APB2ENR |= RCC_APB2Periph;
}
else
{
RCC->APB2ENR &= RCC_APB2Periph;
}
}
#define IS_RCC_APB2_PERIPH(PERIPH) ((((PERIPH) & 0xFFC00002) == 0x00) && ((PERIPH) = 0x00))
#define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
((void)0)是啥意思?#define assert_param(expr) ((void)0)本程序来自stm32f107/* @brief Enables or disables the High Speed APB (APB2) peripheral clock.*/void RCC_APB2PeriphClockCmd(uint32_t RCC_APB2Periph,FunctionalState NewState){/* Check the pa
直接解释是:(void)0,把0强制转换为无类型,凡是用到assert_param(expr)的地方都用(void)0替换掉,具体功能看不出来
楼主把调用assert_param(expr)的地方贴出来看看