Blink Led code

Hi

I writing a program to test BF533 EZ lite kit as below:

#include <sys/platform.h>
#include "adi_initialize.h"
#include "Blink.h"
#include <stdio.h>


static void initLed (void){
*pEBIU_AMBCTL0 = 0x7bb07bb0;
*pEBIU_AMBCTL1 = 0x7bb07bb0;
*pEBIU_AMGCTL = 0x000f;
*pFlashA_PortB_Dir = 0x3f;
*pFlashA_PortB_Data = stateOn;
}
void turnLedOn(void) {
*pFlashA_PortB_Data = stateOn;
}
void turnLedOff(void) {
*pFlashA_PortB_Data = stateOff;
}
void turnLedOn1(void)
{
*pFlashA_PortB_Data = 0x8;
}
void delay(int time) {
for (int i = 0; i <= time; i++) {
//do nothing
}
}
int main(int argc, char *argv[])
{
adi_initComponents();
initLed();
printf("Start\n");
for(int i = 0; i < 3; i++) {
printf("turn on\n");
turnLedOn();
delay(80);
printf("turn off\n");
turnLedOff();
delay(80);
turnLedOn1();
delay(80);
}
printf("End\n");
return 0;
}

When i run it on the EZ lite Kit the LEDs do not blink as i think. First all the Leds on, then only Led 1 on, then all Les on,...So why all the Leds do not Off as my code ?



Remove some unused comments
[edited by: Thanh Nguyen at 10:09 AM (GMT 0) on 13 Dec 2019]