Welcome to the Parallax Discussion Forums, sign-up to participate.
' Spin methods=================
PUB setLock '' Set lock to prohibit updates to text string
repeat until not lockset(lock)
PUB clrLock '' Clear lock to allow updates to text string
:lock_loop lockset lock_id wc ' Loop until shared rx_array is locked by this routine
if_c jmp #:lock_loop ' prevents rx_array from being accessed by recorder until all bytes updated
mov loop_counter,#13 ' Prepare to copy 13 bytes from internal array to shared rx_array
:copy_loop wrbyte 0-0,ptr ' Copy a register from the internal array to the shared array
add :copy_loop,d1 ' Address next internal register
add ptr,#1 ' Address next shared register
djnz loop_counter,#:copy_loop ' Repeat for all registers
lockclr lock_id ' Unlock shared registers
frank freedman wrote: »
(Is there any sort of catalog/index of the objects in OBEX?) Asking if anyone knew of good examples in OBEX was a way to circumvent having to look at every object to see if it used a lock and how. If there was a downloadable image of the OBEX not zipped or anything it could at least be searched. Is there any sort of catalog for this?
Dave Hein wrote: »
Starting at http://obex.parallax.com/projects I selected "- All -" for "projects per". I then tried saving the page to a file from my browser, but this didn't give the full links. The links referenced a local file, which could have been edited to reference the project page on the web. However, rather than editing the links I just did a copy and paste from the browser screen to a document editor. I removed a couple of unused columns and saved it to an HTML file.
Dave Hein wrote: »
To answer the OP's question about lock, I found two entries in the OBEX that use locks. I did a "grep -r -i lockset" in the complete_obex direction and got matches in "Lock-Bit Demo" and "Wheel_Controller". However, my search didn't look in zip files where there are probably many more examples of using a lock. I know that the CLib object uses locks, and there are probably many more examples in zip files in the OBEX.