This does not work:
Code: Select all
#include "reminder.h"
[[combinable]]
void reminder_driver(server interface reminder_i rmdr[Clients],
const static unsigned Clients) {
timer tmr;
unsigned timeout;
unsigned long long ticks = 0ULL;
unsigned long long trigger[Clients];
tmr :> timeout;
timeout += TICK;
while(1) {
select{
case rmdr[int i].ticks(void) -> unsigned long long count:
count = ticks;
break;
case rmdr[int i].set(unsigned delay):
trigger[i] = ticks + (unsigned long long)delay;
break;
case tmr when timerafter(timeout) :> void:
ticks++;
for(unsigned i = 0; i < Clients; i++)
if(ticks == trigger[i])
rmdr[i].timeout();
tmr :> timeout;
timeout += TICK;
break;
}
}
}
Code: Select all
#include "reminder.h"
[[combinable]]
void reminder_driver(server interface reminder_i rmdr[Clients],
const static unsigned Clients) {
timer tmr;
unsigned timeout;
unsigned ticks = 0ULL;
unsigned trigger[Clients];
tmr :> timeout;
timeout += TICK;
while(1) {
select{
case rmdr[int i].ticks(void) -> unsigned count:
count = ticks;
break;
case rmdr[int i].set(unsigned delay):
trigger[i] = ticks + delay;
break;
case tmr when timerafter(timeout) :> void:
ticks++;
for(unsigned i = 0; i < Clients; i++)
if(ticks == trigger[i])
rmdr[i].timeout();
tmr :> timeout;
timeout += TICK;
break;
}
}
}
Code: Select all
C:\Users\Alan\xmos\mash>xrun --io app_mash\bin\MASH.xe
xrun: Program received signal ET_LOAD_STORE, Memory access exception.
_Sreminder_driver_0.init.1 (_Sreminder_driver_0.init.1.state_ptr=0x7fd04)
at C:/Users/Alan/xmos/mash/module_reminder/src/reminder.xc:9
9 unsigned long long ticks = 0ULL;
Any ideas on how to fix this, am I doing something wrong or is this a compiler issue?