Starting a new cog in spin
Philldapill
Posts: 1,283
I'm having trouble starting a new cog with a spin function. I've used the generic cognew line from most other objects. The object with these functions is Clock.
PUB Start
· okay := cog := cognew(TickTock,cogSpace) + 1
PUB TickTock | clkcnt
· clkcnt := cnt
· repeat
··· incSec
··· waitcnt(clkcnt += clkfreq)
cogSpace is just a LONG. Here is the problem: When I try to call Clock.Start from my Main in the other cog, the main cog seems to freeze and won't get passed the Clock.Start call. Any ideas?
PUB Start
· okay := cog := cognew(TickTock,cogSpace) + 1
PUB TickTock | clkcnt
· clkcnt := cnt
· repeat
··· incSec
··· waitcnt(clkcnt += clkfreq)
cogSpace is just a LONG. Here is the problem: When I try to call Clock.Start from my Main in the other cog, the main cog seems to freeze and won't get passed the Clock.Start call. Any ideas?
Comments