mirror of
https://github.com/radio95-rnt/rds95.git
synced 2026-02-27 04:43:52 +01:00
really?
This commit is contained in:
12
src/rds.c
12
src/rds.c
@@ -162,12 +162,13 @@ static uint16_t get_next_af(RDSEncoder* enc) {
|
|||||||
enc->state[enc->program].af_state += 1;
|
enc->state[enc->program].af_state += 1;
|
||||||
} else {
|
} else {
|
||||||
out = enc->data[enc->program].af.afs[enc->state[enc->program].af_state] << 8;
|
out = enc->data[enc->program].af.afs[enc->state[enc->program].af_state] << 8;
|
||||||
if (enc->data[enc->program].af.afs[enc->state[enc->program].af_state + 1])
|
if (enc->data[enc->program].af.afs[enc->state[enc->program].af_state + 1]) {
|
||||||
out |= enc->data[enc->program].af.afs[enc->state[enc->program].af_state + 1];
|
out |= enc->data[enc->program].af.afs[enc->state[enc->program].af_state + 1];
|
||||||
else
|
} else {
|
||||||
out |= AF_CODE_FILLER;
|
out |= AF_CODE_FILLER;
|
||||||
enc->state[enc->program].af_state += 2;
|
enc->state[enc->program].af_state += 2;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (enc->state[enc->program].af_state >= enc->data[enc->program].af.num_entries) enc->state[enc->program].af_state = 0;
|
if (enc->state[enc->program].af_state >= enc->data[enc->program].af.num_entries) enc->state[enc->program].af_state = 0;
|
||||||
} else {
|
} else {
|
||||||
out = AF_CODE_NUM_AFS_BASE << 8 | AF_CODE_FILLER;
|
out = AF_CODE_NUM_AFS_BASE << 8 | AF_CODE_FILLER;
|
||||||
@@ -186,12 +187,13 @@ static uint16_t get_next_af_eon(RDSEncoder* enc, uint8_t eon_index) {
|
|||||||
enc->state[enc->program].eon_states[eon_index].af_state += 1;
|
enc->state[enc->program].eon_states[eon_index].af_state += 1;
|
||||||
} else {
|
} else {
|
||||||
out = enc->data[enc->program].eon[eon_index].af.afs[enc->state[enc->program].eon_states[eon_index].af_state] << 8;
|
out = enc->data[enc->program].eon[eon_index].af.afs[enc->state[enc->program].eon_states[eon_index].af_state] << 8;
|
||||||
if (enc->data[enc->program].eon[eon_index].af.afs[enc->state[enc->program].eon_states[eon_index].af_state + 1])
|
if (enc->data[enc->program].eon[eon_index].af.afs[enc->state[enc->program].eon_states[eon_index].af_state + 1]) {
|
||||||
out |= enc->data[enc->program].eon[eon_index].af.afs[enc->state[enc->program].eon_states[eon_index].af_state + 1];
|
out |= enc->data[enc->program].eon[eon_index].af.afs[enc->state[enc->program].eon_states[eon_index].af_state + 1];
|
||||||
else
|
} else {
|
||||||
out |= AF_CODE_FILLER;
|
out |= AF_CODE_FILLER;
|
||||||
enc->state[enc->program].eon_states[eon_index].af_state += 2;
|
enc->state[enc->program].eon_states[eon_index].af_state += 2;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (enc->state[enc->program].eon_states[eon_index].af_state >= enc->data[enc->program].eon[eon_index].af.num_entries) enc->state[enc->program].eon_states[eon_index].af_state = 0;
|
if (enc->state[enc->program].eon_states[eon_index].af_state >= enc->data[enc->program].eon[eon_index].af.num_entries) enc->state[enc->program].eon_states[eon_index].af_state = 0;
|
||||||
} else {
|
} else {
|
||||||
out = AF_CODE_NUM_AFS_BASE << 8 | AF_CODE_FILLER;
|
out = AF_CODE_NUM_AFS_BASE << 8 | AF_CODE_FILLER;
|
||||||
@@ -593,7 +595,7 @@ static void get_rds_group(RDSEncoder* enc, uint16_t *blocks, uint8_t stream) {
|
|||||||
enc->data[enc->program].rt_text_timeout--;
|
enc->data[enc->program].rt_text_timeout--;
|
||||||
if(enc->data[enc->program].rt_text_timeout == 0) {
|
if(enc->data[enc->program].rt_text_timeout == 0) {
|
||||||
enc->state[enc->program].rt_update = 1;
|
enc->state[enc->program].rt_update = 1;
|
||||||
memccpy(enc->state[enc->program].rt_text, enc->data[enc->program].default_rt, 0, RT_LENGTH);
|
memcpy(enc->state[enc->program].rt_text, enc->data[enc->program].default_rt, 0, RT_LENGTH);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user