aboutsummaryrefslogtreecommitdiff
path: root/VexRiscvSocSoftware/projects/murax/dhrystone/src/main.c
blob: cfb5924ceeb611533f94ee73c8940ac8a5b8911a (plain)
1
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
41
42
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include <murax.h>


extern void main2();

int main() {
	Uart_Config uartConfig;
	uartConfig.dataLength = 8;
	uartConfig.parity = NONE;
	uartConfig.stop = ONE;
	uartConfig.clockDivider = 12000000/UART_SAMPLE_PER_BAUD/115200-1;
	uart_applyConfig(UART,&uartConfig);


	interruptCtrl_init(TIMER_INTERRUPT);
	prescaler_init(TIMER_PRESCALER);
	timer_init(TIMER_A);

	TIMER_PRESCALER->LIMIT = 99;

	TIMER_A->LIMIT = ~0;
	TIMER_A->CLEARS_TICKS = 0x00010002;

	main2();
}


void irqCallback(){

}

#include <time.h>
clock_t	clock(){
	return TIMER_A->VALUE;
}