diff options
author | Harald Welte <laforge@gnumonks.org> | 2017-02-07 19:58:41 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-02-07 20:17:27 +0100 |
commit | df5ac9aa119f7a11feecbd65de5828281a197588 (patch) | |
tree | 824e7bafc468cc043c8652cc723b961092d0efd5 /src/common/tx_power.c | |
parent | 13d0feb4043a4dbd0f0cde010cbe8697d2b70629 (diff) |
tx_power: Change PA calibration tables to use delta vales
It seems more user friendly to look at a calibration table in terms of
the delta (positive or negative) compared to the nominal gain value,
rather than a collection of absolute gain values. It has the added
benefit that the (API/data model) user doesn't have to specify a gain
value for each ARFCN, but rather can rely on the default nominal gain in
absence of a calibration table for this specific unit.
Change-Id: I7311815902a88d2fc9d211cf4c62fa6fdc5e86ad
Diffstat (limited to 'src/common/tx_power.c')
-rw-r--r-- | src/common/tx_power.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/tx_power.c b/src/common/tx_power.c index f8adb6a6..c5179181 100644 --- a/src/common/tx_power.c +++ b/src/common/tx_power.c @@ -33,12 +33,12 @@ static int get_pa_drive_level_mdBm(const struct power_amp *pa, int desired_p_out_mdBm, unsigned int arfcn) { - if (arfcn >= ARRAY_SIZE(pa->calib.gain_mdB)) + if (arfcn >= ARRAY_SIZE(pa->calib.delta_mdB)) return INT_MIN; /* FIXME: temperature compensation */ - return desired_p_out_mdBm - pa->calib.gain_mdB[arfcn]; + return desired_p_out_mdBm - pa->nominal_gain_mdB - pa->calib.delta_mdB[arfcn]; } /* maximum output power of the system */ |