Quantcast
Channel: Learn with BlocklyProp — Parallax Forums
Viewing all articles
Browse latest Browse all 293

Error in Propeller C Library Studies

$
0
0
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
  }
}

Viewing all articles
Browse latest Browse all 293

Trending Articles