mirror of
https://github.com/radio95-rnt/rds95.git
synced 2026-02-26 20:33:53 +01:00
faster clock
This commit is contained in:
@@ -24,7 +24,7 @@ function on_init() end
|
||||
---It should be defined by the user in the script.
|
||||
---@return nil
|
||||
function on_start() end
|
||||
---This function is called every minute
|
||||
---This function is called every second
|
||||
---It should be defined by the user in the script.
|
||||
---@return nil
|
||||
function tick() end
|
||||
|
||||
@@ -157,8 +157,12 @@ static void get_rds_group(RDSEncoder* enc, RDSGroup *group, uint8_t stream) {
|
||||
time(&now);
|
||||
utc = gmtime(&now);
|
||||
|
||||
if (utc->tm_min != enc->state[enc->program].last_minute) {
|
||||
if(utc->tm_sec != enc->state[enc->program].last_second) {
|
||||
enc->state[enc->program].last_second = utc->tm_sec;
|
||||
lua_call_function("tick");
|
||||
}
|
||||
|
||||
if (utc->tm_min != enc->state[enc->program].last_minute) {
|
||||
enc->state[enc->program].last_minute = utc->tm_min;
|
||||
|
||||
uint8_t eon_has_ta = 0;
|
||||
@@ -355,6 +359,7 @@ void reset_rds_state(RDSEncoder* enc, uint8_t program) {
|
||||
time(&now);
|
||||
utc = gmtime(&now);
|
||||
tempCoder.state[program].last_minute = utc->tm_min;
|
||||
tempCoder.state[program].last_second = utc->tm_min;
|
||||
|
||||
for(int i = 0; i < EONs; i++) tempCoder.data[program].eon[i].ta = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user