aboutsummaryrefslogtreecommitdiffstats
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/main.cpp4
-rw-r--r--sw/relays.cpp5
2 files changed, 5 insertions, 4 deletions
diff --git a/sw/main.cpp b/sw/main.cpp
index 69e554a..303f9a7 100644
--- a/sw/main.cpp
+++ b/sw/main.cpp
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2019 Matthias P. Braendli
+ * Copyright (c) 2020 Matthias P. Braendli
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -439,7 +439,7 @@ int main()
capacity_accum += i_shunt * ltc2400_measure_interval.microsecs_ * 1e-6;
snprintf(timestamp_buf, sizeof(timestamp_buf), "DBG,%ldmV,%ldmA" ENDL,
- lrint(adc_voltage * 1e3),
+ lrint((adc_voltage - 2.5) * 1e3),
lrint(i_shunt * 1e3));
uart_puts(timestamp_buf);
diff --git a/sw/relays.cpp b/sw/relays.cpp
index 0f39fb9..1b93713 100644
--- a/sw/relays.cpp
+++ b/sw/relays.cpp
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2019 Matthias P. Braendli
+ * Copyright (c) 2020 Matthias P. Braendli
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -37,7 +37,8 @@ struct pending_event_t {
static constexpr uint32_t RELAY_SIGNAL_HOLD_TIME_US = 400000uL;
-static constexpr size_t PENDING_EVENTS_SIZE = 8;
+static constexpr size_t NUM_RELAYS = 3;
+static constexpr size_t PENDING_EVENTS_SIZE = NUM_RELAYS * 2; // two events per relay at most
static pending_event_t pending_events[PENDING_EVENTS_SIZE];