Fix function type to remove compiler warnings.

This commit is contained in:
Marco 2023-02-26 16:26:25 +01:00
parent 62418ea06c
commit 013c619eaf
2 changed files with 3 additions and 14 deletions

View File

@ -10,12 +10,7 @@ typedef struct
void (*funcToBeCalled)(void);
} tmr_ctx;
void tmr_timerOverflow();
void tmr_initTimer(tmr_ctx *ctx);
void *tmr_handleTimerOverflow(void *timer_context);
void tmr_handleTimerOverflow(union sigval);
int tmr_callEveryMs(void (*func)(void));
void tmr_add_ns_to_current_time(struct itimerspec *current, long usecs);

View File

@ -7,10 +7,6 @@
#include "time_scales.h"
#include "timer_utils.h"
void tmr_timerOverflow()
{
}
void tmr_initTimer(tmr_ctx *ctx)
{
ctx->sevp = (struct sigevent){
@ -25,15 +21,13 @@ void tmr_initTimer(tmr_ctx *ctx)
timer_settime(ctx->timerid, TIMER_ABSTIME, &ctx->times, NULL);
}
void *tmr_handleTimerOverflow(void *ctx_par)
void tmr_handleTimerOverflow(sigval_t ctx_par)
{
tmr_ctx *ctx = (tmr_ctx *)ctx_par;
tmr_ctx *ctx = (tmr_ctx *)ctx_par.sival_ptr;
ctx->funcToBeCalled();
tmr_add_ns_to_current_time(&ctx->times, ctx->interval);
timer_settime(ctx->timerid, TIMER_ABSTIME, &ctx->times, NULL);
return (void *)0;
}
int tmr_callEveryMs(void (*func)(void))