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.
|
---It should be defined by the user in the script.
|
||||||
---@return nil
|
---@return nil
|
||||||
function on_start() end
|
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.
|
---It should be defined by the user in the script.
|
||||||
---@return nil
|
---@return nil
|
||||||
function tick() end
|
function tick() end
|
||||||
|
|||||||
@@ -157,8 +157,12 @@ static void get_rds_group(RDSEncoder* enc, RDSGroup *group, uint8_t stream) {
|
|||||||
time(&now);
|
time(&now);
|
||||||
utc = gmtime(&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");
|
lua_call_function("tick");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (utc->tm_min != enc->state[enc->program].last_minute) {
|
||||||
enc->state[enc->program].last_minute = utc->tm_min;
|
enc->state[enc->program].last_minute = utc->tm_min;
|
||||||
|
|
||||||
uint8_t eon_has_ta = 0;
|
uint8_t eon_has_ta = 0;
|
||||||
@@ -355,6 +359,7 @@ void reset_rds_state(RDSEncoder* enc, uint8_t program) {
|
|||||||
time(&now);
|
time(&now);
|
||||||
utc = gmtime(&now);
|
utc = gmtime(&now);
|
||||||
tempCoder.state[program].last_minute = utc->tm_min;
|
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;
|
for(int i = 0; i < EONs; i++) tempCoder.data[program].eon[i].ta = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -159,6 +159,7 @@ typedef struct {
|
|||||||
uint8_t fasttuning_state : 3;
|
uint8_t fasttuning_state : 3;
|
||||||
|
|
||||||
uint8_t last_minute : 6;
|
uint8_t last_minute : 6;
|
||||||
|
uint8_t last_second : 6;
|
||||||
|
|
||||||
uint8_t ta_timeout : 7;
|
uint8_t ta_timeout : 7;
|
||||||
uint8_t ta_timeout_state : 7;
|
uint8_t ta_timeout_state : 7;
|
||||||
|
|||||||
Reference in New Issue
Block a user