求助下! 为什么出现expected ')' before '! ' token这个错误啊!
代码我贴在这里 麻烦大神解答下!万分感谢

#include <stdio.h>
#include "platform.h"
#include "axi_pwm.h"
#include "xparameters.h"
#include "xgpio.h"
#include "xil_printf.h"
//void print(char *str);
#define GPIO_BITWIDTH 8
#define GPIO_DEVICE_ID XPAR_AXI_GPIO_0_DEVICE_ID//device ID
#define LED_DELAY 10000000
#define LED_MAX_BLINK 0x1
#define LED_CHANNEL 1
#define printf xil_printf
#define PWM_BASEADDR XPAR_AXI_PWM_0_S00_AXI_BASEADDR
XGpio Gpio;
XGpio GpioOutput;
int GpioMarquee (u16 DeviceId, u32 GpioWidth)
{
volatile int Delay;
u32 LedBit;
u32 LedLoop;
int Status;
Status = XGpio_Initialize(&GpioOutput, DeviceId);
if (Status ! = XST_SUCCESS) //就是在这里 提示有错!
{
return XST_FAILURE;
}
XGpio_SetDataDirection(&GpioOutput, LED_CHANNEL, 0x0);
XGpio_DiscreteWrite(&GpioOutput, LED_CHANNEL, 0x0);
for (LedBit = 0x0; LedBit < GpioWidth; LedBit ++){
for(LedLoop = 0; LedLoop < LED_MAX_BLINK; LedLoop ++){
XGpio_DiscreteWrite(&GpioOutput,LED_CHANNEL,
1 << LedBit);
for (Delay = 0; Delay < LED_DELAY; Delay ++);
XGpio_DiscreteClear(&GpioOutput, LED_CHANNEL,
1 << LedBit);
for (Delay = 0; Delay < LED_DELAY; Delay ++);
}
}
return XST_SUCCESS;
}
int main()
{
init_platform();
print("Hello World\n\r");
AXI_PWM_mWriteReg(PWM_BASEADDR,
AXI_PWM_S00_AXI_SLV_REG0_OFFSET,10000);
AXI_PWM_mWriteReg(PWM_BASEADDR,
AXI_PWM_S00_AXI_SLV_REG1_OFFSET, 0x80000000 + 5000);
u32 status;
status = GpioMarquee (GPIO_DEVICE_ID,GPIO_BITWIDTH);
if (status == 0)print("SUCESS!.\r\n");
else printf("FAILED.\r\n");
return 0;
}

#include <stdio.h>
#include "platform.h"
#include "axi_pwm.h"
#include "xparameters.h"
#include "xgpio.h"
#include "xil_printf.h"
//void print(char *str);
#define GPIO_BITWIDTH 8
#define GPIO_DEVICE_ID XPAR_AXI_GPIO_0_DEVICE_ID//device ID
#define LED_DELAY 10000000
#define LED_MAX_BLINK 0x1
#define LED_CHANNEL 1
#define printf xil_printf
#define PWM_BASEADDR XPAR_AXI_PWM_0_S00_AXI_BASEADDR
XGpio Gpio;
XGpio GpioOutput;
int GpioMarquee (u16 DeviceId, u32 GpioWidth)
{
volatile int Delay;
u32 LedBit;
u32 LedLoop;
int Status;
Status = XGpio_Initialize(&GpioOutput, DeviceId);
if (Status ! = XST_SUCCESS) //就是在这里 提示有错!
{
return XST_FAILURE;
}
XGpio_SetDataDirection(&GpioOutput, LED_CHANNEL, 0x0);
XGpio_DiscreteWrite(&GpioOutput, LED_CHANNEL, 0x0);
for (LedBit = 0x0; LedBit < GpioWidth; LedBit ++){
for(LedLoop = 0; LedLoop < LED_MAX_BLINK; LedLoop ++){
XGpio_DiscreteWrite(&GpioOutput,LED_CHANNEL,
1 << LedBit);
for (Delay = 0; Delay < LED_DELAY; Delay ++);
XGpio_DiscreteClear(&GpioOutput, LED_CHANNEL,
1 << LedBit);
for (Delay = 0; Delay < LED_DELAY; Delay ++);
}
}
return XST_SUCCESS;
}
int main()
{
init_platform();
print("Hello World\n\r");
AXI_PWM_mWriteReg(PWM_BASEADDR,
AXI_PWM_S00_AXI_SLV_REG0_OFFSET,10000);
AXI_PWM_mWriteReg(PWM_BASEADDR,
AXI_PWM_S00_AXI_SLV_REG1_OFFSET, 0x80000000 + 5000);
u32 status;
status = GpioMarquee (GPIO_DEVICE_ID,GPIO_BITWIDTH);
if (status == 0)print("SUCESS!.\r\n");
else printf("FAILED.\r\n");
return 0;
}
...全文
相关推荐
求助:430编译问--我也遇到类似问题!
通过以上步骤和注意事项,一般可以解决“expected a file name”的错误。
jquery提示 object expected的解决方法
在处理jQuery编程时,"object expected"错误通常表示JavaScript或jQuery的使用过程中遇到了预期的对象类型未被找到的问题。这个错误可能是由于以下几个原因导致的:1.
shell脚本报错:"[: =: unary operator expected"解决办法
首先,让我们分析一下错误产生的原因。当出现“[: =: unary operator expected”错误时,这意味着Shell解释器在解析条件表达式时遇到了问题。
解决 VSCode 编辑 vue 项目报错 Expected indentation of 2 spaces but found 4
当你在使用Visual Studio Code (VSCode)编辑Vue.js项目时,可能会遇到"Expected indentation of 2 spaces but found 4"的错误提示
shell脚本报错:”[: =: unary operator expected”解决办法
在编写shell脚本时,可能会遇到一种常见的错误消息:"[: =: unary operator expected"。这个错误通常出现在试图检查变量是否等于特定值的if语句中。当你使用传统的shell


