From e2c8f4cda61c9f714c5634af969ff408e075c13b Mon Sep 17 00:00:00 2001 From: Ari Suutari Date: Mon, 6 Jul 2020 18:17:46 +0300 Subject: [PATCH] Fix compile problem with cc65 (#11). (#13) cc65 needs all variables declared at beginning of function. --- src/pico/picoos.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pico/picoos.c b/src/pico/picoos.c index 2e9bbf5..cc0624e 100644 --- a/src/pico/picoos.c +++ b/src/pico/picoos.c @@ -2668,6 +2668,10 @@ VAR_t POSCALL posTimerSet(POSTIMER_t tmr, POSSEMA_t sema, UINT_t waitticks, UINT_t periodticks) { register EVENT_t ev = (EVENT_t) sema; +#if POSCFG_FEATURE_TIMERCALLBACK == 0 + register TIMER_t *t = (TIMER_t*) tmr; +#endif + P_ASSERT("posTimerSet: semaphore valid", sema != NULL); POS_ARGCHECK_RET(ev, ev->e.magic, POSMAGIC_EVENTU, -E_ARG); @@ -2675,7 +2679,6 @@ VAR_t POSCALL posTimerSet(POSTIMER_t tmr, POSSEMA_t sema, return posTimerCallbackSet(tmr, pos_timerSemaSignal, sema, waitticks, periodticks); #else - register TIMER_t *t = (TIMER_t*) tmr; POS_LOCKFLAGS; P_ASSERT("posTimerSet: timer valid", tmr != NULL);