diff --git a/src/rds.c b/src/rds.c index 9f61747..3c270e1 100644 --- a/src/rds.c +++ b/src/rds.c @@ -168,10 +168,10 @@ static void get_rds_ps_group(RDSEncoder* enc, uint16_t *blocks) { blocks[1] |= enc->data[enc->program].ta << 4; blocks[1] |= enc->data[enc->program].ms << 3; - blocks[1] |= ((enc->data[enc->program].di >> (3 - ps_csegment)) & INT8_0) << 2; + blocks[1] |= ((enc->data[enc->program].di >> (3 - enc->state[enc->program].ps_csegment)) & INT8_0) << 2; blocks[1] |= enc->state[enc->program].ps_csegment; blocks[2] = get_next_af(enc); - if(enc->data[enc->program].ta && tps_text[0] != '\0') { + if(enc->data[enc->program].ta && enc->state[enc->program].tps_text[0] != '\0') { blocks[3] = enc->state[enc->program].tps_text[enc->state[enc->program].ps_csegment * 2] << 8 | enc->state[enc->program].tps_text[enc->state[enc->program].ps_csegment * 2 + 1]; } else { /* TODO: Add DPS */