diff --git a/source/app/main.c b/source/app/main.c index eecb14e..f2108c8 100644 --- a/source/app/main.c +++ b/source/app/main.c @@ -74,16 +74,24 @@ void main(void) //任务初始化 L0_TASK_init(); - //获取mcu id - L0_id_get_rom(G.mcu_id); - L0_uart0_sendstr("MCU_ID = "); - L0_uart0_sendArrayHex(G.mcu_id,7); + // // 获取mcu id + // L0_id_get_rom(G.mcu_id); + // L0_uart0_sendstr("MCU_ID = "); + // L0_uart0_sendArrayHex(G.mcu_id,7); + // L0_uart0_0d0a(); + + //获取MCUID + L0_id_get_chipid(); L0_uart0_0d0a(); - //版本信息 - L0_uart0_sendstr("Version info : "); - L0_uart0_sendArray("PEN_V3",6); + L0_uart0_sendstr("MCU_ID = "); + L0_uart0_sendArrayHex(G.mcu_id, MSP_ID_LEN); L0_uart0_0d0a(); + // //版本信息 + // L0_uart0_sendstr("Version info : "); + // L0_uart0_sendArray("PEN_V3",6); + // L0_uart0_0d0a(); + while(1) { if(1 == s_nos_tick.t1s_heartbeat)//1s diff --git a/source/bsp/bsp_config.c b/source/bsp/bsp_config.c index 4c62c21..92e2464 100644 --- a/source/bsp/bsp_config.c +++ b/source/bsp/bsp_config.c @@ -22,7 +22,6 @@ //初始化为NULL,timer0_isr中判断为NULL则不调用 //========================================================== - void L0_board_config(void) { #if (PIN_UART0_Rxd_30_Txd_31 == D_PIN_UART0) diff --git a/source/bsp/bsp_config.h b/source/bsp/bsp_config.h index 21a3d22..b917d89 100644 --- a/source/bsp/bsp_config.h +++ b/source/bsp/bsp_config.h @@ -77,7 +77,14 @@ #define D_MCU_NAME "STC8H3K64S4" //存储器特殊参数地址配置 - #define D_MCU_SPEC_PARAM_CHIPID 0xFDF9 + #define MSP_ID_LEN 7 + #define D_MCU_SPEC_PARAM_ID_IN_RAM 0x00F1 + #define D_MCU_SPEC_PARAM_ID_IN_ROM 0xFDF9 + #define D_MCU_SPEC_PARAM_ID_IN_CHIPID 0xFDE0 + #define ID_ADDR_IN_RAM ((char idata *)(D_MCU_SPEC_PARAM_ID_IN_RAM + 0x00)) + #define ID_ADDR_IN_ROM ((char code *)(D_MCU_SPEC_PARAM_ID_IN_ROM + 0x00)) + #define ID_ADDR_IN_CHIPID ((unsigned char volatile xdata *)(D_MCU_SPEC_PARAM_ID_IN_CHIPID + 0x00)) + //...其他参数 #if ((TYPE_MCU & TYPE_MCU_VENDOR_MSK) == TYPE_MCU_VENDOR_STC) @@ -320,7 +327,6 @@ L1_tick_tick extern void L0_board_config(void); - #endif//_BSP_CONFIG_H /*********************************end file*********************************************/ diff --git a/source/bsp/chipid.c b/source/bsp/chipid.c index 7df0dc3..99cad66 100644 --- a/source/bsp/chipid.c +++ b/source/bsp/chipid.c @@ -11,8 +11,9 @@ ////////////////////////////////////////////////////////////////////////////// #include "chipid.h" #include "../bsp/bsp_config.h" +#include "../app/app_config.h" -#define MSP_ID_LEN 7 +// #define MSP_ID_LEN 7 void L0_id_get(U8 *id) { @@ -27,13 +28,23 @@ void L0_id_get(U8 *id) void L0_id_get_rom(U8 *id) { U8 i = 0; - char *ID = (char code *)(D_MCU_SPEC_PARAM_CHIPID); + char *ID = (char code *)(D_MCU_SPEC_PARAM_ID_IN_ROM); for(i=0;i