/*
#include <stdio.h>
#include "platform.h"
#include "xil_printf.h"


int main()
{
    init_platform();

    print("Hello World\n\r");
    print("Successfully ran Hello World application");
    cleanup_platform();
    return 0;
}
*/

#include <stdio.h>
//#include "platform.h"
#include "xil_printf.h"

#include "xparameters.h"
#include "xgpio.h"

int main()
{
    //init_platform();

    print("Hello World\r\n");

    XGpio gpio;
    int xStatus = XGpio_Initialize(&gpio,XPAR_AXI_GPIO_0_DEVICE_ID);
    if(XST_SUCCESS != xStatus) {
        print("Failed to initialize GPIO");
    }

    XGpio_SetDataDirection(&gpio, 1, 0x00);
    for(;;) {
        for(volatile int i=0;i<0x1000000;++i) {}
        XGpio_DiscreteWrite(&gpio,1,0x55);
        for(volatile int i=0;i<0x1000000;++i) {}
        XGpio_DiscreteWrite(&gpio,1,0xAA);
        print(".");
    }

    cleanup_platform();
    return 0;
}
