| 21 | */ |
| 22 | |
| 23 | rt_uint8_t *rt_hw_sram_init(void) |
| 24 | { |
| 25 | rt_uint8_t *heap; |
| 26 | heap = (rt_uint8_t *)malloc(RT_HEAP_SIZE); |
| 27 | if (heap == RT_NULL) |
| 28 | { |
| 29 | rt_kprintf("there is no memory in pc."); |
| 30 | #ifdef _WIN32 |
| 31 | _exit(1); |
| 32 | #else |
| 33 | exit(1); |
| 34 | #endif |
| 35 | } |
| 36 | #ifdef RT_USING_HEAP |
| 37 | /* init memory system */ |
| 38 | rt_system_heap_init((void*)heap, (void*)&heap[RT_HEAP_SIZE - 1]); |
| 39 | #endif |
| 40 | return heap; |
| 41 | } |
| 42 | |
| 43 | #ifdef _WIN32 |
| 44 | #include <windows.h> |
no test coverage detected