diff --git a/src/rds.c b/src/rds.c index 4486154..c88fe5b 100644 --- a/src/rds.c +++ b/src/rds.c @@ -210,8 +210,8 @@ static void get_rds_ps_group(RDSEncoder* enc, uint16_t *blocks) { blocks[3] = enc->state[enc->program].ps_text[enc->state[enc->program].ps_csegment * 2] << 8 | enc->state[enc->program].ps_text[enc->state[enc->program].ps_csegment * 2 + 1]; } - if (enc->state[enc->program].ps_csegment == 3) enc->state[enc->program].ps_csegment = 0; enc->state[enc->program].ps_csegment++; + if (enc->state[enc->program].ps_csegment == 4) enc->state[enc->program].ps_csegment = 0; } static void get_rds_rt_group(RDSEncoder* enc, uint16_t *blocks) { diff --git a/src/rds.h b/src/rds.h index 7e2356b..4a78060 100644 --- a/src/rds.h +++ b/src/rds.h @@ -111,7 +111,7 @@ typedef struct { uint8_t tps_update : 1; char ps_text[PS_LENGTH]; char tps_text[PS_LENGTH]; - uint8_t ps_csegment : 2; + uint8_t ps_csegment : 3; char rt_text[RT_LENGTH]; uint8_t rt_state : 4;