summaryrefslogtreecommitdiff
path: root/cesar/ce/rx/src
diff options
context:
space:
mode:
authordufour2010-05-19 14:58:17 +0000
committerdufour2010-05-19 14:58:17 +0000
commitdf65b73fd6d173cae76eb14785ea4398989a11cb (patch)
tree09ac086646094ba2921acaec35467d3a9aa2500d /cesar/ce/rx/src
parent2bf9707a081ad7b02ef44139e0303112f1cdfed6 (diff)
cesar/ce/rx: prevent the CE from restarting too soon, closes #1557
Add a minimum time to respect between too restart of the CE. This time is expressed in milliseconds and can be configured (default value set to 500ms) for both PB error rate and BER criteria. Also change the type of PB error rate frame counter which can now overflow because of this new criteria. git-svn-id: svn+ssh://pessac/svn/cesar/trunk@7117 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/ce/rx/src')
-rw-r--r--cesar/ce/rx/src/rx.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/cesar/ce/rx/src/rx.c b/cesar/ce/rx/src/rx.c
index 74a4591137..1605e589c2 100644
--- a/cesar/ce/rx/src/rx.c
+++ b/cesar/ce/rx/src/rx.c
@@ -22,6 +22,7 @@
#include "lib/stats.h"
#include "ce/rx/bitloading/inc/nsr.h"
#include "ce/rx/bitloading/inc/ber.h"
+#include "ce/rx/bitloading/inc/common.h"
/**
* Static context of the CE in RX.
@@ -88,6 +89,12 @@ ce_rx_init (mac_store_t *mac_store, sar_t *sar, pbproc_t *pbproc,
lib_stats_set_stat_value_notype ("CE_RX_BL_BER_LOWER_BOUND",
&ce_rx_bl_ber_lower_bound_,
LIB_STATS_ACCESS_READ_WRITE);
+ lib_stats_set_stat_value_notype ("CE_RX_BL_MIN_TIME_BETWEEN_CE_RESTART_PBER_MS",
+ &ce_rx_bl_min_time_between_ce_restart_ms[0],
+ LIB_STATS_ACCESS_READ_WRITE);
+ lib_stats_set_stat_value_notype ("CE_RX_BL_MIN_TIME_BETWEEN_CE_RESTART_BER_MS",
+ &ce_rx_bl_min_time_between_ce_restart_ms[1],
+ LIB_STATS_ACCESS_READ_WRITE);
/* ECos. */
/* No work to do. */
@@ -103,9 +110,9 @@ ce_rx_init (mac_store_t *mac_store, sar_t *sar, pbproc_t *pbproc,
&ce_rx.alarm_handler, &ce_rx.alarm);
cyg_resolution_t res = cyg_clock_get_resolution (cyg_real_time_clock ());
- u32 tck_per_rtc = MAC_MS_TO_TCK (1000LL) * res.dividend / res.divisor
+ ce_rx.tck_per_rtc = MAC_MS_TO_TCK (1000LL) * res.dividend / res.divisor
/ 1000000000LL;
- cyg_tick_count_t period = MAC_MS_TO_TCK (1000) / tck_per_rtc;
+ cyg_tick_count_t period = MAC_MS_TO_TCK (1000) / ce_rx.tck_per_rtc;
cyg_alarm_initialize (ce_rx.alarm_handler, period + cyg_current_time (),
period);