diff options
author | jaseg <git-bigdata-wsl-arch@jaseg.de> | 2020-04-17 17:59:08 +0200 |
---|---|---|
committer | jaseg <git-bigdata-wsl-arch@jaseg.de> | 2020-04-17 17:59:08 +0200 |
commit | 87ae7dfcb35d9a55950eecc2116d13d73b2b9ece (patch) | |
tree | 090946c28eb7b9d3028844bf4e0dcc01ddb29664 /controller/fw/src/dsss_demod.h | |
parent | e505627adad7510673f983cd158016342aa1bdfc (diff) | |
download | master-thesis-87ae7dfcb35d9a55950eecc2116d13d73b2b9ece.tar.gz master-thesis-87ae7dfcb35d9a55950eecc2116d13d73b2b9ece.tar.bz2 master-thesis-87ae7dfcb35d9a55950eecc2116d13d73b2b9ece.zip |
fw simulator: WIP
Diffstat (limited to 'controller/fw/src/dsss_demod.h')
-rw-r--r-- | controller/fw/src/dsss_demod.h | 17 |
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); |