wrs_main.c 614 Bytes
Newer Older
1
#include <wrc.h>
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
#include "uart.h"

#include "softpll_ng.h"

#include "minipc.h"

const char *build_revision;
const char *build_date;

main()
{
	uint32_t start_tics = 0;

	uart_init_hw();
	
	TRACE("WR Switch Real Time Subsystem (c) CERN 2011 - 2013\n");
	TRACE("Revision: %s, built %s.\n", build_revision, build_date);
	TRACE("--");

	ad9516_init();
	rts_init();
	rtipc_init();

	for(;;)
	{
			uint32_t tics = timer_get_tics();
			
			if(tics - start_tics > TICS_PER_SECOND/5)
			{
//				TRACE("tick!\n");
				spll_show_stats();
				start_tics = tics;
			}
	    rts_update();
	    rtipc_action();
	}

	return 0;
}