kalloc and kfree interface and abstraction
[cortex-from-scratch] / main.c
diff --git a/main.c b/main.c
index 3c1035b..26a7305 100644 (file)
--- a/main.c
+++ b/main.c
 #include <sys/mmap.h>
 
 #include <lib/regfunc.h>
+#include <lib/pool.h>
 #include <lib/stdio.h>
+#include <lib/string.h>
 #include <lib/tinyprintf.h>
 
 #include <drivers/uart.h>
 #include <drivers/led.h>
-#include <drivers/tm1637.h>
+//#include <drivers/tm1637.h>
 //#include <drivers/at24c.h>
-#include <drivers/tsensor.h>
+//#include <drivers/tsensor.h>
+//#include <drivers/mk450_joystick.h>
+#include <drivers/st7735s.h>
+
 
 void main()
 {
@@ -39,14 +44,21 @@ void main()
        /* Initialze basic input and output over serial */
        uart_init();
 
+       /* TFT screen */
+       // tft_init();
+       
        /* Cortex M* integrated systick, can be replaced
         * by the more accurate RTC.
        systick_init();
        */
-
+       
        /* Set up a very small libc library */
        init_printf(NULL, putc);
 
+       /* Heap init */
+       kheap_init();
+       //printf("%p\n", get_kheap());
+       
        /* Display some basic info at startup */
        sysinfo();
 
@@ -54,7 +66,8 @@ void main()
        led_init();
 
        /* Real time clock */
-       //rtc_init();
+       rtc_init();
+
 
        /* Eeprom Driver
        eeprom_at24c_init();
@@ -64,15 +77,22 @@ void main()
        /* LED Segment Driver */
        //tm1637_init();
 
+       /* ASM Blocking routine */
        //for (int i = 0; i < 1000; i++)
        //      _block(10000);
 
-       /* TEMP SENSOR */
-       run();
+       /* TEMP SENSOR 
+       tsensor_printid();
+       uint16_t temp = tsensor_get_temp();
+       printf("Current temperature: %d °C\n", temp); */
+
+       /* ADC Joystick module */
+       // mk450_init();        
+
 
        /* Start up terminal */
        terminal();
-
+       
        /* Should not be here, endless loop */
        for(;;) {