View Single Post
  #3   Spotlight this post!  
Unread 19-02-2008, 16:48
d235j d235j is offline
Registered User
FRC #4454
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Philadelphia, PA
Posts: 25
d235j has a spectacular aura aboutd235j has a spectacular aura about
Re: "Code Error" with RegisterRepeatingTimer

Quote:
Originally Posted by BradAMiller View Post
You don't want to be printing from within the CheckIR function. Since that is an interrupt service routine, there might be problems doing long operations like that. I could imagine printing causing the code error to occur. Otherwise, I'm not sure what is going on without more information.
This is how our program looks:

Quote:
#include "BuiltIns.h"
#include "API.h"
#include "ifi_aliases.h"
#include "user_defs.h"
#include <p18cxxx.h>

void CheckIR(void)
{
// empty
}

void main(void)
{
RegisterRepeatingTimer(30, CheckIR);
while(1)
{
printf("TestRun\r\r");
}
}
As far as I know, the printf function isn't being called within the CheckIR loop. The printf output comes in "bursts," and the RC locks up after a few loops.
Quote:
Originally Posted by BradAMiller View Post
Also, there were a few problems with the whole program that some people were able to find and correct so be sure to read all the comments in the thread.
I am aware of those corrections; however, those don't seem to be related to our problem.
Thank you.