Refactoring: moved layer1-related stuff to subdirectory

This commit is contained in:
Thomas Kolb 2022-02-13 20:01:33 +01:00
parent a124c04021
commit 513a399ae4
20 changed files with 55 additions and 55 deletions

View File

@ -11,20 +11,20 @@ set(sources
src/utils.c
src/utils.h
src/main.c
src/packet_mod.h
src/results.h
src/packet_mod.c
src/config.h
src/preamble.h
src/preamble.c
src/transmission.h
src/transmission.c
src/correlator.h
src/correlator.c
src/freq_est.h
src/freq_est.c
src/whitening.h
src/whitening.c
src/layer1/config.h
src/layer1/correlator.c
src/layer1/correlator.h
src/layer1/freq_est.c
src/layer1/freq_est.h
src/layer1/packet_mod.c
src/layer1/packet_mod.h
src/layer1/preamble.c
src/layer1/preamble.h
src/layer1/results.h
src/layer1/transmission.c
src/layer1/transmission.h
src/layer1/whitening.c
src/layer1/whitening.h
)
include_directories(

View File

@ -1,5 +1,5 @@
#ifndef CONFIG_H
#define CONFIG_H
#ifndef LAYER1_CONFIG_H
#define LAYER1_CONFIG_H
#include <liquid/liquid.h>
@ -22,4 +22,4 @@
#define TRANSMISSION_RAMP_UP_LEN 64 // symbols
#define TRANSMISSION_RAMP_DOWN_LEN 32 // symbols
#endif // CONFIG_H
#endif // LAYER1_CONFIG_H

View File

@ -1,5 +1,5 @@
#ifndef CORRELATOR_H
#define CORRELATOR_H
#ifndef LAYER1_CORRELATOR_H
#define LAYER1_CORRELATOR_H
/*!
* \file
@ -144,4 +144,4 @@ float correlator_get_mean_phase_deviation(correlator_ctx_t *ctx, size_t L);
float correlator_get_mean_frequency_deviation(correlator_ctx_t *ctx, size_t L, float *phase_offset);
#endif // CORRELATOR_H
#endif // LAYER1_CORRELATOR_H

View File

@ -1,5 +1,5 @@
#ifndef FREQ_EST_H
#define FREQ_EST_H
#ifndef LAYER1_FREQ_EST_H
#define LAYER1_FREQ_EST_H
#include <complex.h>
#include <stdlib.h>
@ -49,4 +49,4 @@ float freq_est_known_symbols(const float complex *recv, const float complex *ref
*/
float freq_est_data_free(const float complex *symbols, size_t n, float *final_phase);
#endif // FREQ_EST_H
#endif // LAYER1_FREQ_EST_H

View File

@ -1,5 +1,5 @@
#ifndef PACKET_DEMOD
#define PACKET_DEMOD
#ifndef LAYER1_PACKET_DEMOD_H
#define LAYER1_PACKET_DEMOD_H
#include <stdlib.h>
#include <complex.h>
@ -176,4 +176,4 @@ result_t packet_demod_get_result_b(packet_demod_ctx_t *ctx, unsigned char *data,
*/
result_t packet_demod_get_result_cf(packet_demod_ctx_t *ctx, float complex *data, size_t *length);
#endif // PACKET_DEMOD
#endif // LAYER1_PACKET_DEMOD_H

View File

@ -1,5 +1,5 @@
#ifndef PACKET_MOD_H
#define PACKET_MOD_H
#ifndef LAYER1_PACKET_MOD_H
#define LAYER1_PACKET_MOD_H
#include <stdlib.h>
#include <complex.h>
@ -166,4 +166,4 @@ result_t packet_mod_get_result_b(packet_mod_ctx_t *ctx, unsigned char *data, siz
*/
result_t packet_mod_get_result_cf(packet_mod_ctx_t *ctx, float complex *data, size_t *length);
#endif // PACKET_MOD_H
#endif // LAYER1_PACKET_MOD_H

View File

@ -1,5 +1,5 @@
#ifndef PREAMBLE_H
#define PREAMBLE_H
#ifndef LAYER1_PREAMBLE_H
#define LAYER1_PREAMBLE_H
#include <stdlib.h>
#include <complex.h>
@ -7,4 +7,4 @@
const float complex* preamble_get_symbols(void);
size_t preamble_get_symbol_count(void);
#endif // PREAMBLE_H
#endif // LAYER1_PREAMBLE_H

View File

@ -1,5 +1,5 @@
#ifndef RESULTS_H
#define RESULTS_H
#ifndef LAYER1_RESULTS_H
#define LAYER1_RESULTS_H
typedef enum {
OK,
@ -24,4 +24,4 @@ typedef enum {
# define ERR_CHECK_LIQUID(call) if((call) != LIQUID_OK) { return ERR_LIQUID; }
#endif
#endif // RESULTS_H
#endif // LAYER1_RESULTS_H

View File

@ -1,5 +1,5 @@
#ifndef TRANSMISSION_H
#define TRANSMISSION_H
#ifndef LAYER1_TRANSMISSION_H
#define LAYER1_TRANSMISSION_H
#include <stdlib.h>
#include <complex.h>
@ -76,4 +76,4 @@ result_t transmission_filter_packet(
size_t *output_size);
#endif // TRANSMISSION_H
#endif // LAYER1_TRANSMISSION_H

View File

@ -1,9 +1,9 @@
#ifndef WHITENING_H
#define WHITENING_H
#ifndef LAYER1_WHITENING_H
#define LAYER1_WHITENING_H
#include <stdint.h>
#include <stdlib.h>
void whitening_apply_in_place(uint8_t *data, size_t length);
#endif // WHITENING_H
#endif // LAYER1_WHITENING_H

View File

@ -4,15 +4,15 @@
#include <math.h>
#include <liquid/liquid.h>
#include "results.h"
#include "utils.h"
#include "packet_mod.h"
#include "config.h"
#include "preamble.h"
#include "transmission.h"
#include "correlator.h"
#include "freq_est.h"
#include "whitening.h"
#include "layer1/results.h"
#include "layer1/packet_mod.h"
#include "layer1/config.h"
#include "layer1/preamble.h"
#include "layer1/transmission.h"
#include "layer1/correlator.h"
#include "layer1/freq_est.h"
#include "layer1/whitening.h"
typedef enum {
RX_STATE_ACQUISITION,

View File

@ -1,10 +1,10 @@
add_executable(
test_correlator
../src/correlator.c
../src/correlator.h
../src/freq_est.c
../src/freq_est.h
test_correlator.c
../src/layer1/correlator.c
../src/layer1/correlator.h
../src/layer1/freq_est.c
../src/layer1/freq_est.h
layer1/test_correlator.c
)
target_link_libraries(

View File

@ -1,6 +1,6 @@
#include <stdio.h>
#include <correlator.h>
#include <layer1/correlator.h>
#define ARRAY_LEN(x) (sizeof(x) / sizeof(x[0]))