laforge has submitted this change. (
https://gerrit.osmocom.org/c/osmo-e1-hardware/+/29607
)
Change subject: icE1usb fw/gpsdo: Export accumulated error
......................................................................
icE1usb fw/gpsdo: Export accumulated error
This is a pretty usefu stat as this is what actually matters
Note that structure is just extended so any call with a wLength
shorter will just get the beginning of the struct (usb stack
limits response to wLength) and thus is fully backward compatible.
Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com>
Change-Id: I0aa919d4870ca7e1b653b82ac4f76ed26b5e3b08
---
M firmware/ice40-riscv/icE1usb/gpsdo.c
M firmware/ice40-riscv/icE1usb/ice1usb_proto.h
2 files changed, 2 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/firmware/ice40-riscv/icE1usb/gpsdo.c b/firmware/ice40-riscv/icE1usb/gpsdo.c
index c1df4b0..477d2e7 100644
--- a/firmware/ice40-riscv/icE1usb/gpsdo.c
+++ b/firmware/ice40-riscv/icE1usb/gpsdo.c
@@ -102,6 +102,7 @@
status->tune.coarse = g_gpsdo.tune.coarse;
status->tune.fine = g_gpsdo.tune.fine;
status->freq_est = g_gpsdo.meas.last;
+ status->err_acc = (g_gpsdo.state == STATE_TUNE_FINE) ? g_gpsdo.fine.acc : 0;
}
void
diff --git a/firmware/ice40-riscv/icE1usb/ice1usb_proto.h
b/firmware/ice40-riscv/icE1usb/ice1usb_proto.h
index 3170d55..38cb23b 100644
--- a/firmware/ice40-riscv/icE1usb/ice1usb_proto.h
+++ b/firmware/ice40-riscv/icE1usb/ice1usb_proto.h
@@ -65,6 +65,7 @@
uint8_t mode; /*!< Current configured operating mode */
struct e1usb_gpsdo_tune tune; /*!< Current VCXO tuning values */
uint32_t freq_est; /*!< Latest frequency estimate measurement */
+ int16_t err_acc; /*!< Accumulated error */
} __attribute__((packed));
--
To view, visit
https://gerrit.osmocom.org/c/osmo-e1-hardware/+/29607
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-e1-hardware
Gerrit-Branch: master
Gerrit-Change-Id: I0aa919d4870ca7e1b653b82ac4f76ed26b5e3b08
Gerrit-Change-Number: 29607
Gerrit-PatchSet: 1
Gerrit-Owner: tnt <tnt(a)246tNt.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged