Here’s a stumper:
char Autonomous_1 (char State) // <---Right Here!
{
//...
}
The error is a syntax error. It is the only error in the listing, and it is at that line. I have removed 1 or 2 routines, and still get it.
Here’s a stumper:
char Autonomous_1 (char State) // <---Right Here!
{
//...
}
The error is a syntax error. It is the only error in the listing, and it is at that line. I have removed 1 or 2 routines, and still get it.
That looks OK on cursory examination. What comes right before that line? Is it possible you have unmatched braces?
a lot of times, it will give you a syntax error and the real error will be 10 lines up from the little green arrow.
#include "printf_lib.h"
/*******************************************************************************
* FUNCTION NAME: PrintRamString
* PURPOSE: Run 1 loop for autonomous mode 1
* CALLED FROM: anywhere
* ARGUMENTS:
* Input: char State - What is the state of atuonomous
* RETURNS: char - is it finished?
*******************************************************************************/
The only thing above it is comments and #includes
Have you modified printf_lib.h?
Some. Mostly just a #endif at the end.
I added
/************************************************** *****************************
* FUNCTION NAME: PrintRamString
* PURPOSE: Run 1 loop for autonomous mode 1
* CALLED FROM: anywhere
* ARGUMENTS:
* Input: char State - What is the state of atuonomous
* RETURNS: char - is it finished?
************************************************** *****************************/
char Autonomous_1 (char State) // <---Right Here!
{
//...
}
right after a #include of our stock printf_lib.h. No error. How about if you post your printf_lib.h?
/*******************************************************************************
* FILE NAME: printf_lib.h
*
* DESCRIPTION:
* This is the include file which corresponds to printf_lib.c
*
* USAGE:
* If you add your own routines to that file, this is a good place
* to add function prototypes.
*******************************************************************************/
#ifndef __printf_lib_h_
#define __printf_lib_h_
int printf(rom const char *format, ...);
void printid(int data,int crtOn);
void printb(unsigned char data,int crtOn);
void printd(unsigned char data,int crtOn);
void printix(int data,int crtOn);
void printx(unsigned char data,int crtOn);
void debug_print(char *bufr,int data);
void debug_printb(char *bufr,unsigned int data);
void debug_println(char *bufr);
#endif
/******************************************************************************/
/******************************************************************************/
/******************************************************************************/
Commenting out the last few declares don’t help.
Well, you might be right. I’m still stumped. You didn’t do something weird like #defining char, Autonomous_1 or State, did you? (Or parentheses or underscores, taking a lesson from those obfuscated C samples posted elsewhere?)
I’m stumped too…
Since you have an #ifdef/#endif protecting your printf_lib.h from being included multiple times, I suspect the problem is being caused by the line(s) before that #include. Post a bit more context, and look at the other included files for unmatched parentheses or braces or even missing semicolons.
After 3 of us working on 4 computers last night to get it to compile, we got it to compile. There were various similar problems throughout the new stuff. I have to ask: Is there a limit on the number af function prototypes in a file?
Possible. How many did you have?
Is there some reason why you can’t use the stock printf lib if it works? If you can’t, try remodifying it one change at a time to see what it is.
The stock printf has many limitations to it. There have been several threads about this and several substitutes have been offered.