First, add '#include <stdarg.h>' (without quotes at the top of the user_routines.c file).
Code:
void Debug_uchar(unsigned char count,...)
{
va_list ap; /* the list of variables - needed for variadic functions */
unsigned char i; /* counter variable - for loop will iterate through the arguements */
if (num_of_prog_loops == DEBUG_LOOPS)
{
va_start(ap, count); /* we need to initialize the arguement list */
for (i = 0; i < count; i++)
{
printf("%d: %d\n", i, va_arg(ap, unsigned char);
}
printf("\n");
/* num_of_prog_loops is reset at the bottom of ????? routine */
}
va_end(ap);
}
num_of_prog_loops is a global variable being incremented, then set to 0 after a certain number of loops