Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,13 @@ showconfig:
%.o: %.c *.h
$(CC) $(ALL_CCFLAGS) -c $< -o $@

dump1090: dump1090.o anet.o interactive.o mode_ac.o mode_s.o comm_b.o net_io.o crc.o demod_2400.o stats.o cpr.o icao_filter.o track.o util.o convert.o ais_charset.o adaptive.o $(SDR_OBJ) $(COMPAT) $(CPUFEATURES_OBJS) $(STARCH_OBJS)
dump1090: dump1090.o anet.o interactive.o mode_ac.o mode_s.o comm_b.o net_io.o crc.o demod_2400.o stats.o cpr.o icao_filter.o track.o util.o convert.o adaptive.o $(SDR_OBJ) $(COMPAT) $(CPUFEATURES_OBJS) $(STARCH_OBJS)
$(CC) -g -o $@ $^ $(LDFLAGS) $(LIBS) $(LIBS_SDR) $(LIBS_CURSES)

view1090: view1090.o anet.o interactive.o mode_ac.o mode_s.o comm_b.o net_io.o crc.o stats.o cpr.o icao_filter.o track.o util.o ais_charset.o sdr_stub.o $(COMPAT)
view1090: view1090.o anet.o interactive.o mode_ac.o mode_s.o comm_b.o net_io.o crc.o stats.o cpr.o icao_filter.o track.o util.o sdr_stub.o $(COMPAT)
$(CC) -g -o $@ $^ $(LDFLAGS) $(LIBS) $(LIBS_CURSES)

faup1090: faup1090.o anet.o mode_ac.o mode_s.o comm_b.o net_io.o crc.o stats.o cpr.o icao_filter.o track.o util.o ais_charset.o sdr_stub.o $(COMPAT)
faup1090: faup1090.o anet.o mode_ac.o mode_s.o comm_b.o net_io.o crc.o stats.o cpr.o icao_filter.o track.o util.o sdr_stub.o $(COMPAT)
$(CC) -g -o $@ $^ $(LDFLAGS) $(LIBS)

starch-benchmark: cpu.o dsp/helpers/tables.o $(CPUFEATURES_OBJS) $(STARCH_OBJS) $(STARCH_BENCHMARK_OBJ)
Expand All @@ -252,7 +252,7 @@ benchmarks: oneoff/convert_benchmark
oneoff/convert_benchmark: oneoff/convert_benchmark.o convert.o util.o dsp/helpers/tables.o cpu.o $(CPUFEATURES_OBJS) $(STARCH_OBJS)
$(CC) $(ALL_CCFLAGS) -g -o $@ $^ -lm -lpthread

oneoff/decode_comm_b: oneoff/decode_comm_b.o comm_b.o ais_charset.o
oneoff/decode_comm_b: oneoff/decode_comm_b.o comm_b.o
$(CC) $(ALL_CCFLAGS) -g -o $@ $^ -lm

oneoff/dsp_error_measurement: oneoff/dsp_error_measurement.o dsp/helpers/tables.o cpu.o $(CPUFEATURES_OBJS) $(STARCH_OBJS)
Expand Down
3 changes: 0 additions & 3 deletions ais_charset.c

This file was deleted.

6 changes: 5 additions & 1 deletion ais_charset.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#ifndef AIS_CHARSET_H
#define AIS_CHARSET_H

extern char ais_charset[64];
// AIS character set is just the first 64 printable ASCII characters,
// but with 0x20..0x3F after 0x40..0x5F.
static inline __attribute__((always_inline)) char ais_to_ascii(unsigned i) {
return (i + 0x20) ^ 0b01100000;
}

#endif
16 changes: 8 additions & 8 deletions comm_b.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,14 +244,14 @@ static int decodeBDS20(struct modesMessage *mm, bool store)
return 0;
}

callsign[0] = ais_charset[getbits(msg, 9, 14)];
callsign[1] = ais_charset[getbits(msg, 15, 20)];
callsign[2] = ais_charset[getbits(msg, 21, 26)];
callsign[3] = ais_charset[getbits(msg, 27, 32)];
callsign[4] = ais_charset[getbits(msg, 33, 38)];
callsign[5] = ais_charset[getbits(msg, 39, 44)];
callsign[6] = ais_charset[getbits(msg, 45, 50)];
callsign[7] = ais_charset[getbits(msg, 51, 56)];
callsign[0] = ais_to_ascii(getbits(msg, 9, 14));
callsign[1] = ais_to_ascii(getbits(msg, 15, 20));
callsign[2] = ais_to_ascii(getbits(msg, 21, 26));
callsign[3] = ais_to_ascii(getbits(msg, 27, 32));
callsign[4] = ais_to_ascii(getbits(msg, 33, 38));
callsign[5] = ais_to_ascii(getbits(msg, 39, 44));
callsign[6] = ais_to_ascii(getbits(msg, 45, 50));
callsign[7] = ais_to_ascii(getbits(msg, 51, 56));
callsign[8] = 0;

// score based on number of valid characters
Expand Down
2 changes: 1 addition & 1 deletion interactive.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ void interactiveShowData(void) {
static bool need_clear = true;
uint64_t now = mstime();
char progress;
char spinner[4] = "|/-\\";
char spinner[4] = { '|', '/', '-', '\\' };
int valid = 0;
double signalMax = -100.0;
double signalMin = +100.0;
Expand Down
16 changes: 8 additions & 8 deletions mode_s.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,14 +802,14 @@ static void decodeESIdentAndCategory(struct modesMessage *mm)

mm->mesub = getbits(me, 6, 8);

mm->callsign[0] = ais_charset[getbits(me, 9, 14)];
mm->callsign[1] = ais_charset[getbits(me, 15, 20)];
mm->callsign[2] = ais_charset[getbits(me, 21, 26)];
mm->callsign[3] = ais_charset[getbits(me, 27, 32)];
mm->callsign[4] = ais_charset[getbits(me, 33, 38)];
mm->callsign[5] = ais_charset[getbits(me, 39, 44)];
mm->callsign[6] = ais_charset[getbits(me, 45, 50)];
mm->callsign[7] = ais_charset[getbits(me, 51, 56)];
mm->callsign[0] = ais_to_ascii(getbits(me, 9, 14));
mm->callsign[1] = ais_to_ascii(getbits(me, 15, 20));
mm->callsign[2] = ais_to_ascii(getbits(me, 21, 26));
mm->callsign[3] = ais_to_ascii(getbits(me, 27, 32));
mm->callsign[4] = ais_to_ascii(getbits(me, 33, 38));
mm->callsign[5] = ais_to_ascii(getbits(me, 39, 44));
mm->callsign[6] = ais_to_ascii(getbits(me, 45, 50));
mm->callsign[7] = ais_to_ascii(getbits(me, 51, 56));
mm->callsign[8] = 0;
mm->callsign_valid = 1;

Expand Down