main.c 961 Bytes
Newer Older
Rahix's avatar
Rahix committed
1
2
3
4
5
6
/*******************************************************************************
 * License: TBD
 ******************************************************************************/

/***** Includes *****/
#include "card10.h"
7
8
#include "leds.h"
#include "pmic.h"
Rahix's avatar
Rahix committed
9

10
#include "display.h"
11
#include "gfx.h"
Rahix's avatar
Rahix committed
12
13
14

#include "tmr_utils.h"

15
#include <Heart.h>
Rahix's avatar
Rahix committed
16
#include <stdint.h>
17
#include <stdio.h>
Rahix's avatar
Rahix committed
18
19
20
21
#include <string.h>

int main(void)
{
Serge Bazanski's avatar
Serge Bazanski committed
22
23
24
	card10_init();
	card10_diag();

25
26
27
28
29
30
31
32
33
	gfx_copy_region(
		&display_screen,
		0,
		0,
		160,
		80,
		GFX_RAW,
		sizeof(Heart),
		(const void *)(Heart)
34
35
	);
	gfx_update(&display_screen);
Serge Bazanski's avatar
Serge Bazanski committed
36
37
38

	// Release core1
	core1_start((void *)0x10080000);
fleur's avatar
fleur committed
39
	int h = 0;
Serge Bazanski's avatar
Serge Bazanski committed
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54

	while (1) {
#define NUM 15

		leds_update();
		TMR_Delay(MXC_TMR0, MSEC(10), 0);
		h++;

		// Send a txev using `sev` every once in a while to wake up core1
		// and let it do something
		if (h % 100 == 0) {
			printf("core0: Triggering core1 using SEV ...\n");
			__asm volatile("sev");
		}
	}
Rahix's avatar
Rahix committed
55
}