compiler.h 896 B

12345678910111213141516171819202122232425262728293031323334
  1. /**
  2. * define start/end address of ro data.
  3. */
  4. #ifndef __COMPILER_H__
  5. #define __COMPILER_H__
  6. #if defined(__ESP8266__)
  7. extern char _irom0_text_start;
  8. extern char _irom0_text_end;
  9. #define RODATA_START_ADDRESS (&_irom0_text_start)
  10. #define RODATA_END_ADDRESS (&_irom0_text_end)
  11. #elif defined(__ESP32__)
  12. extern char _drom0_text_start;
  13. extern char _drom0_text_end;
  14. #define RODATA_START_ADDRESS (&_drom0_text_start)
  15. #define RODATA_END_ADDRESS (&_drom0_text_end)
  16. #else // other compilers
  17. /* Firstly, modify rodata's start/end address. Then, comment the line below */
  18. #error "Please modify RODATA_START_ADDRESS and RODATA_END_ADDRESS below."
  19. /* Perhaps you can use start/end address of flash */
  20. #define RODATA_START_ADDRESS ((char*)0x40200000)
  21. #define RODATA_END_ADDRESS ((char*)0x40280000)
  22. #endif
  23. #endif // __COMPILER_H__