Don Pomplun
01-30-2007, 02:34 AM
I have 2 separately compiled objects, listed below without all the fluff (I hope). The intent is that Top Level Object starts
X10Control's Start method in a new cog. Everything goes well until I load it , but all that happens is the PropStick resets.
Hopefully you'll see something OBVIOUSLY wrong ;=)
-- Don
{{
X10 Control
}}
var
byte Head, Tail
pub Start ( HeadPtr, BufLen )
Head := long [HeadPtr]
Tail := long [HeadPtr]
' repeat while Head == Tail
' *************************************
{ top level object }
con
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
BufLen = 20 ' number of X10 commands that can be buffered
var
byte Buf[7]
long dummyStack[20]
obj
text : "tv_text"
X10 : "X10 Control"
pub start | TTdata
ParamNum := 0
bytefill ( @Buf, 0, 5 )
PoundsReqd := 0
ParamLen := 0
text.start(0) ' crt on pins 0-2
' TTdata := cognew ( X10.Start( @X10Head, BufLen ), @dummyStack) ' <<<<<<<<<<<<<
text.str ( string("new cog="))
text.dec(TTdata)
text.out(13)
repeat ' forever loop
repeat until ina[DV]~~ ' wait for DV to go high
repeat until ina[DV]==0 ' wait for DV to go low
dat
X10Head long 0
X10Tail long 0
X10Buf long 0[BufLen]
Post Edited By Moderator (Joshua Donelson (Parallax)) : 10/23/2009 4:45:10 AM GMT
X10Control's Start method in a new cog. Everything goes well until I load it , but all that happens is the PropStick resets.
Hopefully you'll see something OBVIOUSLY wrong ;=)
-- Don
{{
X10 Control
}}
var
byte Head, Tail
pub Start ( HeadPtr, BufLen )
Head := long [HeadPtr]
Tail := long [HeadPtr]
' repeat while Head == Tail
' *************************************
{ top level object }
con
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
BufLen = 20 ' number of X10 commands that can be buffered
var
byte Buf[7]
long dummyStack[20]
obj
text : "tv_text"
X10 : "X10 Control"
pub start | TTdata
ParamNum := 0
bytefill ( @Buf, 0, 5 )
PoundsReqd := 0
ParamLen := 0
text.start(0) ' crt on pins 0-2
' TTdata := cognew ( X10.Start( @X10Head, BufLen ), @dummyStack) ' <<<<<<<<<<<<<
text.str ( string("new cog="))
text.dec(TTdata)
text.out(13)
repeat ' forever loop
repeat until ina[DV]~~ ' wait for DV to go high
repeat until ina[DV]==0 ' wait for DV to go low
dat
X10Head long 0
X10Tail long 0
X10Buf long 0[BufLen]
Post Edited By Moderator (Joshua Donelson (Parallax)) : 10/23/2009 4:45:10 AM GMT