Dana
为了我这么多宣传的“可读性”,我总是使用不同的方法。
类似的东西
定义EEEPROME 1001
CONST UTEN8 EEEPROMARE [ EEEPROMESIZE ];
或
const结构SmiyEePROM {UIT8编程;UTI8数据[EEPROMESSHOMES ];} MyEEEProm;
以后在代码中使用
结果= EEEPROFIX写(MyDATA,EEEPromArea,EEEPROMESIZE);
或
结果=EEEPROMETHORD(MyDATA,(UTIN 8*)(&;结构SMYEEEPROM),SIZEOF(StReSmieEePROM));
这样即使阵列结构可能与写入单个元素在一定的结构可以进行。
自由伴随着责任:DoototoRead代码!!!!
鲍伯(只希望能少打字)
以上来自于百度翻译
以下为原文
Dana,
for the sake of my so much propagated "Readability" I would always use a different approach.
something like
#define EEEPROMSIZE 1001
const uint8 EEEPromArea[EEEPROMSIZE];
or
const struct sMyEEEProm { uint8 IsProgrammed; uint8 Data[EEPROMSIZE];} MyEEEProm;
and later using in the code
Result = EEEProm_Write(MyData,EEEPromArea,EEEPROMSIZE);
or
Result = EEEProm_Write(MyData,(uint8 *)(& struct sMyEEEProm),sizeof(struct sMyEEEProm));
This way even arrays of a struct are possible with writes to a single element within a certain struct can be performed.
With freedom comes responsibility: DO NOT OVERWRITE YOUR CODE!!!
Bob (Hoping for only few typos)
Dana
为了我这么多宣传的“可读性”,我总是使用不同的方法。
类似的东西
定义EEEPROME 1001
CONST UTEN8 EEEPROMARE [ EEEPROMESIZE ];
或
const结构SmiyEePROM {UIT8编程;UTI8数据[EEPROMESSHOMES ];} MyEEEProm;
以后在代码中使用
结果= EEEPROFIX写(MyDATA,EEEPromArea,EEEPROMESIZE);
或
结果=EEEPROMETHORD(MyDATA,(UTIN 8*)(&;结构SMYEEEPROM),SIZEOF(StReSmieEePROM));
这样即使阵列结构可能与写入单个元素在一定的结构可以进行。
自由伴随着责任:DoototoRead代码!!!!
鲍伯(只希望能少打字)
以上来自于百度翻译
以下为原文
Dana,
for the sake of my so much propagated "Readability" I would always use a different approach.
something like
#define EEEPROMSIZE 1001
const uint8 EEEPromArea[EEEPROMSIZE];
or
const struct sMyEEEProm { uint8 IsProgrammed; uint8 Data[EEPROMSIZE];} MyEEEProm;
and later using in the code
Result = EEEProm_Write(MyData,EEEPromArea,EEEPROMSIZE);
or
Result = EEEProm_Write(MyData,(uint8 *)(& struct sMyEEEProm),sizeof(struct sMyEEEProm));
This way even arrays of a struct are possible with writes to a single element within a certain struct can be performed.
With freedom comes responsibility: DO NOT OVERWRITE YOUR CODE!!!
Bob (Hoping for only few typos)
举报