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.orglaforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/21732 ) Change subject: icE1usb: add port number argument to e1_tick_read() ...................................................................... icE1usb: add port number argument to e1_tick_read() Change-Id: I0f4548b5623a7eaf74af3076c301e029bb3933da --- 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, 6 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/32/21732/1 diff --git a/firmware/ice40-riscv/icE1usb/misc.c b/firmware/ice40-riscv/icE1usb/misc.c index 3117be9..25fb7f4 100644 --- a/firmware/ice40-riscv/icE1usb/misc.c +++ b/firmware/ice40-riscv/icE1usb/misc.c @@ -71,9 +71,11 @@ } uint16_t -e1_tick_read(void) +e1_tick_read(uint8_t port) { - return misc_regs->e1_tick[0].tx; + if (port >= 2) + return 0xffff; + return misc_regs->e1_tick[port].tx; } void diff --git a/firmware/ice40-riscv/icE1usb/misc.h b/firmware/ice40-riscv/icE1usb/misc.h index 69c0da7..b405b02 100644 --- a/firmware/ice40-riscv/icE1usb/misc.h +++ b/firmware/ice40-riscv/icE1usb/misc.h @@ -27,6 +27,6 @@ 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(void); +uint16_t e1_tick_read(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 151d902..b4d4f81 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(); + ticks = e1_tick_read(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/+/21732 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: I0f4548b5623a7eaf74af3076c301e029bb3933da Gerrit-Change-Number: 21732 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/20201215/3db82666/attachment.htm>