Skip to content

Commit 7a8e432

Browse files
committed
Issue 486. Maybe.
1 parent a87b72e commit 7a8e432

File tree

3 files changed

+52
-3
lines changed

3 files changed

+52
-3
lines changed

src/direwolf.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ int main (int argc, char *argv[])
300300

301301
text_color_init(t_opt);
302302
text_color_set(DW_COLOR_INFO);
303-
dw_printf ("Dire Wolf version %d.%d (%s) BETA TEST 4\n", MAJOR_VERSION, MINOR_VERSION, __DATE__);
303+
dw_printf ("Dire Wolf version %d.%d (%s) BETA TEST 5\n", MAJOR_VERSION, MINOR_VERSION, __DATE__);
304304
//dw_printf ("Dire Wolf DEVELOPMENT version %d.%d %s (%s)\n", MAJOR_VERSION, MINOR_VERSION, "G", __DATE__);
305305
//dw_printf ("Dire Wolf version %d.%d\n", MAJOR_VERSION, MINOR_VERSION);
306306

src/rrbb.c

+47-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
#define MAGIC2 0x56788765
5252

5353

54-
static int new_count = 0;
55-
static int delete_count = 0;
54+
volatile static int new_count = 0;
55+
volatile static int delete_count = 0;
5656

5757

5858
/***********************************************************************************
@@ -425,6 +425,50 @@ alevel_t rrbb_get_audio_level (rrbb_t b)
425425

426426

427427

428+
/***********************************************************************************
429+
*
430+
* Name: rrbb_set_speed_error
431+
*
432+
* Purpose: Set speed error of the received frame.
433+
*
434+
* Inputs: b Handle for bit array.
435+
* speed_error In percentage.
436+
*
437+
***********************************************************************************/
438+
439+
void rrbb_set_speed_error (rrbb_t b, float speed_error)
440+
{
441+
assert (b != NULL);
442+
assert (b->magic1 == MAGIC1);
443+
assert (b->magic2 == MAGIC2);
444+
445+
b->speed_error = speed_error;
446+
}
447+
448+
449+
/***********************************************************************************
450+
*
451+
* Name: rrbb_get_speed_error
452+
*
453+
* Purpose: Get speed error of the received frame.
454+
*
455+
* Inputs: b Handle for bit array.
456+
*
457+
* Returns: speed error in percentage.
458+
*
459+
***********************************************************************************/
460+
461+
float rrbb_get_speed_error (rrbb_t b)
462+
{
463+
assert (b != NULL);
464+
assert (b->magic1 == MAGIC1);
465+
assert (b->magic2 == MAGIC2);
466+
467+
return (b->speed_error);
468+
}
469+
470+
471+
428472
/***********************************************************************************
429473
*
430474
* Name: rrbb_get_is_scrambled
@@ -488,6 +532,7 @@ int rrbb_get_prev_descram (rrbb_t b)
488532
}
489533

490534

535+
491536
/* end rrbb.c */
492537

493538

src/rrbb.h

+4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ typedef struct rrbb_s {
3333
int slice; /* Which slicer. */
3434

3535
alevel_t alevel; /* Received audio level at time of frame capture. */
36+
float speed_error; /* Received data speed error as percentage. */
3637
unsigned int len; /* Current number of samples in array. */
3738

3839
int is_scrambled; /* Is data scrambled G3RUH / K9NG style? */
@@ -84,6 +85,9 @@ int rrbb_get_slice (rrbb_t b);
8485
void rrbb_set_audio_level (rrbb_t b, alevel_t alevel);
8586
alevel_t rrbb_get_audio_level (rrbb_t b);
8687

88+
void rrbb_set_speed_error (rrbb_t b, float speed_error);
89+
float rrbb_get_speed_error (rrbb_t b);
90+
8791
int rrbb_get_is_scrambled (rrbb_t b);
8892
int rrbb_get_descram_state (rrbb_t b);
8993
int rrbb_get_prev_descram (rrbb_t b);

0 commit comments

Comments
 (0)