Shop OBEX P1 Docs P2 Docs Learn Events
Accessing spin variables in a seperate COG using one pointer. — Parallax Forums

Accessing spin variables in a seperate COG using one pointer.

numminummi Posts: 4
edited 2011-04-13 18:42 in Propeller 1
The variables are defined as such
  long Course
  long Speed
  long TimeStamp[2]
  long Flags
  long Latitude[2]
  long Longitude[3]
  long Date[2]
  long Satellites
  long Altitude
and the start function returns a pointer to course. Is there any way I can access these variables using just the pointer to course.
Thanks for any help!

Comments

  • kuronekokuroneko Posts: 3,623
    edited 2011-04-13 18:05
    Sure, assuming said address is stored in base_address then
    a := long[base_address][4]
    
    will access Flags (the 5th long in the array, 0..4).
  • Mike GMike G Posts: 2,702
    edited 2011-04-13 18:06
    When you say a separate COG do you mean passing variables to PASM? Otherwise the the variable as accessible in HUM RAM as long[@Course][0], long[@Course][1]... long[@Course][n] See "LONG" on page 127 in the propeller manual.
  • numminummi Posts: 4
    edited 2011-04-13 18:42
    thanks all
Sign In or Register to comment.