mirror of
https://github.com/radio95-rnt/rds95.git
synced 2026-02-27 12:53:53 +01:00
add rt2
This commit is contained in:
12
src/rds.c
12
src/rds.c
@@ -308,11 +308,19 @@ encode:
|
||||
}
|
||||
|
||||
static void get_rds_rt_group(RDSEncoder* enc, uint16_t *blocks) {
|
||||
if (enc->state[enc->program].rt_update) {
|
||||
if (enc->state[enc->program].rt_update && enc->data[enc->program].rt1_enabled) {
|
||||
memcpy(enc->state[enc->program].rt_text, enc->data[enc->program].rt1, RT_LENGTH);
|
||||
enc->state[enc->program].rt_ab ^= 1;
|
||||
enc->state[enc->program].rt_update = 0;
|
||||
enc->state[enc->program].rt_state = 0;
|
||||
enc->state[enc->program].current_rt = 0;
|
||||
}
|
||||
if(enc->state[enc->program].rt2_update && enc->data[enc->program].rt2_enabled && !enc->data[enc->program].rt1_enabled) {
|
||||
memcpy(enc->state[enc->program].rt_text, enc->data[enc->program].rt2, RT_LENGTH);
|
||||
enc->state[enc->program].rt_ab ^= 1;
|
||||
enc->state[enc->program].rt2_update = 0;
|
||||
enc->state[enc->program].rt_state = 0;
|
||||
enc->state[enc->program].current_rt = 1;
|
||||
}
|
||||
|
||||
uint8_t ab = enc->state[enc->program].rt_ab;
|
||||
@@ -831,6 +839,8 @@ void set_rds_rt1(RDSEncoder* enc, char *rt1) {
|
||||
void set_rds_rt2(RDSEncoder* enc, char *rt2) {
|
||||
uint8_t i = 0, len = 0;
|
||||
|
||||
enc->state[enc->program].rt2_update = 1;
|
||||
|
||||
memset(enc->data[enc->program].rt2, ' ', RT_LENGTH);
|
||||
while (*rt2 != 0 && len < RT_LENGTH) enc->data[enc->program].rt2[len++] = *rt2++;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user