X-Git-Url: https://robinkrens.nl/gitweb/?p=cortex-from-scratch;a=blobdiff_plain;f=main.c;h=e87131a88c52890aad6e8f0ac635954906bdee02;hp=26a7305697dc06d2882e733502477bb0b5f93659;hb=47f52d56fac1acc9410a351dbf603c462bf3994c;hpb=9063da27d8547aaaee12a67fb5f582441330a640 diff --git a/main.c b/main.c index 26a7305..e87131a 100644 --- a/main.c +++ b/main.c @@ -32,6 +32,40 @@ #include +#include + +int test3(int i, int j) { + + volatile uint32_t * sp = get_msp(); + + /* asm volatile ( + "tst lr, #4" "\n\t" + "ite eq" "\n\t" + "mrseq %0, msp" "\n\t" + "mrsne r0, psp" : "=r" (sp) ); */ + + for (int i = 0; (sp + i) < 0x20010000; i++) { + printf("ADDRESS: %p, VALUE: %x\n", (sp + i), *(sp + i)); + } + + for(;;); + return 0xCC; + +} +int test2(int i, int j) { + + int x = i * j; + test3(0x3A, 0x3B); + + +} +int test(int i, int j) { + + test2(0x2A, 0x2B); + + return 0xAA; +} + void main() { @@ -56,7 +90,7 @@ void main() init_printf(NULL, putc); /* Heap init */ - kheap_init(); + //kheap_init(); //printf("%p\n", get_kheap()); /* Display some basic info at startup */ @@ -66,8 +100,13 @@ void main() led_init(); /* Real time clock */ - rtc_init(); + //rtc_init(); + +// printf("press any key to start\n"); +// asm volatile ("wfi"); + syscall_init(); + theos_test(0xA1, 0xA2); /* Eeprom Driver eeprom_at24c_init();