Esempio n. 1
0
void ICACHE_FLASH_ATTR
debug_FlashBufInit()
{
	spi_flash_read(Flash_DEBUG_INFO_ADDR*0x1000,(uint32*)&FlashDebugBufParam,sizeof(FlashDebugBufParam));
	if(debug_FlashParamCsumCheck() && debug_FlashAddrCheck()){
		
	}else{
		debug_FlashBufReset();
	}
}
//set debug version
void ICACHE_FLASH_ATTR
debug_SetDebugVersion(int ver)
{
    if(debug_FlashParamCsumCheck(&FlashDebugBufParam) && debug_FlashAddrCheck(&FlashDebugBufParam)){
        //FlashDebugBufParam.DebugVersion = ver;
    }else{
        debug_FlashBufInit(&FlashDebugBufParam,Flash_DEBUG_INFO_ADDR);
    }
    FlashDebugBufParam.DebugVersion = ver;
    //debug_FlashParamSv();
    debug_FlashParamSv(&FlashDebugBufParam,Flash_DEBUG_INFO_ADDR);
}
Esempio n. 3
0
void ICACHE_FLASH_ATTR
	debug_SetDebugVersion(int ver)
{
	if(debug_FlashParamCsumCheck() && debug_FlashAddrCheck()){
    	//FlashDebugBufParam.DebugVersion = ver;
	}else{
		debug_FlashBufInit();
	}

	FlashDebugBufParam.DebugVersion = ver;
	debug_FlashParamSv();
}
//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
	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();
    }
}