mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-31 03:57:45 +08:00
*** empty log message ***
This commit is contained in:
@@ -1,15 +1,6 @@
|
||||
DEBUG =n
|
||||
OS =$(shell uname)
|
||||
|
||||
CFLAGS =-Wall -Wstrict-prototypes -I/usr/X11R6/include
|
||||
ifeq ($(OS),SunOS)
|
||||
ifeq ($(DEBUG),y)
|
||||
CFLAGS +=-g -O -DSUN_AUDIO -DARCH_SPARC
|
||||
else
|
||||
CFLAGS +=-O3 -DSUN_AUDIO -DARCH_SPARC
|
||||
endif
|
||||
LDFLAGSX =-lX11 -L/usr/X11R6/lib -R/usr/X11R6/lib -lsocket -lnsl
|
||||
else
|
||||
ifeq ($(DEBUG),y)
|
||||
CFLAGS +=-g -O -march=i486 -falign-loops=2 -falign-jumps=2 \
|
||||
-falign-functions=2 -DARCH_I386
|
||||
@@ -18,7 +9,6 @@ CFLAGS +=-O3 -march=i486 -falign-loops=2 -falign-jumps=2 \
|
||||
-falign-functions=2 -DARCH_I386
|
||||
endif
|
||||
LDFLAGSX =-lX11 -L/usr/X11R6/lib
|
||||
endif
|
||||
|
||||
|
||||
#BINDIR =bin-$(shell uname -m)
|
||||
@@ -51,14 +41,8 @@ $(BINDIR)/%.o: %.c
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
SRC_L2 =hdlc.c pprz.c
|
||||
# pocsag.c
|
||||
# SRC_L1 =demod_afsk12.c demod_afsk24.c demod_afsk24_2.c demod_afsk48p.c demod_afsk48.c
|
||||
SRC_L1 = demod_afsk48p.c demod_display.c
|
||||
#SRC_L1 +=demod_hapn48.c demod_fsk96.c
|
||||
#SRC_L1 +=demod_poc5.c demod_poc12.c demod_poc24.c
|
||||
#SRC_L1 +=demod_dtmf.c demod_zvei.c demod_display.c
|
||||
SRC_MISC = unixinput.c xdisplay.c
|
||||
# costabf.c
|
||||
|
||||
SRC_GEN =gen.c gen_dtmf.c gen_sin.c gen_zvei.c gen_hdlc.c costabi.c
|
||||
|
||||
@@ -84,10 +68,10 @@ costabi.c costabf.c: $(BINDIR)/mkcostab
|
||||
$(BINDIR)/mkcostab
|
||||
|
||||
clean:
|
||||
$(RM) -f core `find . -name '*.[oas]' -print`
|
||||
$(RM) -f core `find . -name 'core' -print`
|
||||
$(RM) -f core costabi.c costabf.c *~
|
||||
|
||||
$(RM) -f core `find . -name '*.[oas]' -print`
|
||||
$(RM) -f core `find . -name 'core' -print`
|
||||
$(RM) -f core costabi.c costabf.c *~
|
||||
$(RM) $(BINDIR)/multimon
|
||||
|
||||
depend dep:
|
||||
$(CPP) -M $(CFLAGS) $(SRC_MISC) $(SRC_L1) $(SRC_L2) $(SRC_GEN) mkcostab.c > $(BINDIR)/.depend
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
/*
|
||||
* gen.h -- generate different test signals
|
||||
*
|
||||
* Copyright (C) 1997
|
||||
* Thomas Sailer (sailer@ife.ee.ethz.ch, hb9jnx@hb9w.che.eu)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
#define SAMPLE_RATE 22050
|
||||
#define MS(x) ((float)(x)*SAMPLE_RATE/1000)
|
||||
|
||||
extern const int costabi[0x400];
|
||||
|
||||
#define COS(x) costabi[(((x)>>6)&0x3ffu)]
|
||||
|
||||
enum gen_type { gentype_dtmf, gentype_sine, gentype_zvei, gentype_hdlc };
|
||||
|
||||
struct gen_params {
|
||||
enum gen_type type;
|
||||
int ampl;
|
||||
union {
|
||||
struct {
|
||||
int duration;
|
||||
int pause;
|
||||
char str[256];
|
||||
} dtmf;
|
||||
struct {
|
||||
int duration;
|
||||
int freq;
|
||||
} sine;
|
||||
struct {
|
||||
int duration;
|
||||
int pause;
|
||||
char str[256];
|
||||
} zvei;
|
||||
struct {
|
||||
int modulation;
|
||||
int txdelay;
|
||||
int pktlen;
|
||||
unsigned char pkt[256];
|
||||
} hdlc;
|
||||
} p;
|
||||
};
|
||||
|
||||
struct gen_state {
|
||||
union {
|
||||
struct {
|
||||
int ch_idx;
|
||||
int ph_row, ph_col, phinc_row, phinc_col;
|
||||
int time, time2;
|
||||
} dtmf;
|
||||
struct {
|
||||
int ph, phinc;
|
||||
int time;
|
||||
} sine;
|
||||
struct {
|
||||
int ch_idx;
|
||||
int ph, phinc;
|
||||
int time, time2;
|
||||
} zvei;
|
||||
struct {
|
||||
int lastb;
|
||||
int ch_idx, bitmask;
|
||||
unsigned int ph, phinc, bitph;
|
||||
unsigned int datalen;
|
||||
unsigned char data[512];
|
||||
} hdlc;
|
||||
} s;
|
||||
};
|
||||
|
||||
extern void gen_init_dtmf(struct gen_params *p, struct gen_state *s);
|
||||
extern int gen_dtmf(signed short *buf, int buflen, struct gen_params *p, struct gen_state *s);
|
||||
|
||||
extern void gen_init_sine(struct gen_params *p, struct gen_state *s);
|
||||
extern int gen_sine(signed short *buf, int buflen, struct gen_params *p, struct gen_state *s);
|
||||
|
||||
extern void gen_init_zvei(struct gen_params *p, struct gen_state *s);
|
||||
extern int gen_zvei(signed short *buf, int buflen, struct gen_params *p, struct gen_state *s);
|
||||
|
||||
extern void gen_init_hdlc(struct gen_params *p, struct gen_state *s);
|
||||
extern int gen_hdlc(signed short *buf, int buflen, struct gen_params *p, struct gen_state *s);
|
||||
|
||||
@@ -33,154 +33,56 @@ extern const float costabf[0x400];
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
struct demod_state {
|
||||
const struct demod_param *dem_par;
|
||||
union {
|
||||
struct l2_state_hdlc {
|
||||
unsigned char rxbuf[512];
|
||||
unsigned char *rxptr;
|
||||
unsigned int rxstate;
|
||||
unsigned int rxbitstream;
|
||||
unsigned int rxbitbuf;
|
||||
} hdlc;
|
||||
const struct demod_param *dem_par;
|
||||
union {
|
||||
struct l2_state_hdlc {
|
||||
unsigned char rxbuf[512];
|
||||
unsigned char *rxptr;
|
||||
unsigned int rxstate;
|
||||
unsigned int rxbitstream;
|
||||
unsigned int rxbitbuf;
|
||||
} hdlc;
|
||||
|
||||
struct l2_state_pocsag {
|
||||
unsigned long rx_data;
|
||||
struct l2_pocsag_rx {
|
||||
unsigned char rx_sync;
|
||||
unsigned char rx_word;
|
||||
unsigned char rx_bit;
|
||||
char func;
|
||||
unsigned long adr;
|
||||
unsigned char buffer[128];
|
||||
unsigned int numnibbles;
|
||||
} rx[2];
|
||||
} pocsag;
|
||||
|
||||
struct l2_state_pprz {
|
||||
unsigned char rxbuf[512];
|
||||
unsigned char *rxptr;
|
||||
unsigned int rxstate;
|
||||
unsigned int rxbitstream;
|
||||
unsigned int rxbitbuf;
|
||||
char* pipe_path;
|
||||
int pipe_fd;
|
||||
} pprz;
|
||||
} l2;
|
||||
union {
|
||||
struct l1_state_poc5 {
|
||||
unsigned int dcd_shreg;
|
||||
unsigned int sphase;
|
||||
unsigned int subsamp;
|
||||
} poc5;
|
||||
struct l2_state_pprz {
|
||||
unsigned char rxbuf[512];
|
||||
unsigned char *rxptr;
|
||||
unsigned int rxstate;
|
||||
unsigned int rxbitstream;
|
||||
unsigned int rxbitbuf;
|
||||
char* pipe_path;
|
||||
int pipe_fd;
|
||||
} pprz;
|
||||
} l2;
|
||||
union {
|
||||
struct l1_state_afsk48p {
|
||||
unsigned int dcd_shreg;
|
||||
unsigned int sphase;
|
||||
unsigned int lasts;
|
||||
unsigned int dcd_count;
|
||||
unsigned int sample_count;
|
||||
} afsk48p;
|
||||
|
||||
struct l1_state_poc12 {
|
||||
unsigned int dcd_shreg;
|
||||
unsigned int sphase;
|
||||
unsigned int subsamp;
|
||||
} poc12;
|
||||
|
||||
struct l1_state_poc24 {
|
||||
unsigned int dcd_shreg;
|
||||
unsigned int sphase;
|
||||
} poc24;
|
||||
|
||||
struct l1_state_afsk12 {
|
||||
unsigned int dcd_shreg;
|
||||
unsigned int sphase;
|
||||
unsigned int lasts;
|
||||
unsigned int subsamp;
|
||||
} afsk12;
|
||||
|
||||
struct l1_state_afsk24 {
|
||||
unsigned int dcd_shreg;
|
||||
unsigned int sphase;
|
||||
unsigned int lasts;
|
||||
} afsk24;
|
||||
|
||||
struct l1_state_afsk48p {
|
||||
unsigned int dcd_shreg;
|
||||
unsigned int sphase;
|
||||
unsigned int lasts;
|
||||
unsigned int dcd_count;
|
||||
unsigned int sample_count;
|
||||
} afsk48p;
|
||||
|
||||
struct l1_state_afsk48 {
|
||||
unsigned int dcd_shreg;
|
||||
unsigned int sphase;
|
||||
unsigned int lasts;
|
||||
unsigned int dcd_count;
|
||||
unsigned int sample_count;
|
||||
} afsk48;
|
||||
|
||||
struct l1_state_hapn48 {
|
||||
unsigned int shreg;
|
||||
unsigned int sphase;
|
||||
float lvllo, lvlhi;
|
||||
} hapn48;
|
||||
|
||||
struct l1_state_fsk96 {
|
||||
unsigned int dcd_shreg;
|
||||
unsigned int sphase;
|
||||
unsigned int descram;
|
||||
} fsk96;
|
||||
|
||||
struct l1_state_dtmf {
|
||||
unsigned int ph[8];
|
||||
float energy[4];
|
||||
float tenergy[4][16];
|
||||
int blkcount;
|
||||
int lastch;
|
||||
} dtmf;
|
||||
|
||||
struct l1_state_zvei {
|
||||
unsigned int ph[16];
|
||||
float energy[4];
|
||||
float tenergy[4][32];
|
||||
int blkcount;
|
||||
int lastch;
|
||||
} zvei;
|
||||
|
||||
struct l1_state_scope {
|
||||
int datalen;
|
||||
int dispnum;
|
||||
float data[512];
|
||||
} scope;
|
||||
} l1;
|
||||
struct l1_state_scope {
|
||||
int datalen;
|
||||
int dispnum;
|
||||
float data[512];
|
||||
} scope;
|
||||
} l1;
|
||||
};
|
||||
|
||||
struct demod_param {
|
||||
const char *name;
|
||||
unsigned int samplerate;
|
||||
unsigned int overlap;
|
||||
void (*init)(struct demod_state *s);
|
||||
void (*demod)(struct demod_state *s, float *buffer, int length);
|
||||
const char *name;
|
||||
unsigned int samplerate;
|
||||
unsigned int overlap;
|
||||
void (*init)(struct demod_state *s);
|
||||
void (*demod)(struct demod_state *s, float *buffer, int length);
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
extern const struct demod_param demod_poc5;
|
||||
extern const struct demod_param demod_poc12;
|
||||
extern const struct demod_param demod_poc24;
|
||||
|
||||
extern const struct demod_param demod_afsk1200;
|
||||
extern const struct demod_param demod_afsk2400;
|
||||
extern const struct demod_param demod_afsk2400_2;
|
||||
extern const struct demod_param demod_afsk4800p;
|
||||
extern const struct demod_param demod_afsk4800;
|
||||
|
||||
extern const struct demod_param demod_hapn4800;
|
||||
extern const struct demod_param demod_fsk9600;
|
||||
|
||||
extern const struct demod_param demod_dtmf;
|
||||
extern const struct demod_param demod_zvei;
|
||||
|
||||
extern const struct demod_param demod_scope;
|
||||
|
||||
/* #define ALL_DEMOD &demod_poc5, &demod_poc12, &demod_poc24, \ */
|
||||
/* &demod_afsk1200, &demod_afsk2400, &demod_afsk2400_2, &demod_afsk4800p, \ */
|
||||
/* &demod_afsk4800, &demod_hapn4800, &demod_fsk9600, &demod_dtmf, \ */
|
||||
/* &demod_zvei, &demod_scope */
|
||||
#define ALL_DEMOD &demod_afsk4800p,&demod_scope
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@@ -190,9 +92,6 @@ void verbprintf(int verb_level, const char *fmt, ...);
|
||||
void hdlc_init(struct demod_state *s);
|
||||
void hdlc_rxbit(struct demod_state *s, int bit);
|
||||
|
||||
void pocsag_init(struct demod_state *s);
|
||||
void pocsag_rxbit(struct demod_state *s, int bit);
|
||||
|
||||
void pprz_init(struct demod_state *s);
|
||||
void pprz_rxbit(struct demod_state *s, int bit);
|
||||
void pprz_status(struct demod_state *s);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user