Fix eeprom
EEPROM works
This commit is contained in:
parent
8b73051ece
commit
27d8d44d34
0
prosjekt.X/defmplabxtrace.log
Normal file
0
prosjekt.X/defmplabxtrace.log
Normal file
BIN
prosjekt.X/defmplabxtrace.log.inx
Normal file
BIN
prosjekt.X/defmplabxtrace.log.inx
Normal file
Binary file not shown.
@ -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
|
||||
}
|
||||
|
||||
@ -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>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user