summaryrefslogtreecommitdiff
path: root/controller/fw/src/dsss_demod.h
diff options
context:
space:
mode:
Diffstat (limited to 'controller/fw/src/dsss_demod.h')
-rw-r--r--controller/fw/src/dsss_demod.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/controller/fw/src/dsss_demod.h b/controller/fw/src/dsss_demod.h
index 448abb4..b865d83 100644
--- a/controller/fw/src/dsss_demod.h
+++ b/controller/fw/src/dsss_demod.h
@@ -10,8 +10,12 @@
/* FIXME: move to makefile */
#define DSSS_MATCHER_CACHE_SIZE 8
-/* FIXME: move to more appropriate header */
-#define PAYLOAD_DATA_BYTE ((PAYLOAD_DATA_BIT+7)/8)
+
+#if DSSS_GOLD_CODE_NBITS < 8
+typedef uint8_t symbol_t;
+#else
+typedef uint16_t symbol_t;
+#endif
struct iir_biquad {
float a[2];
@@ -43,12 +47,9 @@ struct matcher_state {
int last_skips;
int candidate_skips;
-#if DSSS_GOLD_CODE_NBITS > 7
-#error DSSS_GOLD_CODE_NBITS is too large for matcher_state.data data type (uint8_t)
-#endif
- uint8_t data[TRANSMISSION_SYMBOLS];
+ symbol_t data[TRANSMISSION_SYMBOLS];
int data_pos;
- uint8_t candidate_data;
+ symbol_t candidate_data;
};
struct dsss_demod_state {
@@ -66,7 +67,7 @@ struct dsss_demod_state {
};
-extern void handle_dsss_received(uint8_t data[static TRANSMISSION_SYMBOLS]);
+extern void handle_dsss_received(symbol_t data[static TRANSMISSION_SYMBOLS]);
void dsss_demod_init(struct dsss_demod_state *st);
void dsss_demod_step(struct dsss_demod_state *st, float new_value, uint64_t ts);