//FLASH buf init void ICACHE_FLASH_ATTR debug_FlashBufInit(flashDebugBuf* flashDbgBuf,uint32 idx_sec) { //spi_flash_read(idx_sec*0x1000,(uint32*)flashDbgBuf,sizeof(flashDebugBuf)); config_ParamLoadWithProtect(idx_sec,0,(uint8*)flashDbgBuf,sizeof(flashDebugBuf)); if(debug_FlashParamCsumCheck(flashDbgBuf) && debug_FlashAddrCheck(flashDbgBuf)){ ESP_DBG("flash debug check sum ok..\r\n"); }else{ ESP_DBG("flash debug info reset...\r\n"); debug_FlashBufReset(flashDbgBuf,idx_sec); } }
void ICACHE_FLASH_ATTR sp_MacInit() { os_printf("SP MAC INIT...\r\n"); config_ParamLoadWithProtect(LIGHT_PAIRED_DEV_PARAM_ADDR,0,(uint8*)&PairedDev,sizeof(PairedDev)); if(config_ParamCsumCheck((uint8*)&PairedDev, sizeof(PairedDev)) && PairedDev.magic == SP_PARAM_MAGIC){ os_printf("Paired dev check ok...\r\n"); }else{ os_printf("Paired dev not valid...\r\n"); sp_PairedDevParamReset(&PairedDev,MAX_BUTTON_NUM); } //sp_PairedDevParamReset(&PairedDev,MAX_BUTTON_NUM); os_printf("===============\r\n"); }
void ICACHE_FLASH_ATTR debug_FlashPrintParamInit() { //debug_FlashBufInit(&FlashPrintBufParam,FLASH_PRINT_INDEX_ADDR); //spi_flash_read(idx_sec*0x1000,(uint32*)flashDbgBuf,sizeof(flashDebugBuf)); config_ParamLoadWithProtect(FLASH_PRINT_INDEX_ADDR,0,(uint8*)&FlashPrintBufParam,sizeof(flashDebugBuf)); if(debug_FlashParamCsumCheck(&FlashPrintBufParam) && debug_FlashAddrCheck(&FlashPrintBufParam)){ ESP_DBG("flash debug check sum ok..\r\n"); }else{ ESP_DBG("flash debug info reset...\r\n"); //debug_FlashBufReset(&FlashPrintBufParam,FLASH_PRINT_INDEX_ADDR); debug_FlashPrintParamReset(); } }