summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/common/timefuncs.c3
-rw-r--r--firmware/drivers/adc.c2
2 files changed, 2 insertions, 3 deletions
diff --git a/firmware/common/timefuncs.c b/firmware/common/timefuncs.c
index 19033a5..6671dc0 100644
--- a/firmware/common/timefuncs.c
+++ b/firmware/common/timefuncs.c
@@ -43,12 +43,11 @@ bool valid_time(const struct tm *tm)
return true;
}
-static int last_tick = 0;
-
struct tm *get_time(void)
{
#ifndef SIMULATOR
#ifdef CONFIG_RTC
+ static long last_tick = 0;
/* Don't read the RTC more than 4 times per second */
if (last_tick + HZ/4 < current_tick) {
diff --git a/firmware/drivers/adc.c b/firmware/drivers/adc.c
index 1755faf..f4bdb7a 100644
--- a/firmware/drivers/adc.c
+++ b/firmware/drivers/adc.c
@@ -321,7 +321,7 @@ void adc_init(void)
{
struct adc_struct *adc_battery = &adcdata[ADC_BATTERY];
adc_battery->channelnum = 0x3; /* ADCVIN1, subtractor */
-
+ adc_battery->last_read = current_tick;
adc_scan(adc_battery);
}