Shop OBEX P1 Docs P2 Docs Learn Events
shared data — Parallax Forums

shared data

Don PomplunDon Pomplun Posts: 116
edited 2007-01-29 18:19 in Propeller 1
I'm looking at 2 tasks. The first takes in data in bursts, and the second sends it out at a constant pace. So there will be a ring buffer between them to handle the asynchronicity. They are different compiled programs, each with its own tables in the DAT area. I assume those are properly handled, as neither task uses the other's DAT data. But what is the "recommended" means for defining and accessing my ring buffer? Since one is refenced as an OBJ by the other, it seems that CONs won't help.
TIA
-- Don

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-01-29 03:15
    One method is to have the parent object define the storage and pass a pointer to it in the argument of the start method for each child object.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-01-29 18:19
    Another technique is to have a method in the object that defines the storage area. This method just returns the address of the storage and is called from the other object.

    You can also write methods in the object that defines the storage area which add items to and remove items from the ring buffer (GetItem/PutItem). There would also be an initialization method (or this could be included in an object start method). Look at the keyboard driver in the Propeller Tool's library (the one that gets installed with the Propeller Tool) for an example of this.
Sign In or Register to comment.