mirror of
https://github.com/radio95-rnt/rds95.git
synced 2026-02-27 04:43:52 +01:00
oda_handler
This commit is contained in:
@@ -381,4 +381,21 @@ void get_rds_user_oda_group(RDSEncoder* enc, RDSGroup *group) {
|
||||
group->b |= oda.group_version;
|
||||
group->c = oda.id_data;
|
||||
group->d = oda.id;
|
||||
}
|
||||
int get_rds_user_oda_group_content(RDSEncoder* enc, RDSGroup *group) {
|
||||
RDSODAState *oda_state = &enc->state[enc->program].user_oda;
|
||||
|
||||
if (oda_state->oda_len == 0) return 0;
|
||||
for (uint8_t i = 0; i < oda_state->oda_len; i++) {
|
||||
uint8_t current_idx = oda_state->oda_runner_pointer;
|
||||
|
||||
oda_state->oda_runner_pointer = (oda_state->oda_runner_pointer + 1) % oda_state->oda_len;
|
||||
|
||||
if (oda_state->odas[current_idx].lua_handler != 0) {
|
||||
lua_group_ref(group, oda_state->odas[current_idx].lua_handler);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user