|
@@ -51,7 +51,7 @@ void PrintCounter::initStats() {
|
51
|
51
|
this->data = { 0, 0, 0, 0 };
|
52
|
52
|
|
53
|
53
|
this->saveStats();
|
54
|
|
- eeprom_write_byte((uint8_t*) this->addr, 0x16);
|
|
54
|
+ eeprom_write_byte((uint8_t *) this->address, 0x16);
|
55
|
55
|
}
|
56
|
56
|
|
57
|
57
|
void PrintCounter::loadStats() {
|
|
@@ -60,8 +60,8 @@ void PrintCounter::loadStats() {
|
60
|
60
|
#endif
|
61
|
61
|
|
62
|
62
|
// Checks if the EEPROM block is initialized
|
63
|
|
- if (eeprom_read_byte((uint8_t*) this->addr) != 0x16) this->initStats();
|
64
|
|
- else eeprom_read_block(&this->data, (void *)(this->addr + sizeof(uint8_t)), sizeof(printStatistics));
|
|
63
|
+ if (eeprom_read_byte((uint8_t *) this->address) != 0x16) this->initStats();
|
|
64
|
+ else eeprom_read_block(&this->data, (void *)(this->address + sizeof(uint8_t)), sizeof(printStatistics));
|
65
|
65
|
|
66
|
66
|
this->loaded = true;
|
67
|
67
|
}
|
|
@@ -74,7 +74,7 @@ void PrintCounter::saveStats() {
|
74
|
74
|
// Refuses to save data is object is not loaded
|
75
|
75
|
if (!this->isLoaded()) return;
|
76
|
76
|
|
77
|
|
- eeprom_write_block(&this->data, (void *)(this->addr + sizeof(uint8_t)), sizeof(printStatistics));
|
|
77
|
+ eeprom_update_block(&this->data, (void *)(this->address + sizeof(uint8_t)), sizeof(printStatistics));
|
78
|
78
|
}
|
79
|
79
|
|
80
|
80
|
void PrintCounter::showStats() {
|