Skip to content

Simpletools pause() function #283

@JonMcPhalen

Description

@JonMcPhalen

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);
  }  
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions