I would like to use the generic queue functions to parse the console in queue, but can't see how to reference the queue.
Can this be done, and if so, how?
Or do I need to turn off the console (option console none) and create COM1 and its queues programatically.
Directly referencing console/COM1 queues
Directly referencing console/COM1 queues
Stuart Parker
www.sparxfly.co.nz
www.sparxfly.co.nz
Re: Directly referencing console/COM1 queues
Register.RxQueue and Register.TxQueue return the address of the receive queue and transmit queue, respectively. The value of each of these registers is an integral value so it needs to be passed through the CByteArray() function to render it usable as a queue.sparxfly wrote:I would like to use the generic queue functions [...]. Can this be done, and if so, how?
Code: Select all
If (GetQueueCount(CByteArray(Register.RxQueue)) > 0) Then
' do something
End If
www.zbasic.net/doc/ZBasicRef.php?page=81
Also, there is additional information on the system queues and how to set up replacement queues here:
http://www.zbasic.net/doc/ZBasicRef.php?page=74
- Don Kinzer
Re: Directly referencing console/COM1 queues
Thanks for the quick reply Don- I had just logged on to say 'found it' when I saw your reply.dkinzer wrote: Those two register values are documented here:
www.zbasic.net/doc/ZBasicRef.php?page=81
Also, there is additional information on the system queues and how to set up replacement queues here:
http://www.zbasic.net/doc/ZBasicRef.php?page=74
I had meanwhile elected to disable the console (option console none) and define COM1 and its queues programmatically, simply for symmetry with the code I am using to define a second software UART- it feels more in control (?).
Is there any downside in terms of code/memory space in doing so over using the console- ie does 'console none' remove all console stuff?
Stuart Parker
www.sparxfly.co.nz
www.sparxfly.co.nz
Re: Directly referencing console/COM1 queues
Option Console None removes everything related to Com1 - interrupt handlers, driver code, rx and tx queues, etc. any of which (except for the queues) will be added back if an OpenCom() call exists in the application that refers to Com1.sparxfly wrote:does 'console none' remove all console stuff?
This can be beneficial for a minimal application that doesn't use the console (to reduce code size and RAM use). Also, using Option Console None is preferred over closing Com1 and re-opening it with explicitly defined queues because the latter practice will leave the pre-defined queues in the code, essentially wasting that RAM.
- Don Kinzer