From a8be04b58358fc88b38f7e9431318e6a957cb0d9 Mon Sep 17 00:00:00 2001 From: Elp03 Date: Wed, 13 Mar 2024 12:03:40 +0100 Subject: [PATCH] Fix names --- prosjekt.X/eeprom.c | 30 +++++++++++++++--------------- prosjekt.X/eeprom.h | 8 ++++---- prosjekt.X/main.c | 17 ++--------------- 3 files changed, 21 insertions(+), 34 deletions(-) diff --git a/prosjekt.X/eeprom.c b/prosjekt.X/eeprom.c index 4eea0c2..586ad1a 100644 --- a/prosjekt.X/eeprom.c +++ b/prosjekt.X/eeprom.c @@ -28,7 +28,7 @@ void check_eeprom_is_ready(){ // Checks if it has been written information at the address // If true, the infromation is replaced with the intaken struct // else the intaken struct is written at the address. -void write_struct_in_EEPROM(config_t write_struct){ +void write_struct_from_EEPROM(config_t write_struct){ uint8_t struct_size; struct_size = sizeof(write_struct); @@ -38,7 +38,7 @@ void write_struct_in_EEPROM(config_t write_struct){ } -// Reads the memory block at the address 0x00 +// Reads the memory block at the address start_address_controller // returns a struct in form of config_t config_t read_struct_from_EEPROM(){ //is eeprom ready?? @@ -55,14 +55,14 @@ 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 data_point, uint8_t data){ +void write_data_point_in_EEPROM(uint8_t byte, uint8_t fan_num){ check_eeprom_is_ready(); - if (data == 1){ - eeprom_update_byte(current_address_fan1, data_point); + if (fan_num == 1){ + eeprom_update_byte(current_address_fan1, byte); current_address_fan1++; - } else if (data == 2){ - eeprom_update_byte(current_address_fan2, data_point); + } else if (fan_num == 2){ + eeprom_update_byte(current_address_fan2, byte); current_address_fan2++; } else{ // error??? @@ -72,25 +72,25 @@ void write_data_point_in_EEPROM(uint8_t data_point, uint8_t data){ // Reads all the datapoints to the choosen data. // it writes the data points in the USART stream. -void read_data_point_speed_info(uint8_t data){ - uint8_t data_point = 0; +void read_data_point_speed_info(uint8_t fan_num){ + uint8_t byte = 0; - if (data == 1){ + if (fan_num == 1){ uint8_t len = current_address_fan1 - start_address_fan1; check_eeprom_is_ready(); for (uint8_t i = 0; i #include #include -#include #define F_CPU 4E6 -#include -#include -#include -#define USART3_BAUD_RATE(BAUD_RATE) ((float)(F_CPU * 64 / (16 *(float) BAUD_RATE)) + 0.5) -#include - void main() {