Add check if fromat at PDEBUG() is consistent (like printf)
The bugs it found are fixed too.
This commit is contained in:
@@ -621,14 +621,14 @@ again:
|
||||
if (master->frame_last_count > 0 && master->frame_last_count < length - 1 && count > 0 && count < length - 1) {
|
||||
/* if the sample count is one sample ahead, we go back one sample */
|
||||
if (count == master->frame_last_count + 1) {
|
||||
PDEBUG(DDSP, DEBUG_INFO, "Sync slave to master by going back one sample: phase(master) = %.15, phase(slave) = %.15\n", master->frame_last_phase, cnetz->frame_last_phase);
|
||||
PDEBUG(DDSP, DEBUG_INFO, "Sync slave to master by going back one sample: phase(master) = %.15f, phase(slave) = %.15f\n", master->frame_last_phase, cnetz->frame_last_phase);
|
||||
count--;
|
||||
samples--;
|
||||
cnetz->frame_last_phase = master->frame_last_phase;
|
||||
}
|
||||
/* if the sample count is one sample behind, we go forward one sample */
|
||||
if (count == master->frame_last_count - 1) {
|
||||
PDEBUG(DDSP, DEBUG_INFO, "Sync slave to master by going forth one sample: phase(master) = %.15, phase(slave) = %.15\n", master->frame_last_phase, cnetz->frame_last_phase);
|
||||
PDEBUG(DDSP, DEBUG_INFO, "Sync slave to master by going forth one sample: phase(master) = %.15f, phase(slave) = %.15f\n", master->frame_last_phase, cnetz->frame_last_phase);
|
||||
count++;
|
||||
*samples = samples[-1];
|
||||
samples++;
|
||||
|
@@ -22,6 +22,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <inttypes.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <math.h>
|
||||
@@ -602,13 +603,13 @@ static void debug_parameter(char digit, uint64_t value)
|
||||
if (parameter->value_names)
|
||||
PDEBUG(DFRAME, DEBUG_DEBUG, " (%c) %s : %s\n", digit, parameter->param_name, parameter->value_names[value]);
|
||||
else if (parameter->bits == 64)
|
||||
PDEBUG(DFRAME, DEBUG_DEBUG, " (%c) %s : 0x%016x\n", digit, parameter->param_name, value);
|
||||
PDEBUG(DFRAME, DEBUG_DEBUG, " (%c) %s : 0x%016" PRIx64 "\n", digit, parameter->param_name, value);
|
||||
else if (digit == 'X') {
|
||||
char wahlziffern[17];
|
||||
decode_dialstring(wahlziffern, value);
|
||||
PDEBUG(DFRAME, DEBUG_DEBUG, " (%c) %s : '%s'\n", digit, parameter->param_name, wahlziffern);
|
||||
} else
|
||||
PDEBUG(DFRAME, DEBUG_DEBUG, " (%c) %s : %d\n", digit, parameter->param_name, value);
|
||||
PDEBUG(DFRAME, DEBUG_DEBUG, " (%c) %s : %" PRIu64 "\n", digit, parameter->param_name, value);
|
||||
}
|
||||
|
||||
/* encode telegram to 70 bits
|
||||
@@ -806,7 +807,7 @@ static char *assemble_telegramm(const telegramm_t *telegramm, int debug)
|
||||
val >>= 1;
|
||||
}
|
||||
if (val)
|
||||
PDEBUG(DFRAME, DEBUG_ERROR, "Parameter '%c' value '0x%x' exceeds bit range!\n", parameter, value);
|
||||
PDEBUG(DFRAME, DEBUG_ERROR, "Parameter '%c' value '0x%" PRIx64 "' exceeds bit range!\n", parameter, value);
|
||||
i += j - 1;
|
||||
}
|
||||
bits[70] = '\0';
|
||||
|
Reference in New Issue
Block a user