0
1
mirror of https://github.com/radio95-rnt/rds95.git synced 2026-02-26 20:33:53 +01:00

fair enough

This commit is contained in:
2025-12-28 16:08:31 +01:00
parent e2df72e847
commit 46b44ee555
2 changed files with 3 additions and 6 deletions

View File

@@ -33,7 +33,8 @@ void cleanup_rds_modulator(RDSModulator* rdsMod) {
}
float get_rds_sample(RDSModulator* rdsMod, uint8_t stream) {
if (stream >= rdsMod->num_streams) return 0.0f;
if(stream >= rdsMod->num_streams) return 0.0f;
if((rdsMod->params.rdsgen > stream ? 1 : 0) == 0) return 0.0f;
rdsMod->data[stream].phase += 1187.5 / RDS_SAMPLE_RATE;
@@ -52,5 +53,5 @@ float get_rds_sample(RDSModulator* rdsMod, uint8_t stream) {
float sample = sinf(M_2PI * rdsMod->data[stream].phase + rdsMod->data[stream].symbol_shift);
if(rdsMod->data[stream].cur_output == 0) sample = -sample; // do bpsk, if you comment this part out, nothing will be decoded
return sample*rdsMod->params.level*(rdsMod->params.rdsgen > stream ? 1 : 0);
return sample*rdsMod->params.level;
}

View File

@@ -318,10 +318,6 @@ void add_checkwords(RDSGroup *group, uint8_t *bits)
}
void get_rds_bits(RDSEncoder* enc, uint8_t *bits, uint8_t stream) {
if((rdsMod->params.rdsgen > stream ? 1 : 0) == 0) {
memset(bits, 0, BITS_PER_GROUP);
return;
}
RDSGroup group;
get_rds_group(enc, &group, stream);
add_checkwords(&group, bits);