tm1637 signs of life, terminal builtin cmds
[cortex-from-scratch] / main.c
1 /* (CC-BY-NC-SA) ROBIN KRENS - ROBIN @ ROBINKRENS.NL
2  * 
3  * $LOG$
4  * 2019/7/20 - ROBIN KRENS      
5  * Initial version 
6  * 
7  * $DESCRIPTION$
8  * Main intialize basic components of the boards
9  * and jumps to a terminal
10  *
11  * */
12
13 #include <stdbool.h>
14 #include <stddef.h>
15 #include <stdint.h>
16
17 #include <sys/robsys.h> 
18 #include <sys/mmap.h>
19
20 #include <lib/regfunc.h>
21 #include <lib/stdio.h>
22
23 #include <drivers/uart.h>
24 #include <drivers/led.h>
25 #include <drivers/tm1637.h>
26
27 void main()
28 {
29         ivt_init();
30         uart_init();
31 //      cputs("ROBSYS LOADING...\n");
32         systick_init();
33         led_init();
34         sysinfo();
35
36         tm1637_init();
37         tm1637_start();
38
39         //uint32_t test = hextoreg("12345678");
40                 
41 //      cputs(regtohex(test));
42
43         //extern void stub();
44         //stub();
45         //__asm__ __volatile__ ("ldc p1, cr1, r0");
46
47 /*      while(1) {
48                 int r;
49                 for (int i = 0; i < 50000; i++) {
50                         r = 0;  
51                 }
52                 led_on();
53                 for (int i = 0; i < 50000; i++) {
54                         r = 0;  
55                 }
56                 led_off();
57         } */
58         terminal();
59
60         for(;;) {
61
62         }
63 }