Settings-Datei fortgesetzt

This commit is contained in:
Bernhard Schräer
2026-01-20 13:24:56 +01:00
parent b5f7b5a45d
commit 874ebf51ba
5 changed files with 78 additions and 6 deletions

7
main.c
View File

@@ -166,10 +166,10 @@ void *thread_func(void *data)
while (iThreadControl == 0)
{
pinfo.cyclecounter++;
if (pinfo.cyclecounter >= 86400000)
if (pinfo.cyclecounter > CYCLE_COUNTER_MAX)
{
// Reset cycle counter every 24h
pinfo.cyclecounter = 0;
pinfo.cyclecounter = 1;
}
do_cyclic_1ms(&pinfo);
wait_rest_of_period(&pinfo);
@@ -219,6 +219,9 @@ int main(int argc, char* argv[])
openlog("CanRtDriver", LOG_PID | LOG_CONS, LOG_DAEMON);
mylog(LOG_INFO, "Service started. PID: %d", getpid());
// Read the settings file after opening the log
Settings_ReadConfFile();
// catch signals
if (signal(SIGTERM, sig_handler) == SIG_ERR)
{