wrs_main.c 766 Bytes
Newer Older
1
#include <wrc.h>
2 3 4
#include "uart.h"
#include "softpll_ng.h"
#include "minipc.h"
5
#include "revision.h"
6 7


8 9
int scb_ver = 33;		//SCB version.

10
int main(void)
11
{
12
	uint32_t start_tics = timer_get_tics();
13 14 15

	uart_init_hw();
	
16
	TRACE("");
17
	TRACE("WR Switch Real Time Subsystem (c) CERN 2011 - 2014\n");
18 19
	TRACE("Revision: %s, built: %s %s.\n",
	      build_revision, build_date, build_time);
20
	TRACE("SCB version: %d. %s\n", scb_ver,(scb_ver>=34)?"10 MHz SMC Output.":"" );
21 22
	TRACE("--");

23
	ad9516_init( scb_ver );
24 25 26 27 28 29
	rts_init();
	rtipc_init();

	for(;;)
	{
			uint32_t tics = timer_get_tics();
30 31

			if(time_after(tics, start_tics + TICS_PER_SECOND/5))
32 33 34 35 36 37
			{
				spll_show_stats();
				start_tics = tics;
			}
	    rts_update();
	    rtipc_action();
38
		spll_update();
39 40 41 42
	}

	return 0;
}