程序什么地方写的不对吗?
#include "stdio.h"
#include "stdlib.h"
#include "MC56F84789.h"
void delay11(int x);
void GPIOE_Init (void);
void main()
{
GPIOE_Init();
while(1)
{
// GPIOE_DR |= (GPIOE_DR_D_0 | GPIOE_DR_D_1 | GPIOE_DR_D_2 | GPIOE_DR_D_3 | GPIOE_DR_D_4 | GPIOE_DR_D_5 | GPIOE_DR_D_6 | GPIOE_DR_D_7 | GPIOE_DR_D_8 | GPIOE_DR_D_9 | GPIOE_DR_D_10 | GPIOE_DR_D_11 | GPIOE_DR_D_12 | GPIOE_DR_D_13 | GPIOE_DR_D_14 | GPIOE_DR_D_15);
GPIOE_DR = 0xffff; // Data Bits
delay11(0x1ff);
GPIOE_DR = 0x0000; // Data Bits
delay11(0x1ff);
}
}
void GPIOE_Init (void)
{
/* If the pin is configured as an output, this register is not used.
GPIOE_PUR = 0xffff; //Pull Resistor Enable Bits , 0b1 ==> Pull resistor is enabled */
GPIOE_DRIVE = 0xffff;
GPIOE_DDR = 0xffff; // 0b1 ==> Pin is an output
GPIOE_PER = 0; //Peripheral Enable Bits , 0b0 ==> Pin is for GPIO (GPIO mode)
GPIOE_PPMODE = 0; //Push-Pull Mode Bits , 0b0 ==> Open Drain Mode
GPIOE_DRIVE = 0xffff;
GPIOE_PUS = 0xffff; // Pull Resistor Type Select Bits , 0b1 ==> Pullup resistor
GPIOE_SRE = 0;
}
void delay11(int x)
{
int i,j;
for(i=x;i<0x1ff;i++)
{
for(j=0;j<0x1ff;j++)
{
}
}
} |