diff --git a/prosjekt.X/eeprom.c b/prosjekt.X/eeprom.c index dd93d99..0a7e4d8 100644 --- a/prosjekt.X/eeprom.c +++ b/prosjekt.X/eeprom.c @@ -55,18 +55,19 @@ config_t read_struct_from_EEPROM(){ // checks if EEPROM is ready // If the dataset is 1, the datapoint is written at the address. // If the dataset is 2 its written at another point. -void write_data_point_in_EEPROM(uint8_t byte, uint8_t fan_num){ +int write_data_point_in_EEPROM(uint8_t byte, uint8_t fan_num){ check_eeprom_is_ready(); if (fan_num == 1){ eeprom_update_byte(current_address_fan1, byte); current_address_fan1++; + return 1; } else if (fan_num == 2){ eeprom_update_byte(current_address_fan2, byte); current_address_fan2++; + return 1; } else{ - // error??? - ; + return 0; } } diff --git a/prosjekt.X/eeprom.h b/prosjekt.X/eeprom.h index f3b12ac..b584713 100644 --- a/prosjekt.X/eeprom.h +++ b/prosjekt.X/eeprom.h @@ -36,7 +36,7 @@ void write_struct_from_EEPROM(config_t write_struct); config_t read_struct_from_EEPROM(); // Writes a datapoint in EEPROM -void write_data_point_from_EEPROM(uint8_t byte, uint8_t fan_num); +int write_data_point_from_EEPROM(uint8_t byte, uint8_t fan_num); // Reads all the dataPoints form EEPROM uint8_t read_data_point_speed_info(uint8_t fan_num, uint8_t *array);