# 1 "api_debug.c"
# 1 "/home/epics/playground/hadcon/API-Slave (merged 3.1 - 3.0 and some clean-up)//"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "api_debug.c"







# 1 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdint.h" 1 3
# 121 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdint.h" 3
typedef int int8_t __attribute__((__mode__(__QI__)));
typedef unsigned int uint8_t __attribute__((__mode__(__QI__)));
typedef int int16_t __attribute__ ((__mode__ (__HI__)));
typedef unsigned int uint16_t __attribute__ ((__mode__ (__HI__)));
typedef int int32_t __attribute__ ((__mode__ (__SI__)));
typedef unsigned int uint32_t __attribute__ ((__mode__ (__SI__)));

typedef int int64_t __attribute__((__mode__(__DI__)));
typedef unsigned int uint64_t __attribute__((__mode__(__DI__)));
# 142 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdint.h" 3
typedef int16_t intptr_t;




typedef uint16_t uintptr_t;
# 159 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdint.h" 3
typedef int8_t int_least8_t;




typedef uint8_t uint_least8_t;




typedef int16_t int_least16_t;




typedef uint16_t uint_least16_t;




typedef int32_t int_least32_t;




typedef uint32_t uint_least32_t;







typedef int64_t int_least64_t;






typedef uint64_t uint_least64_t;
# 213 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdint.h" 3
typedef int8_t int_fast8_t;




typedef uint8_t uint_fast8_t;




typedef int16_t int_fast16_t;




typedef uint16_t uint_fast16_t;




typedef int32_t int_fast32_t;




typedef uint32_t uint_fast32_t;







typedef int64_t int_fast64_t;






typedef uint64_t uint_fast64_t;
# 273 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdint.h" 3
typedef int64_t intmax_t;




typedef uint64_t uintmax_t;
# 9 "api_debug.c" 2
# 1 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdio.h" 1 3
# 44 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdio.h" 3
# 1 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/inttypes.h" 1 3
# 77 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/inttypes.h" 3
typedef int32_t int_farptr_t;



typedef uint32_t uint_farptr_t;
# 45 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdio.h" 2 3
# 1 "/opt/cross/lib/gcc/avr/4.1.2/include/stdarg.h" 1 3 4
# 43 "/opt/cross/lib/gcc/avr/4.1.2/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 105 "/opt/cross/lib/gcc/avr/4.1.2/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 46 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdio.h" 2 3



# 1 "/opt/cross/lib/gcc/avr/4.1.2/include/stddef.h" 1 3 4
# 214 "/opt/cross/lib/gcc/avr/4.1.2/include/stddef.h" 3 4
typedef unsigned int size_t;
# 50 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdio.h" 2 3
# 242 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdio.h" 3
struct __file {
 char *buf;
 unsigned char unget;
 uint8_t flags;
# 261 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdio.h" 3
 int size;
 int len;
 int (*put)(char, struct __file *);
 int (*get)(struct __file *);
 void *udata;
};
# 405 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdio.h" 3
extern struct __file *__iob[];
# 417 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdio.h" 3
extern struct __file *fdevopen(int (*__put)(char, struct __file*), int (*__get)(struct __file*));
# 434 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdio.h" 3
extern int fclose(struct __file *__stream);
# 608 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdio.h" 3
extern int vfprintf(struct __file *__stream, const char *__fmt, va_list __ap);





extern int vfprintf_P(struct __file *__stream, const char *__fmt, va_list __ap);






extern int fputc(int __c, struct __file *__stream);




extern int putc(int __c, struct __file *__stream);


extern int putchar(int __c);
# 649 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdio.h" 3
extern int printf(const char *__fmt, ...);





extern int printf_P(const char *__fmt, ...);







extern int vprintf(const char *__fmt, va_list __ap);





extern int sprintf(char *__s, const char *__fmt, ...);





extern int sprintf_P(char *__s, const char *__fmt, ...);
# 685 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdio.h" 3
extern int snprintf(char *__s, size_t __n, const char *__fmt, ...);





extern int snprintf_P(char *__s, size_t __n, const char *__fmt, ...);





extern int vsprintf(char *__s, const char *__fmt, va_list ap);





extern int vsprintf_P(char *__s, const char *__fmt, va_list ap);
# 713 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdio.h" 3
extern int vsnprintf(char *__s, size_t __n, const char *__fmt, va_list ap);





extern int vsnprintf_P(char *__s, size_t __n, const char *__fmt, va_list ap);




extern int fprintf(struct __file *__stream, const char *__fmt, ...);





extern int fprintf_P(struct __file *__stream, const char *__fmt, ...);






extern int fputs(const char *__str, struct __file *__stream);




extern int fputs_P(const char *__str, struct __file *__stream);





extern int puts(const char *__str);




extern int puts_P(const char *__str);
# 762 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdio.h" 3
extern size_t fwrite(const void *__ptr, size_t __size, size_t __nmemb,
         struct __file *__stream);







extern int fgetc(struct __file *__stream);




extern int getc(struct __file *__stream);


extern int getchar(void);
# 810 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdio.h" 3
extern int ungetc(int __c, struct __file *__stream);
# 822 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdio.h" 3
extern char *fgets(char *__str, int __size, struct __file *__stream);






extern char *gets(char *__str);
# 840 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdio.h" 3
extern size_t fread(void *__ptr, size_t __size, size_t __nmemb,
        struct __file *__stream);




extern void clearerr(struct __file *__stream);
# 857 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdio.h" 3
extern int feof(struct __file *__stream);
# 868 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdio.h" 3
extern int ferror(struct __file *__stream);
# 1019 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdio.h" 3
extern int vfscanf(struct __file *__stream, const char *__fmt, va_list __ap);




extern int vfscanf_P(struct __file *__stream, const char *__fmt, va_list __ap);







extern int fscanf(struct __file *__stream, const char *__fmt, ...);




extern int fscanf_P(struct __file *__stream, const char *__fmt, ...);






extern int scanf(const char *__fmt, ...);




extern int scanf_P(const char *__fmt, ...);







extern int vscanf(const char *__fmt, va_list __ap);







extern int sscanf(const char *__buf, const char *__fmt, ...);




extern int sscanf_P(const char *__buf, const char *__fmt, ...);
# 1082 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdio.h" 3
static __inline__ int fflush(struct __file *stream __attribute__((unused)))
{
 return 0;
}
# 10 "api_debug.c" 2
# 1 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/string.h" 1 3
# 45 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/string.h" 3
# 1 "/opt/cross/lib/gcc/avr/4.1.2/include/stddef.h" 1 3 4
# 46 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/string.h" 2 3
# 110 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/string.h" 3
extern int ffs (int __val) __attribute__((__const__));
extern int ffsl (long __val) __attribute__((__const__));
extern int ffsll (long long __val) __attribute__((__const__));
extern void *memccpy(void *, const void *, int, size_t);
extern void *memchr(const void *, int, size_t) __attribute__((__pure__));
extern int memcmp(const void *, const void *, size_t) __attribute__((__pure__));
extern void *memcpy(void *, const void *, size_t);
extern void *memmem(const void *, size_t, const void *, size_t) __attribute__((__pure__));
extern void *memmove(void *, const void *, size_t);
extern void *memrchr(const void *, int, size_t) __attribute__((__pure__));
extern void *memset(void *, int, size_t);
extern char *strcat(char *, const char *);
extern char *strchr(const char *, int) __attribute__((__pure__));
extern char *strchrnul(const char *, int) __attribute__((__pure__));
extern int strcmp(const char *, const char *) __attribute__((__pure__));
extern char *strcpy(char *, const char *);
extern int strcasecmp(const char *, const char *) __attribute__((__pure__));
extern char *strcasestr(const char *, const char *) __attribute__((__pure__));
extern size_t strcspn(const char *__s, const char *__reject) __attribute__((__pure__));
extern size_t strlcat(char *, const char *, size_t);
extern size_t strlcpy(char *, const char *, size_t);
extern size_t strlen(const char *) __attribute__((__pure__));
extern char *strlwr(char *);
extern char *strncat(char *, const char *, size_t);
extern int strncmp(const char *, const char *, size_t) __attribute__((__pure__));
extern char *strncpy(char *, const char *, size_t);
extern int strncasecmp(const char *, const char *, size_t) __attribute__((__pure__));
extern size_t strnlen(const char *, size_t) __attribute__((__pure__));
extern char *strpbrk(const char *__s, const char *__accept) __attribute__((__pure__));
extern char *strrchr(const char *, int) __attribute__((__pure__));
extern char *strrev(char *);
extern char *strsep(char **, const char *);
extern size_t strspn(const char *__s, const char *__accept) __attribute__((__pure__));
extern char *strstr(const char *, const char *) __attribute__((__pure__));
extern char *strtok_r(char *, const char *, char **);
extern char *strupr(char *);
# 11 "api_debug.c" 2
# 1 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/ctype.h" 1 3
# 74 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/ctype.h" 3
extern int isalnum(int __c) __attribute__((__const__));






extern int isalpha(int __c) __attribute__((__const__));






extern int isascii(int __c) __attribute__((__const__));





extern int isblank(int __c) __attribute__((__const__));





extern int iscntrl(int __c) __attribute__((__const__));





extern int isdigit(int __c) __attribute__((__const__));





extern int isgraph(int __c) __attribute__((__const__));





extern int islower(int __c) __attribute__((__const__));





extern int isprint(int __c) __attribute__((__const__));






extern int ispunct(int __c) __attribute__((__const__));







extern int isspace(int __c) __attribute__((__const__));





extern int isupper(int __c) __attribute__((__const__));






extern int isxdigit(int __c) __attribute__((__const__));
# 173 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/ctype.h" 3
extern int toascii(int __c) __attribute__((__const__));





extern int tolower(int __c) __attribute__((__const__));





extern int toupper(int __c) __attribute__((__const__));
# 12 "api_debug.c" 2
# 1 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/math.h" 1 3
# 103 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/math.h" 3
extern double cos(double __x) __attribute__((__const__));







extern double fabs(double __x) __attribute__((__const__));
# 128 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/math.h" 3
extern double fmod(double __x, double __y) __attribute__((__const__));
# 143 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/math.h" 3
extern double modf(double __x, double *__iptr);






extern double sin(double __x) __attribute__((__const__));






extern double sqrt(double __x) __attribute__((__const__));







extern double tan(double __x) __attribute__((__const__));







extern double floor(double __x) __attribute__((__const__));







extern double ceil(double __x) __attribute__((__const__));
# 200 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/math.h" 3
extern double frexp(double __x, int *__pexp);
# 211 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/math.h" 3
extern double ldexp(double __x, int __exp) __attribute__((__const__));






extern double exp(double __x) __attribute__((__const__));






extern double cosh(double __x) __attribute__((__const__));






extern double sinh(double __x) __attribute__((__const__));






extern double tanh(double __x) __attribute__((__const__));
# 248 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/math.h" 3
extern double acos(double __x) __attribute__((__const__));
# 257 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/math.h" 3
extern double asin(double __x) __attribute__((__const__));







extern double atan(double __x) __attribute__((__const__));
# 275 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/math.h" 3
extern double atan2(double __y, double __x) __attribute__((__const__));






extern double log(double __x) __attribute__((__const__));







extern double log10(double __x) __attribute__((__const__));






extern double pow(double __x, double __y) __attribute__((__const__));







extern int isnan(double __x) __attribute__((__const__));







extern int isinf(double __x) __attribute__((__const__));
# 323 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/math.h" 3
extern double square(double __x) __attribute__((__const__));







__attribute__((__const__)) extern inline double copysign (double __x, double __y)
{
    asm (
 "bst	%D2, 7	\n\t"
 "bld	%D0, 7	"
 : "=r" (__x)
 : "0" (__x), "r" (__y) );
    return __x;
}







extern double fdim (double __x, double __y) __attribute__((__const__));
# 357 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/math.h" 3
extern double fma (double __x, double __y, double __z) __attribute__((__const__));
# 366 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/math.h" 3
extern double fmax (double __x, double __y) __attribute__((__const__));
# 375 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/math.h" 3
extern double fmin (double __x, double __y) __attribute__((__const__));
# 389 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/math.h" 3
extern int signbit (double __x) __attribute__((__const__));







extern double trunc (double __x) __attribute__((__const__));







__attribute__((__const__)) extern inline int isfinite (double __x)
{
    unsigned char __exp;
    asm (
 "mov	%0, %C1		\n\t"
 "lsl	%0		\n\t"
 "mov	%0, %D1		\n\t"
 "rol	%0		"
 : "=r" (__exp)
 : "r" (__x) );
    return __exp != 0xff;
}
# 428 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/math.h" 3
double hypot (double __x, double __y) __attribute__((__const__));
# 439 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/math.h" 3
double round (double __x) __attribute__((__const__));
# 452 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/math.h" 3
long lround (double __x) __attribute__((__const__));
# 466 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/math.h" 3
long lrint (double __x) __attribute__((__const__));
# 13 "api_debug.c" 2
# 1 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdlib.h" 1 3
# 47 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdlib.h" 3
# 1 "/opt/cross/lib/gcc/avr/4.1.2/include/stddef.h" 1 3 4
# 326 "/opt/cross/lib/gcc/avr/4.1.2/include/stddef.h" 3 4
typedef int wchar_t;
# 48 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdlib.h" 2 3
# 68 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdlib.h" 3
typedef struct {
 int quot;
 int rem;
} div_t;


typedef struct {
 long quot;
 long rem;
} ldiv_t;


typedef int (*__compar_fn_t)(const void *, const void *);
# 106 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdlib.h" 3
extern void abort(void) __attribute__((__noreturn__));




extern int abs(int __i) __attribute__((__const__));
# 120 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdlib.h" 3
extern long labs(long __i) __attribute__((__const__));
# 143 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdlib.h" 3
extern void *bsearch(const void *__key, const void *__base, size_t __nmemb,
       size_t __size, int (*__compar)(const void *, const void *));







extern div_t div(int __num, int __denom) __asm__("__divmodhi4") __attribute__((__const__));





extern ldiv_t ldiv(long __num, long __denom) __asm__("__divmodsi4") __attribute__((__const__));
# 175 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdlib.h" 3
extern void qsort(void *__base, size_t __nmemb, size_t __size,
    __compar_fn_t __compar);
# 208 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdlib.h" 3
extern long strtol(const char *__nptr, char **__endptr, int __base);
# 242 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdlib.h" 3
extern unsigned long strtoul(const char *__nptr, char **__endptr, int __base);
# 254 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdlib.h" 3
extern long atol(const char *__s) __attribute__((__pure__));
# 266 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdlib.h" 3
extern int atoi(const char *__s) __attribute__((__pure__));
# 278 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdlib.h" 3
extern void exit(int __status) __attribute__((__noreturn__));
# 290 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdlib.h" 3
extern void *malloc(size_t __size) __attribute__((__malloc__));






extern void free(void *__ptr);




extern size_t __malloc_margin;




extern char *__malloc_heap_start;




extern char *__malloc_heap_end;






extern void *calloc(size_t __nele, size_t __size) __attribute__((__malloc__));
# 338 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdlib.h" 3
extern void *realloc(void *__ptr, size_t __size) __attribute__((__malloc__));
# 370 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdlib.h" 3
extern double strtod(const char *__nptr, char **__endptr);
# 381 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdlib.h" 3
extern double atof(const char *__nptr);
# 403 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdlib.h" 3
extern int rand(void);



extern void srand(unsigned int __seed);






extern int rand_r(unsigned long *__ctx);
# 445 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdlib.h" 3
extern char *itoa(int __val, char *__s, int __radix);
# 473 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdlib.h" 3
extern char *ltoa(long int __val, char *__s, int __radix);
# 499 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdlib.h" 3
extern char *utoa(unsigned int __val, char *__s, int __radix);
# 525 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdlib.h" 3
extern char *ultoa(unsigned long int __val, char *__s, int __radix);
# 543 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdlib.h" 3
extern long random(void);




extern void srandom(unsigned long __seed);







extern long random_r(unsigned long *__ctx);
# 602 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdlib.h" 3
extern char *dtostre(double __val, char *__s, unsigned char __prec,
       unsigned char __flags);
# 619 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/stdlib.h" 3
extern char *dtostrf(double __val, signed char __width,
                     unsigned char __prec, char *__s);
# 14 "api_debug.c" 2
# 1 "/opt/cross/lib/gcc/avr/4.1.2/include/stddef.h" 1 3 4
# 152 "/opt/cross/lib/gcc/avr/4.1.2/include/stddef.h" 3 4
typedef int ptrdiff_t;
# 15 "api_debug.c" 2
# 1 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/util/delay.h" 1 3
# 39 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/util/delay.h" 3
# 1 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/util/delay_basic.h" 1 3
# 65 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/util/delay_basic.h" 3
static inline void _delay_loop_1(uint8_t __count) __attribute__((always_inline));
static inline void _delay_loop_2(uint16_t __count) __attribute__((always_inline));
# 80 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/util/delay_basic.h" 3
void
_delay_loop_1(uint8_t __count)
{
 __asm__ volatile (
  "1: dec %0" "\n\t"
  "brne 1b"
  : "=r" (__count)
  : "0" (__count)
 );
}
# 102 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/util/delay_basic.h" 3
void
_delay_loop_2(uint16_t __count)
{
 __asm__ volatile (
  "1: sbiw %0,1" "\n\t"
  "brne 1b"
  : "=w" (__count)
  : "0" (__count)
 );
}
# 40 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/util/delay.h" 2 3
# 79 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/util/delay.h" 3
static inline void _delay_us(double __us) __attribute__((always_inline));
static inline void _delay_ms(double __ms) __attribute__((always_inline));
# 107 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/util/delay.h" 3
void
_delay_us(double __us)
{
 uint8_t __ticks;
 double __tmp = ((10000000UL) / 3e6) * __us;
 if (__tmp < 1.0)
  __ticks = 1;
 else if (__tmp > 255)
 {
  _delay_ms(__us / 1000.0);
  return;
 }
 else
  __ticks = (uint8_t)__tmp;
 _delay_loop_1(__ticks);
}
# 141 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/util/delay.h" 3
void
_delay_ms(double __ms)
{
 uint16_t __ticks;
 double __tmp = ((10000000UL) / 4e3) * __ms;
 if (__tmp < 1.0)
  __ticks = 1;
 else if (__tmp > 65535)
 {

  __ticks = (uint16_t) (__ms * 10.0);
  while(__ticks)
  {

   _delay_loop_2(((10000000UL) / 4e3) / 10);
   __ticks --;
  }
  return;
 }
 else
  __ticks = (uint16_t)__tmp;
 _delay_loop_2(__ticks);
}
# 16 "api_debug.c" 2
# 1 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/io.h" 1 3
# 94 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/io.h" 3
# 1 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/sfr_defs.h" 1 3
# 95 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/io.h" 2 3
# 137 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/io.h" 3
# 1 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/iocan128.h" 1 3
# 38 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/iocan128.h" 3
# 1 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/iocanxx.h" 1 3
# 39 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/iocan128.h" 2 3
# 138 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/io.h" 2 3
# 305 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/io.h" 3
# 1 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/portpins.h" 1 3
# 306 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/io.h" 2 3

# 1 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/common.h" 1 3
# 308 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/io.h" 2 3

# 1 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/version.h" 1 3
# 310 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/io.h" 2 3


# 1 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/fuse.h" 1 3
# 181 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/fuse.h" 3
typedef struct
{
    unsigned char low;
    unsigned char high;
    unsigned char extended;
} __fuse_t;
# 313 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/io.h" 2 3


# 1 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/lock.h" 1 3
# 316 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/io.h" 2 3
# 17 "api_debug.c" 2
# 1 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/interrupt.h" 1 3
# 18 "api_debug.c" 2
# 1 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/sleep.h" 1 3
# 19 "api_debug.c" 2


# 1 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/eeprom.h" 1 3
# 49 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/eeprom.h" 3
# 1 "/opt/cross/lib/gcc/avr/4.1.2/include/stddef.h" 1 3 4
# 50 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/eeprom.h" 2 3
# 128 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/eeprom.h" 3
static inline uint8_t __attribute__ ((always_inline))
eeprom_read_byte (const uint8_t *addr);

static inline uint16_t __attribute__ ((always_inline))
eeprom_read_word (const uint16_t *addr);

static inline void __attribute__ ((always_inline))
eeprom_read_block (void *pointer_ram,
                   const void *pointer_eeprom,
                   size_t size);

static inline void __attribute__ ((always_inline))
eeprom_write_byte (uint8_t *addr,uint8_t value);

static inline void __attribute__ ((always_inline))
eeprom_write_word (uint16_t *addr,uint16_t value);

static inline void __attribute__ ((always_inline))
eeprom_write_block (const void *pointer_ram,
                    void *pointer_eeprom,
                    size_t size);
# 189 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/eeprom.h" 3
uint8_t
eeprom_read_byte (const uint8_t *addr)
{
  uint8_t result;
  __asm__ __volatile__
      ( "call" " __eeprom_read_byte_" "1F2021" "\n\t"
        "mov %1,__tmp_reg__"
       : "+x" (addr),
         "=r" (result)
       : );
  return result;
}



uint16_t
eeprom_read_word (const uint16_t *addr)
{
  uint16_t result;

  __asm__ __volatile__ (
        "call" " __eeprom_read_word_" "1F2021" "\n\t"
       : "+x" (addr),
         "=z" (result)
       : );
  return result;
}







void
eeprom_read_block (void *pointer_ram,
                   const void *pointer_eeprom,
                   size_t n)
{
  if (!__builtin_constant_p (n)
      || n > 256)
    {

      uint16_t size = n;

      __asm__ __volatile__ (
            ".%=_start:" "\n\t"
            "sbiw %2,1" "\n\t"
            "brlt .%=_finished" "\n\t"
             "call" " __eeprom_read_byte_" "1F2021" "\n\t"
            "st z+,__tmp_reg__" "\n\t"
            "rjmp .%=_start" "\n\t"
            ".%=_finished:"
          : "=x" (pointer_eeprom),
            "=z" (pointer_ram),
            "+w" (size)
           : "x" (pointer_eeprom),
             "z" (pointer_ram)
           : "memory");
    }
  else
    {
      if (n != 0)
        {
          if (n == 256)
            {
              __asm__ __volatile__ (
                  "call" " __eeprom_read_block_" "1F2021"
                : "+x" (pointer_eeprom),
                  "=z" (pointer_ram)
                : "z" (pointer_ram)
                : "memory");
            }
          else
            {

              uint8_t len;
              len = (uint8_t) n;

              __asm__ __volatile__ (
                  "mov __zero_reg__,%2" "\n\t"
                   "call" " __eeprom_read_block_" "1F2021"
                : "+x" (pointer_eeprom),
                  "=z" (pointer_ram)
                : "r" (len),
                  "z" (pointer_ram)
                : "memory");
            }
        }
    }
}




void
eeprom_write_byte (uint8_t *addr,uint8_t value)
{
  __asm__ __volatile__ (
         "mov __tmp_reg__,%1" "\n\t"
         "call" " __eeprom_write_byte_" "1F2021"
       : "+x" (addr)
       : "r" (value)
       : "memory"
      );
}




void
eeprom_write_word (uint16_t *addr,uint16_t value)
{
  __asm__ __volatile__ (



         "mov __tmp_reg__,%A1" "\n\t"
         "mov __zero_reg__,%B1" "\n\t"

          "call" " __eeprom_write_word_" "1F2021" "\n\t"
       : "+x" (addr)
       : "r" (value)
       : "memory"
      );
}





void
eeprom_write_block (const void *pointer_ram,
                    void *pointer_eeprom,
                    size_t n)
{
  if (!__builtin_constant_p (n)
      || n > 256)
    {

      uint16_t size = n;

      __asm__ __volatile__ (
            ".%=_start:" "\n\t"
            "sbiw %2,1" "\n\t"
            "brlt .%=_finished" "\n\t"
            "ld __tmp_reg__,z+" "\n\t"
             "call" " __eeprom_write_byte_" "1F2021" "\n\t"
            "rjmp .%=_start" "\n\t"
            ".%=_finished:"
          : "=x" (pointer_eeprom),
            "=z" (pointer_ram),
            "+w" (size)
           : "x" (pointer_eeprom),
             "z" (pointer_ram)
           : "memory");
    }
  else
    {

      if (n != 0)
        {
          if (n == 256)
            {
              __asm__ __volatile__ (
                 "call" " __eeprom_write_block_" "1F2021"
               : "+x" (pointer_eeprom),
                 "=z" (pointer_ram)
               : "z" (pointer_ram)
               : "memory" );
            }
          else
            {
              uint8_t len;
              len = (uint8_t) n;

              __asm__ __volatile__ (
                 "mov __zero_reg__,%2" "\n\t"
                 "call" " __eeprom_write_block_" "1F2021"
               : "+x" (pointer_eeprom),
                 "=z" (pointer_ram)
               : "r" (len),
                 "z" (pointer_ram)
               : "memory" );
            }

        }
    }
}
# 22 "api_debug.c" 2
# 1 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/wdt.h" 1 3
# 23 "api_debug.c" 2
# 1 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/pgmspace.h" 1 3
# 80 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/pgmspace.h" 3
# 1 "/opt/cross/lib/gcc/avr/4.1.2/include/stddef.h" 1 3 4
# 81 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/pgmspace.h" 2 3
# 210 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/pgmspace.h" 3
typedef void prog_void __attribute__((__progmem__));
typedef char prog_char __attribute__((__progmem__));
typedef unsigned char prog_uchar __attribute__((__progmem__));

typedef int8_t prog_int8_t __attribute__((__progmem__));
typedef uint8_t prog_uint8_t __attribute__((__progmem__));
typedef int16_t prog_int16_t __attribute__((__progmem__));
typedef uint16_t prog_uint16_t __attribute__((__progmem__));
typedef int32_t prog_int32_t __attribute__((__progmem__));
typedef uint32_t prog_uint32_t __attribute__((__progmem__));

typedef int64_t prog_int64_t __attribute__((__progmem__));
typedef uint64_t prog_uint64_t __attribute__((__progmem__));
# 615 "/opt/cross/lib/gcc/avr/4.1.2/../../../../avr/include/avr/pgmspace.h" 3
extern const prog_void * memchr_P(const prog_void * s, int val, size_t len) __attribute__((__const__));
extern int memcmp_P(const void *, const prog_void *, size_t) __attribute__((__pure__));
extern void *memcpy_P(void *, const prog_void *, size_t);
extern void *memmem_P(const void *, size_t, const prog_void *, size_t) __attribute__((__pure__));
extern const prog_void * memrchr_P(const prog_void * s, int val, size_t len) __attribute__((__const__));
extern char *strcat_P(char *, const prog_char *);
extern const prog_char * strchr_P(const prog_char * s, int val) __attribute__((__const__));
extern const prog_char * strchrnul_P(const prog_char * s, int val) __attribute__((__const__));
extern int strcmp_P(const char *, const prog_char *) __attribute__((__pure__));
extern char *strcpy_P(char *, const prog_char *);
extern int strcasecmp_P(const char *, const prog_char *) __attribute__((__pure__));
extern char *strcasestr_P(const char *, const prog_char *) __attribute__((__pure__));
extern size_t strcspn_P(const char *s, const prog_char * reject) __attribute__((__pure__));
extern size_t strlcat_P (char *, const prog_char *, size_t );
extern size_t strlcpy_P (char *, const prog_char *, size_t );
extern size_t strlen_P(const prog_char *) __attribute__((__const__));
extern size_t strnlen_P(const prog_char *, size_t) __attribute__((__const__));
extern int strncmp_P(const char *, const prog_char *, size_t) __attribute__((__pure__));
extern int strncasecmp_P(const char *, const prog_char *, size_t) __attribute__((__pure__));
extern char *strncat_P(char *, const prog_char *, size_t);
extern char *strncpy_P(char *, const prog_char *, size_t);
extern char *strpbrk_P(const char *s, const prog_char * accept) __attribute__((__pure__));
extern const prog_char * strrchr_P(const prog_char * s, int val) __attribute__((__const__));
extern char *strsep_P(char **sp, const prog_char * delim);
extern size_t strspn_P(const char *s, const prog_char * accept) __attribute__((__pure__));
extern char *strstr_P(const char *, const prog_char *) __attribute__((__pure__));
# 24 "api_debug.c" 2

# 1 "api.h" 1






# 1 "api_define.h" 1
# 8 "api.h" 2
# 1 "api_global.h" 1




# 1 "OWIDeviceSpecific.h" 1
# 6 "api_global.h" 2
# 1 "OWIHighLevelFunctions.h" 1
# 25 "OWIHighLevelFunctions.h"
void OWI_SendByte(unsigned char data, unsigned char pins);
unsigned char OWI_ReceiveByte(unsigned char pin);
void OWI_SkipRom(unsigned char pins);
void OWI_ReadRom(unsigned char * romValue, unsigned char pins);
void OWI_MatchRom(unsigned char * romValue, unsigned char pins);
unsigned char OWI_SearchRom(unsigned char * bitPattern, unsigned char lastDeviation, unsigned char pins);
unsigned char OWI_SearchAlarm(unsigned char * bitPattern, unsigned char lastDeviation, unsigned char pins);

uint16_t OWI_ReceiveWord( unsigned char pin );
# 7 "api_global.h" 2
# 1 "OWIBitFunctions.h" 1
# 24 "OWIBitFunctions.h"
# 1 "OWIdefs.h" 1
# 25 "OWIBitFunctions.h" 2
# 1 "OWIPolled.h" 1
# 26 "OWIBitFunctions.h" 2


void OWI_Init(unsigned char pins);
void OWI_WriteBit1(unsigned char pins);
void OWI_WriteBit0(unsigned char pins);
void OWI_WriteBit0ShortRelease(unsigned char pins);
unsigned char OWI_ReadBit(unsigned char pins);
unsigned char OWI_DetectPresence(unsigned char pins);
# 8 "api_global.h" 2



extern char temp_canString[41];
extern char canString[41];
extern char decrypt_uartString[127];
extern char store_canData[41];
extern char ring_buffer[30][41];
extern char setParameter[13][25];
extern char *ptr_setParameter[13];
extern char uart_message_string[127];
extern char message[127];
extern char uartString[127];
extern char keepAliveString[15];

extern int8_t can_init;
extern int8_t timer0_init;
extern int8_t timer0A_init;

extern uint8_t can_errorCode;
extern uint8_t general_errorCode;
extern uint8_t mailbox_errorCode;
extern uint8_t uart_errorCode;

extern volatile unsigned char BufferFull;
extern volatile unsigned char canReady;

extern volatile unsigned char timer0Ready;
extern volatile unsigned char timer1Ready;
extern volatile unsigned char timer0AReady;
extern volatile unsigned char timer0ASchedulerReady;
extern volatile unsigned char uartReady;

extern uint8_t mob;
extern unsigned char nextCharPos;

extern uint16_t subscribe_ID[15];
extern uint16_t subscribe_mask[15];

extern uint8_t ptr_buffer_in;
extern uint8_t ptr_buffer_out;
extern uint8_t ptr_subscribe;

extern uint8_t flag_pingActive;

extern const uint8_t serial_error_number[] ;
extern const char *serial_error[] __attribute__((__progmem__));

extern const uint8_t can_error_number[];
extern const char *can_error[] __attribute__((__progmem__));

extern const uint8_t mob_error_number[] ;
extern const char *mob_error[] __attribute__((__progmem__));

extern const uint16_t general_error_number[];
extern const char *general_error[] __attribute__((__progmem__));

extern char currentCommandKeyword[4];
extern char currentResponseKeyword[4];

extern uint16_t Voltages[8];


extern char tmp_str[127];

extern uint8_t usercommand;

extern uint8_t res0, res1, res2, res3;
extern uint8_t res4, res5, res6, res7;

extern uint8_t NumDevicesFound;

extern uint8_t owi_IDs[60][8];
extern uint8_t owi_IDs_pinMask[60];

extern uint8_t BUSES[8];



extern int8_t countDEV;
extern int8_t countDEVbus;

extern uint16_t owiBusMask;
extern uint16_t adcBusMask;
# 9 "api.h" 2
# 1 "api_constants.h" 1
# 10 "api.h" 2
# 1 "api_debug.h" 1
# 11 "api_debug.h"
# 1 "api.h" 1
# 12 "api_debug.h" 2


struct uartStruct;

extern uint8_t debug;
extern uint32_t debugMask;

enum debugLevels
{
   noDebug = 0,
   verboseDebug,
   eventDebug,
   eventDebugVerbose,
   periodicDebug,
   levelsDebug_MAXIMUM_INDEX
};

enum debugSystems
{
      debugMain,
      debugApi,
      debugApiMisc,
      debugUART,
      debugCAN,
      debugGETVOLTAGE,
      debugRELAY,
      debugCommandKey,
      debugOWI,
      debugOWITemperatures,
      debugDecrypt,
      debugDEBUG,
      debugOWIADC,
      debugOWIDualSwitches,
      debugOWISingleSwitches,
      debugOWIOctalSwitches,
      debugSHOW,
      debugOWIApiSettings,
      debugTIMER0,
      debugTIMER1,
      debugTIMER0A,
      debugTIMER0AScheduler,
      debugSystems_MAXIMUM_INDEX
};

void readModifyDebugLevelAndMask( struct uartStruct *ptr_uartStruct );
void readModifyDebugLevel( struct uartStruct *ptr_uartStruct );
void readModifyDebugMask( struct uartStruct *ptr_uartStruct );
# 11 "api.h" 2
# 1 "can.h" 1
# 10 "can.h"
# 1 "api_constants.h" 1
# 11 "can.h" 2



struct canStruct
{
 uint32_t Can_Message_ID;
 uint32_t Can_Mask;
 uint8_t Can_Mob;
 uint8_t Can_Length;
 unsigned char Can_Data[8];

};
extern struct canStruct canFrame;
extern struct canStruct *ptr_canStruct;
extern int32_t canDefaultBaudRate;



int8_t CAN_Init( int32_t Baudrate );

void enableCan( void );

void Convert_canFormat_to_UartFormat( struct canStruct *ptr_canStruct );

void Get_BusState( void );

uint8_t Get_CanError( void );

int8_t Get_FreeMob( void );

void clearCanRegisters( void );

void Reset_Parameter_CANSend_Message( void );

void Reset_Parameter_CANReceive( void );

void Wait_for_Can_Send_Message_Finished( void );

void Wait_for_Can_Receive_message_Finished( void );

void clearCanStruct( struct canStruct *ptr_canStruct);

void Convert_pack_canFrame_to_UartFormat( struct canStruct *ptr_canStruct );

int setCanBaudRate( const uint32_t rate, const uint32_t freq );
# 12 "api.h" 2




struct uartStruct
{
      uint32_t Uart_Message_ID;
      uint32_t Uart_Mask;
      uint8_t Uart_Rtr;
      uint8_t Uart_Length;
      uint16_t Uart_Data[8];
      int8_t commandKeywordIndex;
      int8_t number_of_arguments;
};

extern struct uartStruct uartFrame;
extern struct uartStruct *ptr_uartStruct;


void Process_Uart_Event( void );

int8_t Check_Error( struct uartStruct *ptr_uartStruct );

int8_t Check_Parameter( struct uartStruct *ptr_uartStruct );
int8_t Check_Parameter_CanFormat( struct uartStruct *ptr_uartStruct );

void Choose_Function( struct uartStruct *ptr_uartStruct );

void Convert_pack_canFrame_to_UartFormat( struct canStruct *ptr_canStruct );


void Convert_UartData_to_UartStruct( char string[13][25] );


void keep_alive( struct uartStruct *PtrFrame );

int8_t Decrypt_Uart_String( void );

void Receive_Message( struct uartStruct *PtrFrame );

void Initialization( void );

void Init_Port( void );

void Send_Message( struct uartStruct *PtrFrame );

void Subscribe_Message( struct uartStruct *PtrFrame );

int8_t Timer0_Init( void );

int8_t Timer0A_Init( void );

void Unsubscribe_Message( struct uartStruct *PtrFrame );

int8_t UART0_Init( void );

void UART0_Transmit( unsigned char c );

int16_t UART0_Send_Message_String( char *tmp_str, uint16_t maxSize );

int8_t UART0_Send_Message_String_woLF( char *tmp_str, uint32_t maxSize );

int Parse_Keyword( char string[] );

void Reset_SetParameter( void );

void Reset_UartStruct( struct uartStruct *ptr_uartStruct );

void clearUartStruct( struct uartStruct *ptr_uartStruct );

uint8_t CommunicationError( uint8_t errorType, const int16_t errorIndex, const uint8_t flag_printCommand, const prog_char *alternativeErrorMessage,
                            const int16_t alternativeErrorNumber );

uint8_t createReceiveHeader( struct uartStruct *ptr_uartStruct, char message_string[], uint16_t size );

uint16_t clearString( char mystring[], uint16_t length );

void toggle_pin( unsigned char pin_number );

void createExtendedSubCommandReceiveResponseHeader(struct uartStruct * ptr_uartStruct, int8_t keyNumber, int8_t index, const prog_char* commandKeyword[]);

uint16_t getNumericLength(const char string[], const uint16_t maxLenght);



extern const char *general_error[] __attribute__((__progmem__));
enum ge_index
{
   GENERAL_ERROR_init_for_timer0_failed = 0,
   GENERAL_ERROR_init_for_timer0A_failed,
   GENERAL_ERROR_family_code_not_found,
   GENERAL_ERROR_all_message_were_read,
   GENERAL_ERROR_no_device_is_connected_to_the_bus,
   GENERAL_ERROR_undefined_bus,
   GENERAL_ERROR_channel_undefined,
   GENERAL_ERROR_value_has_invalid_type,
   GENERAL_ERROR_adress_has_invalid_type,
   GENERAL_ERROR_undefined_family_code,
   GENERAL_ERROR_invalid_argument,
   GENERAL_ERROR_MAXIMUM_INDEX
};

extern const char *serial_error[] __attribute__((__progmem__));
enum se_index
{
   SERIAL_ERROR_no_valid_command_name = 0,
   SERIAL_ERROR_ID_is_too_long,
   SERIAL_ERROR_mask_is_too_long,
   SERIAL_ERROR_rtr_is_too_long,
   SERIAL_ERROR_length_is_too_long,
   SERIAL_ERROR_data_0_is_too_long,
   SERIAL_ERROR_data_1_is_too_long,
   SERIAL_ERROR_data_2_is_too_long,
   SERIAL_ERROR_data_3_is_too_long,
   SERIAL_ERROR_data_4_is_too_long,
   SERIAL_ERROR_data_5_is_too_long,
   SERIAL_ERROR_data_6_is_too_long,
   SERIAL_ERROR_data_7_is_too_long,
   SERIAL_ERROR_command_is_too_long,
   SERIAL_ERROR_argument_has_invalid_type,
   SERIAL_ERROR_ID_has_invalid_type,
   SERIAL_ERROR_mask_has_invalid_type,
   SERIAL_ERROR_rtr_has_invalid_type,
   SERIAL_ERROR_length_has_invalid_type,
   SERIAL_ERROR_data_0_has_invalid_type,
   SERIAL_ERROR_data_1_has_invalid_type,
   SERIAL_ERROR_data_2_has_invalid_type,
   SERIAL_ERROR_data_3_has_invalid_type,
   SERIAL_ERROR_data_4_has_invalid_type,
   SERIAL_ERROR_data_5_has_invalid_type,
   SERIAL_ERROR_data_6_has_invalid_type,
   SERIAL_ERROR_data_7_has_invalid_type,
   SERIAL_ERROR_undefined_error_type,
   SERIAL_ERROR_first_value_is_too_long,
   SERIAL_ERROR_second_value_is_too_long,
   SERIAL_ERROR_arguments_have_invalid_type,
   SERIAL_ERROR_arguments_exceed_boundaries,
   SERIAL_ERROR_too_many_arguments,
   SERIAL_ERROR_MAXIMUM_INDEX
};

extern const char *can_error[] __attribute__((__progmem__));
enum ce_index
{
   CAN_ERROR_Can_Bus_is_off = 0,
   CAN_ERROR_Can_Bus_is_passive,
   CAN_ERROR_Can_Bus_is_on,
   CAN_ERROR_Bit_Error,
   CAN_ERROR_Stuff_Error,
   CAN_ERROR_CRC_Error,
   CAN_ERROR_Form_Error,
   CAN_ERROR_Acknowdlegment_Error,
   CAN_ERROR_CAN_was_not_successfully_initialized,
   CAN_ERROR_timeout_for_CAN_communication,
   CAN_ERROR_MAXIMUM_INDEX
};

extern const char *mob_error[] __attribute__((__progmem__));
enum me_index
{
   MOB_ERROR_all_mailboxes_already_in_use = 0,
   MOB_ERROR_message_ID_not_found,
   MOB_ERROR_this_message_already_exists,
   MOB_ERROR_MAXIMUM_INDEX
};

extern const char* responseKeywords[] __attribute__((__progmem__));

enum responseKeyNumber
{
      responseKeyNumber_RECV = 0,
      responseKeyNumber_MAXIMUM_INDEX
};

extern const char* commandKeywords[] __attribute__((__progmem__));

enum cmdKeyNumber
{
               commandKeyNumber_SEND = 0,
               commandKeyNumber_SUBS,
               commandKeyNumber_USUB,
               commandKeyNumber_STAT,
               commandKeyNumber_RGWR,
               commandKeyNumber_RGRE,
               commandKeyNumber_RADC,
               commandKeyNumber_OWAD,
               commandKeyNumber_OWDS,
               commandKeyNumber_OWON,
               commandKeyNumber_OWLS,
               commandKeyNumber_OWSS,
               commandKeyNumber_RSET,
               commandKeyNumber_PING,
               commandKeyNumber_OWTP,
               commandKeyNumber_OWSP,
               commandKeyNumber_ADSP,
               commandKeyNumber_RLSL,
               commandKeyNumber_RLSH,
               commandKeyNumber_RLSI,
               commandKeyNumber_RLSO,
               commandKeyNumber_DBGL,
               commandKeyNumber_DBGM,
               commandKeyNumber_JTAG,
               commandKeyNumber_HELP,
               commandKeyNumber_OWTR,
               commandKeyNumber_OWRP,
               commandKeyNumber_ADRP,
               commandKeyNumber_DEBG,
               commandKeyNumber_PARA,
               commandKeyNumber_SHOW,
               commandKeyNumber_OWMR,
               commandKeyNumber_OWPC,
               commandKeyNumber_OWRb,
               commandKeyNumber_OWRB,
               commandKeyNumber_OWSC,
               commandKeyNumber_OWSB,
               commandKeyNumber_OWSA,
               commandKeyNumber_WDOG,
               commandKeyNumber_EXIT,
               commandKeyNumber_RLTH,
               commandKeyNumber_CMD1,
               commandKeyNumber_CMD2,
               commandKeyNumber_CMD3,
               commandKeyNumber_CMD4,
               commandKeyNumber_CMD5,
               commandKeyNumber_CMD6,
               commandKeyNumber_CMD7,
               commandKeyNumber_CMD8,
               commandKeyNumber_CMD9,
               commandKeyNumber_MAXIMUM_NUMBER
};

extern const char* commandShortDescriptions[] __attribute__((__progmem__));
extern const char* commandImplementations[] __attribute__((__progmem__));

extern const char *errorTypes[] __attribute__((__progmem__));

enum ERRs
{
   ERRG = 0,
   ERRA,
   ERRC,
   ERRM,
   ERRU,
   ERR_MAXIMUM_NUMBER
};

extern const char *debugLevelNames[] __attribute__((__progmem__));
extern const char *debugSystemNames[] __attribute__((__progmem__));
# 26 "api_debug.c" 2


# 1 "api_constants.h" 1
# 29 "api_debug.c" 2

# 1 "api_show.h" 1
# 13 "api_show.h"
# 1 "api_constants.h" 1
# 14 "api_show.h" 2
# 25 "api_show.h"
extern unsigned short unusedMemoryStart;
extern const char* commandShowKeywords[] __attribute__((__progmem__));
enum cmdShowKeyNumber
{
      commandShowKeyNumber_UNUSED_MEM_START = 0,
      commandShowKeyNumber_UNUSED_MEM_NOW ,
      commandShowKeyNumber_FREE_MEM_NOW ,
      commandShowKeyNumber_MEM ,
      commandShowKeyNumber_ALL_ERRORS ,
      commandShowKeyNumber_MAXIMUM_NUMBER
};

int8_t show(struct uartStruct *ptr_uartStruct);

int8_t showMem(struct uartStruct * ptr_uartStruct, uint8_t index);

int8_t showFreeMemNow(struct uartStruct * ptr_uartStruct);
int8_t showUnusedMemNow(struct uartStruct * ptr_uartStruct);
int8_t showUnusedMemStart(struct uartStruct * ptr_uartStruct);

void showErrors(struct uartStruct * ptr_uartStruct, uint8_t index);
# 31 "api_debug.c" 2
# 1 "api_help.h" 1
# 10 "api_help.h"
void help(struct uartStruct *ptr_uartStruct);
# 32 "api_debug.c" 2

static const char debugLevelName00[] __attribute__((__progmem__)) = "          noDebug";
static const char debugLevelName01[] __attribute__((__progmem__)) = "     verboseDebug";
static const char debugLevelName02[] __attribute__((__progmem__)) = "       eventDebug";
static const char debugLevelName03[] __attribute__((__progmem__)) = "eventDebugVerbose";
static const char debugLevelName04[] __attribute__((__progmem__)) = "    periodicDebug";

const char *debugLevelNames[] __attribute__((__progmem__)) = {
         debugLevelName00,
         debugLevelName01,
         debugLevelName02,
         debugLevelName03,
         debugLevelName04
};

static const char debugSystemName00[] __attribute__((__progmem__)) = "             Main";
static const char debugSystemName01[] __attribute__((__progmem__)) = "              Api";
static const char debugSystemName02[] __attribute__((__progmem__)) = "          ApiMisc";
static const char debugSystemName03[] __attribute__((__progmem__)) = "             UART";
static const char debugSystemName04[] __attribute__((__progmem__)) = "              CAN";
static const char debugSystemName05[] __attribute__((__progmem__)) = "       GETVOLTAGE";
static const char debugSystemName06[] __attribute__((__progmem__)) = "            RELAY";
static const char debugSystemName07[] __attribute__((__progmem__)) = "       CommandKey";
static const char debugSystemName08[] __attribute__((__progmem__)) = "              OWI";
static const char debugSystemName09[] __attribute__((__progmem__)) = "  OWITemperatures";
static const char debugSystemName10[] __attribute__((__progmem__)) = "          Decrypt";
static const char debugSystemName11[] __attribute__((__progmem__)) = "            DEBUG";
static const char debugSystemName12[] __attribute__((__progmem__)) = "           OWIADC";
static const char debugSystemName13[] __attribute__((__progmem__)) = "  OWIDualSwitches";
static const char debugSystemName14[] __attribute__((__progmem__)) = "OWISingleSwitches";
static const char debugSystemName15[] __attribute__((__progmem__)) = " OWIOctalSwitches";
static const char debugSystemName16[] __attribute__((__progmem__)) = "             SHOW";
static const char debugSystemName17[] __attribute__((__progmem__)) = "   OWIApiSettings";
static const char debugSystemName18[] __attribute__((__progmem__)) = "           TIMER0";
static const char debugSystemName19[] __attribute__((__progmem__)) = "           TIMER1";
static const char debugSystemName20[] __attribute__((__progmem__)) = "          TIMER0A";
static const char debugSystemName21[] __attribute__((__progmem__)) = " TIMER0AScheduler";

const char *debugSystemNames[] __attribute__((__progmem__)) =
{
   debugSystemName00,
   debugSystemName01,
   debugSystemName02,
   debugSystemName03,
   debugSystemName04,
   debugSystemName05,
   debugSystemName06,
   debugSystemName07,
   debugSystemName08,
   debugSystemName09,
   debugSystemName10,
   debugSystemName11,
   debugSystemName12,
   debugSystemName13,
   debugSystemName14,
   debugSystemName15,
   debugSystemName16,
   debugSystemName17,
   debugSystemName18,
   debugSystemName19,
   debugSystemName20,
   debugSystemName21
};

void readModifyDebugLevelAndMask(struct uartStruct *ptr_uartStruct)
{






 switch (ptr_uartStruct->number_of_arguments)
 {
 case 0:
  snprintf_P(uart_message_string, 127 - 1, (__extension__({static char __c[] __attribute__((__progmem__)) = ("RECV DEBG %i %lx"); &__c[0];})), debug, debugMask);
  UART0_Send_Message_String(((void *)0),0);
  break;
 case 1:
  if ( 0xFF < ptr_uartStruct->Uart_Message_ID )
  {
   CommunicationError(ERRA, SERIAL_ERROR_arguments_exceed_boundaries, 0, ((void *)0), 0);
   return;
  }
  debug = (uint8_t) (ptr_uartStruct->Uart_Message_ID & 0xFF);
  break;
 default:
  if ( 0xFFFF < ptr_uartStruct->Uart_Mask )
  {
   CommunicationError(ERRA, SERIAL_ERROR_mask_is_too_long, 0, ((void *)0), 0);
   return;
  }
  debugMask = (uint32_t) (ptr_uartStruct->Uart_Mask & 0xFFFFFFFF);
  break;
 }

 if ( verboseDebug <= debug && ((debugMask >> debugDEBUG) & 1))
 {
  if ( 0 < ptr_uartStruct->number_of_arguments)
  {
   ptr_uartStruct->number_of_arguments = 0;
   readModifyDebugLevelAndMask(ptr_uartStruct);
  }
 }
}

void readModifyDebugLevel(struct uartStruct *ptr_uartStruct)
{






 switch (ptr_uartStruct->number_of_arguments)
 {
 case 0:
  snprintf_P(uart_message_string, 127 - 1, (__extension__({static char __c[] __attribute__((__progmem__)) = ("RECV DBGL %x"); &__c[0];})), debug);
  UART0_Send_Message_String(((void *)0),0);
  break;
 default:
  if ( 0xFF < ptr_uartStruct->Uart_Message_ID )
  {
   CommunicationError(ERRA, SERIAL_ERROR_arguments_exceed_boundaries, 0, ((void *)0), 0);
   return;
  }
  debug = (uint8_t) (ptr_uartStruct->Uart_Message_ID & 0xFF);
  break;
 }

 if ( verboseDebug <= debug && ( ( debugMask >> debugDEBUG ) & 0x1 ) )
 {
  if ( 0 < ptr_uartStruct->number_of_arguments)
  {
   ptr_uartStruct->number_of_arguments = 0;
   readModifyDebugLevel(ptr_uartStruct);
  }
 }
}

void readModifyDebugMask(struct uartStruct *ptr_uartStruct)
{





 switch (ptr_uartStruct->number_of_arguments)
 {
 case 0:
  snprintf_P(uart_message_string, 127 - 1, (__extension__({static char __c[] __attribute__((__progmem__)) = ("RECV DBGM 0x%x"); &__c[0];})), debugMask);
  UART0_Send_Message_String(((void *)0),0);
  break;
 default:
  if ( 0xFF < ptr_uartStruct->Uart_Message_ID )
  {
   CommunicationError(ERRA, SERIAL_ERROR_mask_is_too_long, 0, ((void *)0), 0);
   return;
  }
  debugMask = (uint32_t) (ptr_uartStruct->Uart_Message_ID & 0xFFFFFFFF);
  break;
 }

 if ( verboseDebug <= debug && ((debugMask >> debugDEBUG) & 1))
 {
  if ( 0 < ptr_uartStruct->number_of_arguments)
  {
   ptr_uartStruct->number_of_arguments = 0;
   readModifyDebugMask(ptr_uartStruct);
  }
 }
}
