diff --git a/src/lua_rds.c b/src/lua_rds.c index e320245..93b62be 100644 --- a/src/lua_rds.c +++ b/src/lua_rds.c @@ -6,6 +6,7 @@ static lua_State *L = NULL; int lua_set_rds_program_defaults(lua_State *localL) { (void)localL; set_rds_defaults(mod->enc, mod->enc->program); + lua_on_init() return 0; } diff --git a/src/rds.c b/src/rds.c index 433426c..3e18436 100644 --- a/src/rds.c +++ b/src/rds.c @@ -696,14 +696,10 @@ void set_rds_defaults(RDSEncoder* enc, uint8_t program) { reset_rds_state(enc, program); enc->encoder_data.ascii_data.expected_encoder_addr = 255; // Unknown - - if(enc->state[0].call_lua != 0) lua_on_init(); } void init_rds_encoder(RDSEncoder* enc) { - enc->state[0].call_lua = 0; for(int i = 0; i < PROGRAMS; i++) set_rds_defaults(enc, i); - enc->state[0].call_lua = 1; if (encoder_saved()) encoder_loadFromFile(enc); else { diff --git a/src/rds.h b/src/rds.h index d082911..720d19e 100644 --- a/src/rds.h +++ b/src/rds.h @@ -172,8 +172,6 @@ typedef struct { uint16_t last_stream0_group[3]; uint8_t last_stream0_group_type_b : 1; - - uint8_t call_lua : 1; } RDSState; typedef struct {