Change in osmo-e1-hardware[master]: icE1usb fw: e1_tick_read() for rx and tx

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Thu Dec 17 17:02:56 UTC 2020


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/21772 )


Change subject: icE1usb fw: e1_tick_read() for rx and tx
......................................................................

icE1usb fw: e1_tick_read() for rx and tx

Change-Id: I8dd6765f27cdf5ab21ccb8290002c44eef67f96f
---
M firmware/ice40-riscv/icE1usb/misc.c
M firmware/ice40-riscv/icE1usb/misc.h
M firmware/ice40-riscv/icE1usb/usb_e1.c
3 files changed, 12 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/72/21772/1

diff --git a/firmware/ice40-riscv/icE1usb/misc.c b/firmware/ice40-riscv/icE1usb/misc.c
index 25fb7f4..c84e848 100644
--- a/firmware/ice40-riscv/icE1usb/misc.c
+++ b/firmware/ice40-riscv/icE1usb/misc.c
@@ -71,13 +71,21 @@
 }
 
 uint16_t
-e1_tick_read(uint8_t port)
+e1_tick_read_tx(uint8_t port)
 {
 	if (port >= 2)
 		return 0xffff;
 	return misc_regs->e1_tick[port].tx;
 }
 
+uint16_t
+e1_tick_read_rx(uint8_t port)
+{
+	if (port >= 2)
+		return 0xffff;
+	return misc_regs->e1_tick[port].rx;
+}
+
 void
 reboot(int fw)
 {
diff --git a/firmware/ice40-riscv/icE1usb/misc.h b/firmware/ice40-riscv/icE1usb/misc.h
index b405b02..c680969 100644
--- a/firmware/ice40-riscv/icE1usb/misc.h
+++ b/firmware/ice40-riscv/icE1usb/misc.h
@@ -27,6 +27,7 @@
 void pdm_set(int chan, bool enable, unsigned value, bool normalize);
 
 void e1_led_set(bool enable, uint8_t cfg);
-uint16_t e1_tick_read(uint8_t port);
+uint16_t e1_tick_read_rx(uint8_t port);
+uint16_t e1_tick_read_tx(uint8_t port);
 
 void reboot(int fw);
diff --git a/firmware/ice40-riscv/icE1usb/usb_e1.c b/firmware/ice40-riscv/icE1usb/usb_e1.c
index 529ead3..e594a99 100644
--- a/firmware/ice40-riscv/icE1usb/usb_e1.c
+++ b/firmware/ice40-riscv/icE1usb/usb_e1.c
@@ -42,7 +42,7 @@
 	unsigned int level;
 
 	/* Compute real E1 tick count (with safety against bad values) */
-	ticks = e1_tick_read(0);
+	ticks = e1_tick_read_tx(0);
 	val = (ticks - ticks_prev) & 0xffff;
 	ticks_prev = ticks;
 	if ((val < 7168) | (val > 9216))

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/21772
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: I8dd6765f27cdf5ab21ccb8290002c44eef67f96f
Gerrit-Change-Number: 21772
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201217/89fb0aab/attachment.htm>


More information about the gerrit-log mailing list