add_executable(drs232_ldpc drs232_ldpc.c mpdecode_core.c)
target_link_libraries(drs232_ldpc ${CMAKE_REQUIRED_LIBRARIES})
+add_definitions(-DHORUS_L2_RX -DINTERLEAVER -DSCRAMBLER)
+add_executable(horus_demod horus_demod.c horus_api.c horus_l2.c fsk.c kiss_fft.c)
+target_link_libraries(horus_demod ${CMAKE_REQUIRED_LIBRARIES})
+
install(TARGETS codec2 EXPORT codec2-config
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
corr = 0;
for(j=0; j<hstates->uw_len; j++) {
- corr += hstates->rx_bits[i+j]*hstates->uw[j];
+ corr += rx_bits_mapped[i+j]*hstates->uw[j];
}
/* peak pick maximum */
if (!endpacket && (char_dec == 42)) {
endpacket = 1;
- rx_crc = horus_l2_gen_crc16(ascii_out, nout);
+ rx_crc = horus_l2_gen_crc16((uint8_t*)ascii_out, nout);
ptx_crc = pout + 2; /* start of tx CRC */
}
int i, j, uw_loc, valid_packet;
assert(hstates != NULL);
-
+ valid_packet = 0;
+
/* shift buffer of bits to make room for new bits */
int Nbits = hstates->fsk->Nbits;
}
int horus_get_max_ascii_out_len(struct horus *hstates) {
+ assert(hstates != NULL);
if (hstates->mode == HORUS_MODE_RTTY) {
return hstates->max_packet_len/10; /* 7 bit ASCII, plus 3 sync bits */
}
if (hstates->mode == HORUS_MODE_BINARY) {
return HORUS_BINARY_NUM_PAYLOAD_BYTES;
}
+ assert(0); /* should never get here */
+ return 0;
}
void horus_get_modem_stats(struct horus *hstates, int *sync, float *snr_est) {
stats_loop = 0;
stats_rate = 8;
-
+ mode = -1;
+
int o = 0;
int opt_idx = 0;
while ( o != -1 ) {
switch(o) {
case 'm':
- mode = -1;
if ((strcmp(optarg, "RTTY") == 0) || (strcmp(optarg, "rtty") == 0)) {
mode = HORUS_MODE_RTTY;
}
if ((strcmp(optarg, "BINARY") == 0) || (strcmp(optarg, "binary") == 0)) {
mode = HORUS_MODE_BINARY;
}
- if (mode = -1) {
+ if (mode == -1) {
fprintf(stderr, "use --mode RTTY or --mode binary\n");
exit(1);
}