1 /* (CC-BY-NC-SA) ROBIN KRENS - ROBIN @ ROBINKRENS.NL
4 * 2019/7/20 - ROBIN KRENS
8 * Main initialize basic components of the board
9 * and jumps to a terminal
17 #include <sys/robsys.h>
20 #include <lib/regfunc.h>
22 #include <lib/stdio.h>
23 #include <lib/tinyprintf.h>
25 #include <drivers/uart.h>
26 #include <drivers/led.h>
27 //#include <drivers/tm1637.h>
28 //#include <drivers/at24c.h>
29 //#include <drivers/tsensor.h>
30 //#include <drivers/mk450_joystick.h>
31 #include <drivers/st7735s.h>
33 mem_pool_t kheap_pool;
38 /* Initialize the clock system, */
41 /* Setup the interrupt vector table */
44 /* Initialze basic input and output over serial */
50 /* Cortex M* integrated systick, can be replaced
51 * by the more accurate RTC.
55 /* Set up a very small libc library */
56 init_printf(NULL, putc);
58 /* Display some basic info at startup */
67 extern uint32_t * _beginofheap;
68 //printf("%p", &_beginofheap);
69 kpool_init(&kheap_pool, 512, 10, (uint32_t *) &_beginofheap);
71 // printf("%p\n", &kheap_pool);
73 char * string = (char *) kalloc(&kheap_pool);
74 char * string2 = (char *) kalloc(&kheap_pool);
75 char * string3 = (char *) kalloc(&kheap_pool);
78 printf("%p\n", string);
79 printf("%p\n", string2);
80 printf("%p\n", string3);
82 kfree(&kheap_pool, string);
84 char * string6 = (char *) kalloc(&kheap_pool);
85 char * string7 = (char *) kalloc(&kheap_pool);
86 printf("%p\n", string6);
87 printf("%p\n", string7);
91 //char * string2 = (char *) alloc();
100 /* LED Segment Driver */
103 /* ASM Blocking routine */
104 //for (int i = 0; i < 1000; i++)
109 uint16_t temp = tsensor_get_temp();
110 printf("Current temperature: %d °C\n", temp); */
112 /* ADC Joystick module */
116 /* Start up terminal */
119 /* Should not be here, endless loop */