Fix eeprom

EEPROM works
This commit is contained in:
Elp03 2024-03-06 15:24:34 +01:00
parent 8b73051ece
commit 27d8d44d34
4 changed files with 8 additions and 5 deletions

View File

Binary file not shown.

View File

@ -67,11 +67,11 @@ uint8_t USART3_read() {
* read the memory for the fanspeed
*/
uint8_t fanControllerStartAddress = 0x00;
uint8_t EEMEM fanControllerStartAddress = 0x00;
bool alreadyWrittenAblock = false;//false
uint8_t fanSpeedStartAddress = 0x30;
uint8_t currentFanSpeedAddress = 0x30;
uint8_t EEMEM fanSpeedStartAddress = 0x30;
uint8_t EEMEM currentFanSpeedAddress = 0x30;
typedef struct {
uint8_t fanSpeed;
@ -96,7 +96,7 @@ void WriteStructInEEPROM(config_t writeStruct){
if (alreadyWrittenAblock){
eeprom_update_block((void*) &writeStruct,(void*) &fanControllerStartAddress, structSize);
}else{
eeprom_write_block((config_t*) &writeStruct, &fanControllerStartAddress, structSize);
eeprom_write_block(&writeStruct, &fanControllerStartAddress, structSize);
alreadyWrittenAblock = true;//true
//reurn something
}

View File

@ -28,7 +28,7 @@
<targetDevice>AVR128DB48</targetDevice>
<targetHeader></targetHeader>
<targetPluginBoard></targetPluginBoard>
<platformTool>noID</platformTool>
<platformTool>nEdbgTool</platformTool>
<languageToolchain>XC8</languageToolchain>
<languageToolchainVersion>2.45</languageToolchainVersion>
<platform>2</platform>
@ -165,6 +165,9 @@
<property key="user-pack-device-support" value=""/>
<property key="wpo-lto" value="false"/>
</XC8-config-global>
<nEdbgTool>
<property key="debugoptions.useswbreakpoints" value="true"/>
</nEdbgTool>
</conf>
</confs>
</configurationDescriptor>