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

fix crash

This commit is contained in:
2025-12-22 19:24:46 +01:00
parent 40a184301b
commit 5d4c02bbe0
4 changed files with 10 additions and 3 deletions

View File

@@ -697,14 +697,19 @@ void set_rds_defaults(RDSEncoder* enc, uint8_t program) {
enc->encoder_data.ascii_data.expected_encoder_addr = 255; // Unknown
lua_on_init();
if(enc->state[0].first_init_done) lua_on_init();
}
void init_rds_encoder(RDSEncoder* enc) {
enc->state[0].first_init_done = 0;
for(int i = 0; i < PROGRAMS; i++) set_rds_defaults(enc, i);
enc->state[0].first_init_done = 1;
if (encoder_saved()) encoder_loadFromFile(enc);
else encoder_saveToFile(enc);
else {
encoder_saveToFile(enc);
lua_on_init();
}
for(int i = 0; i < PROGRAMS; i++) reset_rds_state(enc, i);
}