Shop OBEX P1 Docs P2 Docs Learn Events
Using PASD after doing a COGSTOP/COGNEW; doesn't work — Parallax Forums

Using PASD after doing a COGSTOP/COGNEW; doesn't work

HarleyHarley Posts: 997
edited 2010-03-24 22:59 in Propeller 1
I have a PASM cog with a waitpeq. If a match doesn't occur, it is trapped unless the cog is stopped and restarted. I used the Spin code below, with PASDflg := 0 from Spin, but when using PASD it no longer is restored properly and PASD runs through some other cogs RES or LONGs variables or constants! What can be done to restore operation when debugging under PASD?

    $91 :                        ' Stop/Restart cog
      cogstop(BAid)                                     ' stop this (BAid) cog
      ms(12)                 ' wait about ~ 1/80th sec
      if PASDflg == 0
        BAid := cognew(@BAbusRd,@BPt) ' set for normal entry to BAbus comparator
'      elseif PASDflg == 1                                  THIS STILL DOESN'T WORK IN PASD
'        BAid := cognew(@entry,@BPt) ' set for PASD entry to BAbus comparator   



It appears to run OK in Spin, if the last two lines are commented out, but doesn't compile without error due to the '@entry' when not running under PASD. Oh for a conditional compiler. The '$91' is a result of an external keypad and a second Prop implementing a Break condition.

Hopefully this is described sufficiently. Hopefully there is a workaround scheme to run normally or via PASD. Maybe only Andy Schenk knows enough about PASD to answer this.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Harley Shanko

Comments

  • AribaAriba Posts: 2,690
    edited 2010-03-24 22:49
    Harley

    Only PASD should stop and start the debugged cog, otherwise PASD lose synchronization.

    And you can not switch at runtime between a cog code with the PASD Kernel and without it, you have to decide that at
    compile time. You just need to comment out the kernel to disable PASD, the 1. parameter for cognew stays then the same.

    It may be possible to have two separate versions of the cog code, one time with the Kernel and one time without it, and start
    then the one or the other according the PASDflg.

    Andy
  • HarleyHarley Posts: 997
    edited 2010-03-24 22:59
    Andy said...

    Harley

    Only PASD should stop and start the debugged cog, otherwise PASD lose synchronization.

    And you can not switch at runtime between a cog code with the PASD Kernel and without it, you have to decide that at
    compile time. You just need to comment out the kernel to disable PASD, the 1. parameter for cognew stays then the same.

    It may be possible to have two separate versions of the cog code, one time with the Kernel and one time without it, and start
    then the one or the other according the PASDflg.

    Andy

    Thank you Andy,

    OK, I figured there must be something I wasn't aware of (my BOLD emphasis on the PASD losing synchronization wording). I was hoping to make it work at run time. Dang, can't have everything at times. Would be nice tho.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Harley Shanko
Sign In or Register to comment.