Shop OBEX P1 Docs P2 Docs Learn Events
Simpletools pause() function — Parallax Forums

Simpletools pause() function

I am starting to work with Propeller C and found that the pause() function can be tripped up with large values.

May I suggest it be recoded like this:
void pause(int time)                          // pause function definition
{ // If st_pauseTicks not initialized, set it up to 1 ms.
  // if(!st_pauseTicks) set_pause_dt(CLKFREQ/1000);
  
  long t0 = CNT;
  
  while (time--) {
    waitcnt(t0 += st_pauseTicks);
  }  
}

Comments

  • Andy has been reasonably responsive to issues reported to GitHub, and even more responsive to pull requests. If you're not familiar (or simply don't have an account), I'd be happy to submit such a simple pull request on your behalf.

    https://github.com/parallaxinc/Simple-Libraries/issues
  • Thank you, David. The entire C ecosystem is new to me. I understand the language, but not how to deploy it (as easily as I can Spin) on the Propeller. I'm wanting to find out if CMM gives me more speed with same code space use as Spin as has been reported. I just finished a big project that has 3K lines of libraries, and three program files: one with 3K lines, two with 1.5K lines each. If I can make it run faster I am willing to try.
  • Sounds like a worthy goal for sure. Let me know if I can help! The simple libraries are meant to be simple though, not fast or efficient. Your own custom libraries, libpropeller, or PropWare will probably suit your professional needs more.
  • I have every intention of porting my personal libraries from Spin to C; it will aid the learning process and make converting apps a bit easier, too.
  • Thanks Jon - nice find. Could you record the issue here please https://github.com/parallaxinc/SimpleIDE/issues?

    And slow down, as I'm still trying to understand the Real Time Clock app that you built in Blockly!

    Ken Gracey
  • Done.
Sign In or Register to comment.