Problems with message queue
JaanDoh
Posts: 129
in Propeller 1
As per the WMF sample in one of the application notes,
I want to create a message queue as the cornerstone of the framework I'm working on.
And to be honest I'm getting bogged down in the head/tail (next/first/last message) parameters.
I've attached some code and not sure if the bits where I de-queue the message is correct or not.
I'm okay with queueing the new message into the message queue,
but de-queueing it, I'm just getting confused, maybe it is because the variables I'm using are not right,
like instead of nxt/first/last/qty maybe I should just use head/tail? or readptr/writeptr/qtymsgs
Once I am sure it's right, then I will move the data/variables for whole thing from VAR into DAT
As I read in the forums that its shared between all instances of the object.
Oh before I forget,
Another question is...
Is there anyway to know if a procedure exists or not?
Say if I want to check if a (third party) subroutine/procedure called "LoadFromSRam" exists within a program
is there anyway to do this from code and simply return true/false?
Thanks.
PS.
Please be gentle,
My aspirations are bigger than my knowledge of spin lol
I want to create a message queue as the cornerstone of the framework I'm working on.
And to be honest I'm getting bogged down in the head/tail (next/first/last message) parameters.
I've attached some code and not sure if the bits where I de-queue the message is correct or not.
I'm okay with queueing the new message into the message queue,
but de-queueing it, I'm just getting confused, maybe it is because the variables I'm using are not right,
like instead of nxt/first/last/qty maybe I should just use head/tail? or readptr/writeptr/qtymsgs
Once I am sure it's right, then I will move the data/variables for whole thing from VAR into DAT
As I read in the forums that its shared between all instances of the object.
Oh before I forget,
Another question is...
Is there anyway to know if a procedure exists or not?
Say if I want to check if a (third party) subroutine/procedure called "LoadFromSRam" exists within a program
is there anyway to do this from code and simply return true/false?
Thanks.
PS.
Please be gentle,
My aspirations are bigger than my knowledge of spin lol
Comments
I re-did the enqueue/dequeue routines.