Hash :
acf5213f
Author :
Date :
2006-10-14T20:31:53
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
\ Test multiple device-nodes with injected erorrs... ;-}
\ Updated Thu, 04 Aug 2005 at 16:42 by David L. Paktor
fcode-version2
headers
alias rc! rb!
[message] Top-Level (root) device-node
create achin 12 c, 13 c, 14 c,
: breakin achin 3 bounds do i c@ . loop ;
: creakin 0 if breakin then ;
: deacon achin creakin drop breakin ;
[message] Subsidiary (child) device-node
new-device
create eek! 18 c, 17 c, 80 c, 79 c,
: freek eek! 4 bounds ?do i c@ . 1 +loop ;
: greek -1 if freek then ;
[message] About to access method from parent node
: hierareek
eek!
freek
achin
greek
;
: ikey hierareek freek greek ;
[message] about to end child node
finish-device
[message] We can access methods from the root node now
: jeeky
achin
3 type
;
[message] create sibling node
new-device
0 value inky
: kinky
" "( \
\ value offset
03 22 \ Comm Params (offset 22) = parity check (bit 0) even (bit 1)
4 17 \ Plex (offs 17) = full (bit 2)
b7 0e \ Bells (offs 0e) = Bits 7,6,4,2,1,0 (No church or Gamelon)
7f 0f \ Bell volume (offs 0f) = Just under halfway
89 10 \ Whistles (offs 10) = Foghorn, Train, Piccolo (Bits 7,3,0)
ff 18 \ Foghorn duration (offs 18) = maximum
22 14 \ Train-whistle (offs 14) = two short blasts
03 11 \ Piccolo = mercifully short
)"
bounds do i c@ i 1+ c@ inky + rc! 2 +loop
;
[message] creating nephew node
new-device
: open kinky true ;
[message] creating great-nephew node
new-device
: open
jeeky
kinky
true ;
fcode-end