From ad9e17c35c2fc358e6660d179c844b14b92c5541 Mon Sep 17 00:00:00 2001 From: jaseg Date: Fri, 6 Mar 2020 11:09:35 +0100 Subject: WIP DSSS decoding --- controller/fw/tools/gold_code_header_gen.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'controller/fw/tools/gold_code_header_gen.py') diff --git a/controller/fw/tools/gold_code_header_gen.py b/controller/fw/tools/gold_code_header_gen.py index 8247457..fa98fce 100644 --- a/controller/fw/tools/gold_code_header_gen.py +++ b/controller/fw/tools/gold_code_header_gen.py @@ -58,19 +58,13 @@ if __name__ == '__main__': print(f' *') print(f' * Each code is packed left-aligned into {nbytes} bytes in big-endian byte order.') print(f' */') - print(f'const uint8_t gold_code_{args.n}bit[{2**args.n+1}][{nbytes}] = {{') + print(f'const uint8_t {args.variable}[{2**args.n+1}][{nbytes}] = {{') for i, code in enumerate(gold(args.n)): par = '{' + ' '.join(f'0x{d:02x},' for d in np.packbits(code)) + f'}}, /* {i: 3d} "{"".join(str(x) for x in code)}" */' print(textwrap.fill(par, initial_indent=' '*4, subsequent_indent=' '*4, width=120)) print('};') print() - print(f'const uint8_t * const {args.variable} __attribute__((weak)) = (uint8_t *const)gold_code_{args.n}bit;') - print(f'const size_t {args.variable}_nbits __attribute__((weak)) = {args.n};') else: print('/* THIS IS A GENERATED FILE. DO NOT EDIT! */') with print_include_guards(f'__GOLD_CODE_GENERATED_HEADER_{args.n}__'): - print(f'extern const uint8_t gold_code_{args.n}bit[{2**args.n+1}][{nbytes}];') - - with print_include_guards(f'__GOLD_CODE_GENERATED_HEADER_GLOBAL_SYM_{args.variable.upper()}__'): print(f'extern const uint8_t {args.variable}[{2**args.n+1}][{nbytes}];') - print(f'extern const size_t {args.variable}_nbits;') -- cgit