mirror of
https://github.com/radio95-rnt/rds95.git
synced 2026-02-27 04:43:52 +01:00
try to fix dps
This commit is contained in:
@@ -197,7 +197,6 @@ static void get_rds_ps_group(RDSEncoder* enc, uint16_t *blocks) {
|
|||||||
if(enc->state[enc->program].dynamic_ps_state == 0) {
|
if(enc->state[enc->program].dynamic_ps_state == 0) {
|
||||||
memcpy(enc->state[enc->program].ps_text, enc->data[enc->program].ps, PS_LENGTH);
|
memcpy(enc->state[enc->program].ps_text, enc->data[enc->program].ps, PS_LENGTH);
|
||||||
|
|
||||||
enc->state[enc->program].static_ps_period++;
|
|
||||||
if(enc->state[enc->program].static_ps_period >= enc->data[enc->program].static_ps_period) {
|
if(enc->state[enc->program].static_ps_period >= enc->data[enc->program].static_ps_period) {
|
||||||
enc->state[enc->program].dynamic_ps_state = 1;
|
enc->state[enc->program].dynamic_ps_state = 1;
|
||||||
enc->state[enc->program].static_ps_period = 0;
|
enc->state[enc->program].static_ps_period = 0;
|
||||||
@@ -229,7 +228,6 @@ static void get_rds_ps_group(RDSEncoder* enc, uint16_t *blocks) {
|
|||||||
memcpy(enc->state[enc->program].ps_text, enc->state[enc->program].dps1_text, PS_LENGTH);
|
memcpy(enc->state[enc->program].ps_text, enc->state[enc->program].dps1_text, PS_LENGTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
enc->state[enc->program].dynamic_ps_period++;
|
|
||||||
if(enc->state[enc->program].dynamic_ps_period >= enc->data[enc->program].dps_label_period) {
|
if(enc->state[enc->program].dynamic_ps_period >= enc->data[enc->program].dps_label_period) {
|
||||||
enc->state[enc->program].dynamic_ps_state = 0;
|
enc->state[enc->program].dynamic_ps_state = 0;
|
||||||
enc->state[enc->program].dynamic_ps_period = 0;
|
enc->state[enc->program].dynamic_ps_period = 0;
|
||||||
@@ -627,8 +625,8 @@ void set_rds_dps1(RDSEncoder* enc, char *dps1) {
|
|||||||
uint8_t len = 0;
|
uint8_t len = 0;
|
||||||
|
|
||||||
enc->state[enc->program].dps1_update = 1;
|
enc->state[enc->program].dps1_update = 1;
|
||||||
memset(enc->data[enc->program].dps1, ' ', RT_LENGTH);
|
memset(enc->data[enc->program].dps1, ' ', DPS_LENGTH);
|
||||||
while (*dps1 != 0 && len < RT_LENGTH) enc->data[enc->program].dps1[len++] = *dps1++;
|
while (*dps1 != 0 && len < DPS_LENGTH) enc->data[enc->program].dps1[len++] = *dps1++;
|
||||||
enc->data[enc->program].dps1_len = len;
|
enc->data[enc->program].dps1_len = len;
|
||||||
|
|
||||||
enc->state[enc->program].dynamic_ps_position = 0;
|
enc->state[enc->program].dynamic_ps_position = 0;
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#define RT_LENGTH 64
|
#define RT_LENGTH 64
|
||||||
#define PS_LENGTH 8
|
#define PS_LENGTH 8
|
||||||
|
#define DPS_LENGTH 8
|
||||||
#define PTYN_LENGTH 8
|
#define PTYN_LENGTH 8
|
||||||
#define LPS_LENGTH 32
|
#define LPS_LENGTH 32
|
||||||
#define DEFAULT_GRPSQC "002222XY"
|
#define DEFAULT_GRPSQC "002222XY"
|
||||||
@@ -96,9 +97,9 @@ typedef struct {
|
|||||||
uint8_t dps1_enabled : 1;
|
uint8_t dps1_enabled : 1;
|
||||||
uint8_t dps2_enabled : 1;
|
uint8_t dps2_enabled : 1;
|
||||||
uint8_t dps1_len;
|
uint8_t dps1_len;
|
||||||
char dps1[255];
|
char dps1[DPS_LENGTH];
|
||||||
uint8_t dps2_len;
|
uint8_t dps2_len;
|
||||||
char dps2[255];
|
char dps2[DPS_LENGTH];
|
||||||
uint8_t dps1_mode : 2;
|
uint8_t dps1_mode : 2;
|
||||||
uint8_t dps2_mode : 2;
|
uint8_t dps2_mode : 2;
|
||||||
uint8_t dps1_numberofrepeats : 7;
|
uint8_t dps1_numberofrepeats : 7;
|
||||||
@@ -153,7 +154,7 @@ typedef struct {
|
|||||||
uint8_t ps_csegment : 4;
|
uint8_t ps_csegment : 4;
|
||||||
|
|
||||||
uint8_t dps1_update : 1;
|
uint8_t dps1_update : 1;
|
||||||
char dps1_text[255];
|
char dps1_text[DPS_LENGTH];
|
||||||
char dps1_nexttext[127];
|
char dps1_nexttext[127];
|
||||||
uint8_t static_ps_period : 4;
|
uint8_t static_ps_period : 4;
|
||||||
uint8_t dynamic_ps_period : 4;
|
uint8_t dynamic_ps_period : 4;
|
||||||
|
|||||||
Reference in New Issue
Block a user