config.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef __CONFIG_H__
  2. #define __CONFIG_H__
  3. ///////////////////INTER FLASH SPECIFICATION//////////////////
  4. //address : 0x8000000~0x8003BFF (15K) IAP section
  5. //////////////////////////////////////////////////////////////
  6. #define USE_SWD_DEBUG 0 //for debug without iap
  7. #if(USE_SWD_DEBUG)
  8. #define FLASH_APP_ADDR 0x8000000//relocal App address
  9. #define APP_CONFIG_ADDR 0x800FC00//last 1K for user configuration section
  10. #else
  11. #define FLASH_APP_ADDR (0x8004C00)
  12. #define APP_CONFIG_ADDR (0x8003C00)
  13. #endif
  14. #define SLW_DEBUG //if no need to print, comment it
  15. #define MCU_FLAG 72 //MCU标志 64+8
  16. #define PRODUCT_NAME "RT501S"
  17. #define PRODUCT_VERSION 105
  18. typedef struct
  19. {
  20. unsigned char McuFlag; //MCU标识 101 --STM32F101CB
  21. char ProductName[8];//项目名
  22. unsigned short ProductVersion; //版本号
  23. unsigned long PSN; //终端编码
  24. unsigned char Addr;
  25. unsigned char Sdebug;
  26. //unsigned char dummy;//一定要保持为偶数,因为内存读是读双数的回来
  27. }__attribute__ ((packed)) SUT_CONFIG;
  28. extern SUT_CONFIG sutProductPara;
  29. void ReadProductParaFromFlash(void);
  30. void SaveProductParaToFlash(void);
  31. void PcMsgHandle(char *msg);
  32. int GetParaFromStr(char *Str,char *Para,char *Value);
  33. #endif