Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simpletools pause() function #283

Open
JonMcPhalen opened this issue May 30, 2017 · 1 comment
Open

Simpletools pause() function #283

JonMcPhalen opened this issue May 30, 2017 · 1 comment

Comments

@JonMcPhalen
Copy link

I found that the pause() function can be tripped up with large values. May I suggest that it be re-coded as follows.

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);
  }  
}
@MatzElectronics
Copy link

@JonMcPhalen Post this issue in the Simpletools-library repo - it will get addressed there, and thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants