mirror of
https://github.com/radio95-rnt/rds95.git
synced 2026-02-27 04:43:52 +01:00
nice
This commit is contained in:
14
src/rds.c
14
src/rds.c
@@ -336,8 +336,8 @@ static void get_rds_lps_group(RDSEncoder* enc, uint16_t *blocks) {
|
|||||||
blocks[3] = enc->state[enc->program].lps_text[enc->state[enc->program].lps_state * 4 + 2] << 8;
|
blocks[3] = enc->state[enc->program].lps_text[enc->state[enc->program].lps_state * 4 + 2] << 8;
|
||||||
blocks[3] |= enc->state[enc->program].lps_text[enc->state[enc->program].lps_state * 4 + 3];
|
blocks[3] |= enc->state[enc->program].lps_text[enc->state[enc->program].lps_state * 4 + 3];
|
||||||
|
|
||||||
if (enc->state[enc->program].lps_state == enc->state[enc->program].lps_segments) enc->state[enc->program].lps_state = 0;
|
|
||||||
enc->state[enc->program].lps_state++;
|
enc->state[enc->program].lps_state++;
|
||||||
|
if (enc->state[enc->program].lps_state == enc->state[enc->program].lps_segments) enc->state[enc->program].lps_state = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void get_rds_ecc_group(RDSEncoder* enc, uint16_t *blocks) {
|
static void get_rds_ecc_group(RDSEncoder* enc, uint16_t *blocks) {
|
||||||
@@ -764,10 +764,10 @@ void set_rds_rt1(RDSEncoder* enc, char *rt1) {
|
|||||||
|
|
||||||
while (i < len) {
|
while (i < len) {
|
||||||
i += 4;
|
i += 4;
|
||||||
if (i != 4) enc->state[enc->program].rt_segments++;
|
enc->state[enc->program].rt_segments++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
enc->state[enc->program].rt_segments = 15;
|
enc->state[enc->program].rt_segments = 16;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -790,10 +790,10 @@ void set_rds_rt2(RDSEncoder* enc, char *rt2) {
|
|||||||
|
|
||||||
while (i < len) {
|
while (i < len) {
|
||||||
i += 4;
|
i += 4;
|
||||||
if (i != 4) enc->state[enc->program].rt2_segments++;
|
enc->state[enc->program].rt2_segments++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
enc->state[enc->program].rt2_segments = 15;
|
enc->state[enc->program].rt2_segments = 16;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -834,10 +834,10 @@ void set_rds_lps(RDSEncoder* enc, char *lps) {
|
|||||||
|
|
||||||
while (i < len) {
|
while (i < len) {
|
||||||
i += 4;
|
i += 4;
|
||||||
if (i != 4) enc->state[enc->program].lps_segments++;
|
enc->state[enc->program].lps_segments++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
enc->state[enc->program].lps_segments = 7;
|
enc->state[enc->program].lps_segments = 8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
10
src/rds.h
10
src/rds.h
@@ -114,12 +114,12 @@ typedef struct {
|
|||||||
uint8_t ps_csegment : 3;
|
uint8_t ps_csegment : 3;
|
||||||
|
|
||||||
char rt_text[RT_LENGTH];
|
char rt_text[RT_LENGTH];
|
||||||
uint8_t rt_state : 4;
|
uint8_t rt_state : 5;
|
||||||
uint8_t rt_update : 1;
|
uint8_t rt_update : 1;
|
||||||
uint8_t rt2_update : 1;
|
uint8_t rt2_update : 1;
|
||||||
uint8_t rt_ab : 1;
|
uint8_t rt_ab : 1;
|
||||||
uint8_t rt_segments : 4;
|
uint8_t rt_segments : 5;
|
||||||
uint8_t rt2_segments : 4;
|
uint8_t rt2_segments : 5;
|
||||||
uint8_t current_rt : 1;
|
uint8_t current_rt : 1;
|
||||||
|
|
||||||
char ert_text[ERT_LENGTH];
|
char ert_text[ERT_LENGTH];
|
||||||
@@ -131,9 +131,9 @@ typedef struct {
|
|||||||
uint8_t ptyn_ab : 1;
|
uint8_t ptyn_ab : 1;
|
||||||
|
|
||||||
char lps_text[LPS_LENGTH];
|
char lps_text[LPS_LENGTH];
|
||||||
uint8_t lps_state : 3;
|
uint8_t lps_state : 4;
|
||||||
uint8_t lps_update : 1;
|
uint8_t lps_update : 1;
|
||||||
uint8_t lps_segments : 3;
|
uint8_t lps_segments : 4;
|
||||||
|
|
||||||
uint16_t custom_group[GROUP_LENGTH];
|
uint16_t custom_group[GROUP_LENGTH];
|
||||||
uint16_t custom_group2[GROUP_LENGTH + 1];
|
uint16_t custom_group2[GROUP_LENGTH + 1];
|
||||||
|
|||||||
Reference in New Issue
Block a user