复制
收藏
提问
全网

bool LoadPara(sPara* pp) { const u16 LEN8=sizeof(sPara)-PSUB; const u16 LEN16=LEN8/2+LEN8%2; bool r=false; sPara *pInitData; u16 p[LEN16]; STMFLASH_Read(PARA_ADDR,p,LEN16); pInitData = (sPara*)p; if(pInitData->TaiFlag == TAILFLAG) { if(GetCheckSum((u8*)pInitData,LEN8)) { LoadDefaultPara(pp); }else { *pp = *((sPara*)p); r=true; } }else { LoadDefaultPara(pp); } return r; }

5e9deaf72
19小时前
全网
文档
学术
百科
知识库
时间不限
自动

理解问题bool LoadPara(sPara* pp) { const u16 LEN8=sizeof(sPara)-PSUB; const u16 LEN16=LEN8/2+LEN8%2; bool r=false; sPara *pInitData; u16 p[LEN16]; STMFLASH_Read(PARA_ADDR,p,LEN16); pInitData = (sPara*)p; if(pInitData->TaiFlag == TAILFLAG) { if(GetCheckSum((u8*)pInitData,LEN8)) { LoadDefaultPara(pp); }else { *pp = *((sPara*)p); r=true; } }else { LoadDefaultPara(pp); } return r; }

已完成理解bool LoadPara(sPara* pp) { const u16 LEN8=sizeof(sPara)-PSUB; const u16 LEN16=LEN8/2+LEN8%2; bool r=false; sPara *pInitData; u16 p[LEN16]; STMFLASH_Read(PARA_ADDR,p,LEN16); pInitData = (sPara*)p; if(pInitData->TaiFlag == TAILFLAG) { if(GetCheckSum((u8*)pInitData,LEN8)) { LoadDefaultPara(pp); }else { *pp = *((sPara*)p); r=true; } }else { LoadDefaultPara(pp); } return r; }

展开阅读网页

更简洁一些
转笔记
简洁
bool LoadPara(sPara* pp) { const u16 LEN8=sizeof(sPara)-PSUB; const u16 LEN16=LEN8/2+LEN8%2; bool r=false; sPara *pInitData; u16 p[LEN16]; STMFLASH_Read(PARA_ADDR,p,LEN16); pInitData = (sPara*)p; if(pInitData->TaiFlag == TAILFLAG) { if(GetCheckSum((u8*)pInitData,LEN8)) { LoadDefaultPara(pp); }else { *pp = *((sPara*)p); r=true; } }else { LoadDefaultPara(pp); } return r; }
知识树
bool LoadPara(sPara* pp) { const u16 LEN8=sizeof(sPara)-PSUB; const u16 LEN16=LEN8/2+LEN8%2; bool r=false; sPara *pInitData; u16 p[LEN16]; STMFLASH_Read(PARA_ADDR,p,LEN16); pInitData = (sPara*)p; if(pInitData->TaiFlag == TAILFLAG) { if(GetCheckSum((u8*)pInitData,LEN8)) { LoadDefaultPara(pp); }else { *pp = *((sPara*)p); r=true; } }else { LoadDefaultPara(pp); } return r; }
如何计算结构体的校验和?
STMFLASH_Read函数的作用是什么?
LoadDefaultPara函数的作用是什么?

以上内容由AI搜集生成,仅供参考

在线客服