Fix EEPROM is ready
This commit is contained in:
parent
27d8d44d34
commit
7008037de9
@ -79,12 +79,16 @@ typedef struct {
|
||||
|
||||
void checkEEpromIsReady(){
|
||||
printf("checking eeprom");
|
||||
while(1){
|
||||
if (eeprom_is_ready()){
|
||||
break;
|
||||
printf("it is");
|
||||
}else{
|
||||
;
|
||||
printf("its not");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void WriteStructInEEPROM(config_t writeStruct){
|
||||
uint8_t structSize;
|
||||
@ -107,7 +111,7 @@ config_t ReadStructInEEPROM(){
|
||||
config_t readStruct;
|
||||
uint8_t structsize = sizeof(readStruct);
|
||||
|
||||
//checkEEpromIsReady();
|
||||
checkEEpromIsReady();
|
||||
|
||||
eeprom_read_block((void *) &readStruct,(void*) &fanControllerStartAddress, structsize);
|
||||
return readStruct;
|
||||
@ -115,7 +119,7 @@ config_t ReadStructInEEPROM(){
|
||||
|
||||
void WriteFanSpeedInEEPROM(uint8_t fanSpeed){
|
||||
|
||||
//checkEEpromIsReady();
|
||||
checkEEpromIsReady();
|
||||
|
||||
eeprom_write_byte(currentFanSpeedAddress, fanSpeed);
|
||||
currentFanSpeedAddress++;
|
||||
@ -128,7 +132,7 @@ void ReadFanSpeedInfo(){
|
||||
uint8_t len = currentFanSpeedAddress - fanSpeedStartAddress;
|
||||
uint8_t fanSpeedIterate = 0;
|
||||
|
||||
//checkEEpromIsReady();
|
||||
checkEEpromIsReady();
|
||||
|
||||
for (uint8_t i = 0; i <len; i++){
|
||||
fanSpeedIterate = eeprom_read_byte(i);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user