board.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2021-08-23 lianzhian first implementation.
  9. */
  10. // <<< Use Configuration Wizard in Context Menu >>>
  11. #ifndef __BOARD_H__
  12. #define __BOARD_H__
  13. #include <gd32f10x.h>
  14. #include "drv_gpio.h"
  15. // <o> Internal SRAM memory size[Kbytes] <8-64>
  16. // <i>Default: 64
  17. #ifdef __ICCARM__
  18. // Use *.icf ram symbal, to avoid hardcode.
  19. extern char __ICFEDIT_region_RAM_end__;
  20. #define GD32_SRAM_END &__ICFEDIT_region_RAM_end__
  21. #else
  22. #define GD32_SRAM_SIZE 96
  23. #define GD32_SRAM_END (0x20000000 + GD32_SRAM_SIZE * 1024)
  24. #endif
  25. #ifdef __CC_ARM
  26. extern int Image$$RW_IRAM1$$ZI$$Limit;
  27. #define HEAP_BEGIN (&Image$$RW_IRAM1$$ZI$$Limit)
  28. #elif __ICCARM__
  29. #pragma section="HEAP"
  30. #define HEAP_BEGIN (__segment_end("HEAP"))
  31. #else
  32. extern int __bss_end;
  33. #define HEAP_BEGIN (&__bss_end)
  34. #endif
  35. #define HEAP_END GD32_SRAM_END
  36. #endif
  37. //*** <<< end of configuration section >>> ***