mirror of
https://github.com/radio95-rnt/rds95.git
synced 2026-02-26 20:33:53 +01:00
optimize
This commit is contained in:
14
src/rds.c
14
src/rds.c
@@ -613,10 +613,9 @@ static void get_rds_group(RDSEncoder* enc, uint16_t *blocks, uint8_t stream) {
|
||||
return;
|
||||
}
|
||||
if(enc->encoder_data.rds2_mode == 0) { // tunneling
|
||||
blocks[0] = enc->state->last_stream0_group[0];
|
||||
blocks[1] = enc->state->last_stream0_group[1];
|
||||
blocks[2] = enc->state->last_stream0_group[2];
|
||||
blocks[3] = enc->state->last_stream0_group[3];
|
||||
blocks[1] = enc->state->last_stream0_group[0];
|
||||
blocks[2] = enc->state->last_stream0_group[1];
|
||||
blocks[3] = enc->state->last_stream0_group[2];
|
||||
return;
|
||||
} else {
|
||||
// TODO: add store command
|
||||
@@ -754,10 +753,9 @@ group_coded:
|
||||
blocks[2] = enc->data[enc->program].pi;
|
||||
}
|
||||
|
||||
enc->state[enc->program].last_stream0_group[0] = blocks[0];
|
||||
enc->state[enc->program].last_stream0_group[1] = blocks[1];
|
||||
enc->state[enc->program].last_stream0_group[2] = blocks[2];
|
||||
enc->state[enc->program].last_stream0_group[3] = blocks[3];
|
||||
enc->state[enc->program].last_stream0_group[0] = blocks[1];
|
||||
enc->state[enc->program].last_stream0_group[1] = blocks[2];
|
||||
enc->state[enc->program].last_stream0_group[2] = blocks[3];
|
||||
}
|
||||
|
||||
void get_rds_bits(RDSEncoder* enc, uint8_t *bits, uint8_t stream) {
|
||||
|
||||
@@ -177,12 +177,12 @@ typedef struct {
|
||||
uint8_t rt2_segments : 5;
|
||||
uint8_t current_rt : 1;
|
||||
|
||||
char ptyn_text[RT_LENGTH];
|
||||
char ptyn_text[PTYN_LENGTH];
|
||||
uint8_t ptyn_state : 1;
|
||||
uint8_t ptyn_update : 1;
|
||||
uint8_t ptyn_ab : 1;
|
||||
|
||||
char lps_text[RT_LENGTH];
|
||||
char lps_text[LPS_LENGTH];
|
||||
uint8_t lps_state : 5;
|
||||
uint8_t lps_update : 1;
|
||||
uint8_t lps_segments : 5;
|
||||
@@ -201,7 +201,7 @@ typedef struct {
|
||||
uint8_t eon_index : 3;
|
||||
uint8_t eon_state : 4;
|
||||
|
||||
uint16_t last_stream0_group[GROUP_LENGTH];
|
||||
uint16_t last_stream0_group[3];
|
||||
} RDSState;
|
||||
|
||||
typedef struct {
|
||||
|
||||
Reference in New Issue
Block a user