time(NULL) replaced with uptime() in helper files

Reason: Zephyr does not support time(NULL). This way it is portable.
This commit is contained in:
Martin Jaeger
2020-01-16 20:04:37 +01:00
parent 632eb5a4f7
commit a76b92c27b
12 changed files with 137 additions and 37 deletions
+2 -2
View File
@@ -6,12 +6,12 @@
#include "eeprom.h"
#include <time.h>
#include <stdio.h>
#include "mcu.h"
#include "pcb.h"
#include "thingset.h"
#include "helper.h"
// versioning of EEPROM layout (2 bytes)
// change the version number each time the data object array below is changed!
@@ -286,7 +286,7 @@ void eeprom_restore_data() {;}
void eeprom_update()
{
if (time(NULL) % EEPROM_UPDATE_INTERVAL == 0 && time(NULL) > 0) {
if (uptime() % EEPROM_UPDATE_INTERVAL == 0 && uptime() > 0) {
eeprom_store_data();
}
}