Shop OBEX P1 Docs P2 Docs Learn Events
installVP and removeVP — Parallax Forums

installVP and removeVP

edgellmhedgellmh Posts: 85
edited 2008-06-19 00:10 in General Discussion
I must have a mis-apprehension about what removeVp and installVP do. I want to use these to keep the number of VPs down. So I creat a VP remove it and then reinstall it when needed. However, the way I implemented this did not work. Code is attached. I am testing the approach by sending text to the 4x20 LCD display. A flag determines whether the removeVPP/installVP system is in place. That way I can verify that other aspects of the code do what I intended.

marshall edgell

Comments

  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2008-06-18 23:48
    Don't call installVP and removeVP from your own class!
    Instead, use the provided start() and stop() for the Uart class.
    Eg.
    To stop a Uart, call dataFromCPU.stop()
    To start a Uart, call dataFromCPU.start()

    Edit:
    Before stopping a transmit uart, call
    while (!dataFromCPU.sendBufferEmpty()) ;
    This will ensure all data will have been transmitted
    before the uart is stopped.

    regards peter

    Post Edited (Peter Verkaik) : 6/19/2008 12:16:06 AM GMT
  • edgellmhedgellmh Posts: 85
    edited 2008-06-19 00:01
    Fantastic! That did the trick. You guys are sooo good.
    What are the removeVp and installVP functions for?

    marshall
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2008-06-19 00:10
    The javelin supports 6 running VP's simultaneously. installVP adds
    an object reference to the vpList, removeVP removes it
    from the vpList.

    regards peter
Sign In or Register to comment.