Change in osmo-bts[master]: power_control: properly track the first initial state

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/.

fixeria gerrit-no-reply at lists.osmocom.org
Fri Jan 8 01:33:58 UTC 2021


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/22051 )


Change subject: power_control: properly track the first initial state
......................................................................

power_control: properly track the first initial state

Change-Id: I16e7474b5affbd90855a2e407b305e9dec581dfa
Related: SYS#4918, SYS#4917
---
M include/osmo-bts/gsm_data.h
M src/common/power_control.c
2 files changed, 3 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/51/22051/1

diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h
index 253b115..8071a28 100644
--- a/include/osmo-bts/gsm_data.h
+++ b/include/osmo-bts/gsm_data.h
@@ -215,6 +215,8 @@
 
 /* Measurement pre-processing state */
 struct gsm_power_ctrl_meas_proc_state {
+	/* Number of measurements processed */
+	unsigned int meas_num;
 	/* Algorithm specific data */
 	union {
 		struct {
diff --git a/src/common/power_control.c b/src/common/power_control.c
index 0629630..5e2e85e 100644
--- a/src/common/power_control.c
+++ b/src/common/power_control.c
@@ -78,7 +78,7 @@
 	int *Avg100 = &mps->ewma.Avg100;
 
 	/* We don't have 'Avg[n - 1]' if this is the first run */
-	if (*Avg100 == 0) {
+	if (mps->meas_num++ == 0) {
 		*Avg100 = Val * EWMA_SCALE_FACTOR;
 		return Val;
 	}

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/22051
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I16e7474b5affbd90855a2e407b305e9dec581dfa
Gerrit-Change-Number: 22051
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210108/b7ac0e04/attachment.htm>


More information about the gerrit-log mailing list