Skip to content

Commit

Permalink
minor: Fix end of logging
Browse files Browse the repository at this point in the history
  • Loading branch information
zuckschwerdt committed Mar 6, 2023
1 parent f812e8d commit f30ad19
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 2 additions & 0 deletions src/bitbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ void bitbuffer_add_bit(bitbuffer_t *bits, int bit)
return;
}
if (bits->bits_per_row[bits->num_rows - 1] == UINT16_MAX - 1) {
//print_logf(LOG_WARNING, __func__, "Warning: row length limit (%u bits) reached", UINT16_MAX);
fprintf(stderr, "%s: Warning: row length limit (%u bits) reached\n", __func__, UINT16_MAX);
}

Expand All @@ -39,6 +40,7 @@ void bitbuffer_add_bit(bitbuffer_t *bits, int bit)
// spill into next row
// fprintf(stderr, "%s: row spill [%d] to %d (%d)\n", __func__, bits->num_rows - 1, col_index, bits->free_row);
if (bits->free_row == BITBUF_ROWS - 1) {
//print_logf(LOG_WARNING, __func__, "Warning: row count limit (%d rows) reached", BITBUF_ROWS);
fprintf(stderr, "%s: Warning: row count limit (%d rows) reached\n", __func__, BITBUF_ROWS);
}
if (bits->free_row < BITBUF_ROWS) {
Expand Down
2 changes: 1 addition & 1 deletion src/pulse_slicer.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static int account_event(r_device *device, bitbuffer_t *bits, char const *demod_

// Debug printout
if (!device->decode_fn || (device->verbose && ret > 0) || (device->verbose > 1 && max_bits > 16) || (device->verbose > 2)) {
decoder_log_bitbuffer(device, 2, demod_name, bits, device->name);
decoder_log_bitbuffer(device, ret > 0 ? 1 : 2, demod_name, bits, device->name);
}

return ret;
Expand Down
10 changes: 6 additions & 4 deletions src/r_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,18 +227,20 @@ void r_free_cfg(r_cfg_t *cfg)

pulse_detect_free(cfg->demod->pulse_detect);

free(cfg->demod);

free(cfg->devices);

list_free_elems(&cfg->raw_handler, (list_elem_free_fn)raw_output_free);

r_logger_set_log_handler(NULL, NULL);

list_free_elems(&cfg->output_handler, (list_elem_free_fn)data_output_free);

list_free_elems(&cfg->data_tags, (list_elem_free_fn)data_tag_free);

list_free_elems(&cfg->in_files, NULL);

free(cfg->demod);

free(cfg->devices);

mg_mgr_free(cfg->mgr);
free(cfg->mgr);

Expand Down
4 changes: 2 additions & 2 deletions src/sdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -551,11 +551,11 @@ static int rtlsdr_read_loop(sdr_dev_t *dev, sdr_event_cb_t cb, void *ctx, uint32
// We can safely assume it's an libusb error.
if (r < 0) {
#ifdef LIBUSB1
print_logf(LOG_ERROR, __func__, "%s: %s!"
print_logf(LOG_ERROR, __func__, "%s: %s! "
"Check your RTL-SDR dongle, USB cables, and power supply.",
libusb_error_name(r), libusb_strerror(r));
#else
print_logf(LOG_ERROR, __func__, "LIBUSB_ERROR: %d"
print_logf(LOG_ERROR, __func__, "LIBUSB_ERROR: %d! "
"Check your RTL-SDR dongle, USB cables, and power supply.",
r);
#endif
Expand Down

0 comments on commit f30ad19

Please sign in to comment.