#ifndef __CONFIG_H__ #define __CONFIG_H__ ///////////////////INTER FLASH SPECIFICATION////////////////// //address : 0x8000000~0x8003BFF (15K) IAP section ////////////////////////////////////////////////////////////// #define USE_SWD_DEBUG 0 //for debug without iap #if(USE_SWD_DEBUG) #define FLASH_APP_ADDR 0x8000000//relocal App address #define APP_CONFIG_ADDR 0x800FC00//last 1K for user configuration section #else #define FLASH_APP_ADDR (0x8004C00) #define APP_CONFIG_ADDR (0x8003C00) #endif #define SLW_DEBUG //if no need to print, comment it #define MCU_FLAG 72 //MCU标志 64+8 #define PRODUCT_NAME "RT501S" #define PRODUCT_VERSION 105 typedef struct { unsigned char McuFlag; //MCU标识 101 --STM32F101CB char ProductName[8];//项目名 unsigned short ProductVersion; //版本号 unsigned long PSN; //终端编码 unsigned char Addr; unsigned char Sdebug; //unsigned char dummy;//一定要保持为偶数,因为内存读是读双数的回来 }__attribute__ ((packed)) SUT_CONFIG; extern SUT_CONFIG sutProductPara; void ReadProductParaFromFlash(void); void SaveProductParaToFlash(void); void PcMsgHandle(char *msg); int GetParaFromStr(char *Str,char *Para,char *Value); #endif