ARM Keil 版本 5 [预期为 ')']

问题描述 投票:0回答:1

我正在使用 Keil 版本 5 工具链对 STM32F0 系列进行编程,但无法解决以下错误。 我确信我遗漏了一些东西,但很难找到它。

> ..\Core\Src\max2871.c(169): error:  #18: expected a ")"
      if (((test_data[2] & ((1 << 28) | (1 << 27) | (1 << 26))) >> 26) == 0b110)

提前致谢。

这是完整的功能块:

void plo_check_lock_status(void)
{
    // Saves the status only if the muxout pin is set correctly.
    if (((test_data[2] & ((1 << 28) | (1 << 27) | (1 << 26))) >> 26) == 0b110)
        plo_buff_push(HAL_GPIO_ReadPin(PLO_MUXOUT_GPIO_Port, PLO_MUXOUT_Pin));
    else
        HAL_NVIC_DisableIRQ(EXTI0_1_IRQn);
}
c syntax keil stm32f0
1个回答
0
投票

您使用了 if 语句,但忘记使用了 { 和 }。当你使用 if 语句时 你有两种方法:

  1. 使用单状态 if 语句和 ; 如果(...)...;

  2. 多个状态使用if语句并使用{}。 如果(...){ ... } 别的{ ... } 祝你好运

© www.soinside.com 2019 - 2024. All rights reserved.