Shop OBEX P1 Docs P2 Docs Learn Events
Error in Propeller C Library Studies — Parallax Forums

Error in Propeller C Library Studies

Sharing Values in Source Files - Functions in Multiple Files Sharing Variables - Try This
http://learn.parallax.com/propeller-c-library-studies/functions-multiple-files-sharing-variables

The last line of Timer.c has the wrong variable and generates an error when you build the project.
void secondCtr(void *par)
{
  int dt = CLKFREQ;
  int t = CNT;
  while(1)
  {
    waitcnt(t += dt);
    awesome_cog_sec_cnt++;     // Wrong name - Generates a Build Error
  }
}

This is what it should be:
void secondCtr(void *par)
{
  int dt = CLKFREQ;
  int t = CNT;
  while(1)
  {
    waitcnt(t += dt);
    // seconds++;
    awesome_cog_seconds++;     // 3rd declared variable at top of Timer.c
  }
}

Comments

Sign In or Register to comment.