#include <stdio.h>
#include "platform.h"
#include <xil_io.h>

int main()
{
	long int i;
	signed int speed, vbus, cur_d, cur_q, x_d, x_q;
	unsigned int angle;
	init_platform();

	xil_printf("Hello World\n\r");
	while (1){
	  i++;
	  if (i==100000000){
	    i=0;
	    vbus = Xil_In32(0x43C20008);
	    angle = Xil_In32(0x43C30000);
	    speed = Xil_In32(0x43C30004);
	    cur_d = Xil_In32(0x43C50000);
	    cur_q = Xil_In32(0x43C50004);
	    x_d = Xil_In32(0x43C60000);
	    x_q = Xil_In32(0x43C60004);

	    xil_printf("VBus:    %i\n",vbus);
	 	xil_printf("Angle:   %i\n",angle);
	 	xil_printf("Speed:   %i\n",speed);
	 	xil_printf("I_d:     %i\n",cur_d);
	 	xil_printf("I_q:     %i\n",cur_q);
	 	xil_printf("x_d:     %i\n",x_d);
	 	xil_printf("x_q:     %i\n",x_q);
	  }
	}

    cleanup_platform();
    return 0;
}
