122-32000 Parallax Inc, 122-32000 Datasheet - Page 228

MANUAL PROPELLER

122-32000

Manufacturer Part Number
122-32000
Description
MANUAL PROPELLER
Manufacturer
Parallax Inc
Datasheets

Specifications of 122-32000

Accessory Type
Manual
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With/related Products
Propeller Education (PE) Kit
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
LOCKCLR
Clear lock to false and get its previous state.
((PUB ┆ PRI))
Returns: Previous state of lock (
Explanation
LOCKCLR
manage resources that are user-defined and deemed mutually-exclusive.
ID to
See About Locks, page 230, and Suggested Rules for Locks, page 231 for information on the
typical use of locks and the
The following assumes that a cog (either this one or another) has already checked out a lock
using
cog has an array of longs called
PUB ReadResource | Idx
PUB WriteResource | Idx
Both of these methods,
after accessing the resource. First, they wait indefinitely at the first repeat loop until it has
locked the resource; i.e.: it has successfully “set” the associated lock. If
the condition “
accessing the resource, so that first repeat loop tries again. If
Page 228 · Propeller Manual v1.0
LOCKCLR
repeat until not lockset(SemID) 'wait until we lock the resource
repeat Idx from 0 to 9
lockclr(SemID)
repeat until not lockset(SemID) 'wait until we lock the resource
repeat Idx from 0 to 9
lockclr(SemID)
LocalData[Idx] := long[Idx]
long[Idx] := LocalData[Idx]
FALSE
LOCKNEW
ID
is one of four lock commands (
is the ID (0 – 7) of the lock to clear to false.
and retrieves the previous state of that lock (
( ID )
– Spin Language Reference
and shared the ID with this cog, which saved it as
until not lockset
ReadResource
LOCK
LocalData
xxx commands.
TRUE
…” is
or
and
FALSE
.
LOCKNEW
FALSE
WriteResource
'read all 10 longs of resource
'unlock the resource
'write all 10 longs to resource
'unlock the resource
).
, meaning that some other cog is currently
,
LOCKRET
TRUE
, follow the same rules before and
,
or
LOCKSET
FALSE
SemID
LOCKSET
).
, and
. It also assumes this
LOCKSET
LOCKCLR
returns
LOCKCLR
returns
clears lock
FALSE
) used to
TRUE
, the
,

Related parts for 122-32000