summaryrefslogtreecommitdiff
path: root/cesar/ce/rx/bitloading/src/transition.c
diff options
context:
space:
mode:
Diffstat (limited to 'cesar/ce/rx/bitloading/src/transition.c')
-rw-r--r--cesar/ce/rx/bitloading/src/transition.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/cesar/ce/rx/bitloading/src/transition.c b/cesar/ce/rx/bitloading/src/transition.c
index 1a2edb3ba5..0f08301454 100644
--- a/cesar/ce/rx/bitloading/src/transition.c
+++ b/cesar/ce/rx/bitloading/src/transition.c
@@ -302,6 +302,12 @@ ce_rx_bl_fsm__TRACKING__data (ce_rx_t *ce_rx,
{
tm = sta->rx_tonemaps->tm[measure->rx_params.tmi_av];
}
+ else
+ {
+ dbg_assert (measure->rx_params.tmi_av < PHY_MOD_ROBO_NB);
+ tm = &ce_rx->mac_config->tonemask_info.tonemap_robo[measure->
+ rx_params.tmi_av];
+ }
/* Increase CE statistics. */
/* If measure is a negotiated tone map. */
@@ -317,14 +323,20 @@ ce_rx_bl_fsm__TRACKING__data (ce_rx_t *ce_rx,
* FIXME: this will not work with intervals. */
if (sta->rx_tonemaps->default_tmi == measure->rx_params.tmi_av)
{
+ /* Because default_tmi == tmi_av, we necessarily have the
+ * corresponding tonemap. */
+ dbg_assert (tm);
+
ce_rx_bitloading_t *bl = &sta->ce_rx_bt;
dbg_assert (bl);
u8 good_pb_count = measure->total_pb_count - measure->false_pb_count;
u16 pb_size =
(measure->rx_params.pb_size == PHY_PB_SIZE_136 ? 136 : 520) * 8;
- /* Update BER sliding means. */
- if (good_pb_count)
+ /* Update BER sliding means. Except if the frame contained only one
+ * good PB, and it took less than one symbol. */
+ if (good_pb_count
+ && !(good_pb_count == 1 && pb_size < tm->bits_per_symbol))
ce_rx_bl_ber_sliding_mean_update
(bl, ce_rx_bl_ber_quantify
(measure->ber_sum, good_pb_count, pb_size));
@@ -385,11 +397,9 @@ ce_rx_bl_fsm__TRACKING__data (ce_rx_t *ce_rx,
or the tone map is not at the maximum
and not too soon. */
if ((!tm_is_negotiated
- ||
- ((tm)
- && (tm->bits_per_symbol
- < (ce_rx->mac_config->tonemask_info.carrier_nb
- * CE_BIT_PER_MOD[CE_MOD_COUNT - 1]))))
+ || (tm->bits_per_symbol <
+ (ce_rx->mac_config->tonemask_info.carrier_nb
+ * CE_BIT_PER_MOD[CE_MOD_COUNT - 1])))
&& lesseq_mod2p32
(bl->next_date_min_for_restart_rtc_date[1],
cyg_current_time ()))