summaryrefslogtreecommitdiff
path: root/cesar/ce/rx/bitloading/src/common.c
diff options
context:
space:
mode:
authordufour2009-09-17 12:54:21 +0000
committerdufour2009-09-17 12:54:21 +0000
commit35487e616a9ca59fa4b777aa3eb27397611e60f8 (patch)
treea14bfffbdb46d0429996f124b677a08e191d095a /cesar/ce/rx/bitloading/src/common.c
parent5918a869c073c99384af22a112d08fc429813178 (diff)
* ce/rx/bitloading:
- add a generic function to handle the starting of the initial bit loading. git-svn-id: svn+ssh://pessac/svn/cesar/trunk@5593 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/ce/rx/bitloading/src/common.c')
-rw-r--r--cesar/ce/rx/bitloading/src/common.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/cesar/ce/rx/bitloading/src/common.c b/cesar/ce/rx/bitloading/src/common.c
new file mode 100644
index 0000000000..0b01083202
--- /dev/null
+++ b/cesar/ce/rx/bitloading/src/common.c
@@ -0,0 +1,37 @@
+/* Cesar project {{{
+ *
+ * Copyright (C) 2009 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file ce/rx/bitloading/src/common.c
+ * \brief Common transition functions
+ * \ingroup ce_rx
+ */
+#include "common/std.h"
+
+#include "ce/rx/bitloading/inc/initial.h"
+#include "ce/rx/cp/inc/cp.h"
+
+void
+ce_rx_bl_start_bl (ce_rx_t *ce_rx, sta_t *sta, tonemask_info_t *ts)
+{
+ /* Check parameters. */
+ dbg_assert (sta);
+ /* Not using ts directly. */
+ /* Not using ce_rx directly. */
+
+ /* Compute initial tone map. */
+ tonemap_t *initial_tm = ce_rx_bl_initial_opitmized_iterative
+ (ts, &sta->ce_rx_bt);
+ /* Set it. */
+ u8 tmi = tonemaps_set_first_free_tmi (sta->rx_tonemaps, initial_tm);
+ /* This assert is required because this is the first time we ever
+ * set a tone map in the life of this STA. So we MUST have an
+ * empty tone map index available! */
+ dbg_assert (tmi != 0);
+ sta->rx_tonemaps->default_tmi = tmi;
+ ce_rx_cp_send_mme_new_tone_map (ce_rx, sta, tmi, 0, true);
+}