From: Joel Holdsworth Date: Sat, 18 Feb 2012 17:08:25 +0000 (+0000) Subject: Moved includes into a common include directory X-Git-Tag: sigrok-firmware-fx2lafw-0.1.0~66 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=a75a9ccb67defc791ccf9fdf73d4e149436dae3f;p=sigrok-firmware-fx2lafw.git Moved includes into a common include directory --- diff --git a/debug.h b/debug.h deleted file mode 100644 index 5cb6861e..00000000 --- a/debug.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * This file is part of the fx2lafw project. - * - * Copyright (C) 2012 Joel Holdsworth - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifdef DEBUG - -#define ERRF(fmt, ...) \ - do { debugf("E " fmt, __VA_ARGS__); \ - while(1); } while(0) -#define ERR(msg) \ - ERRF("%s", msg) - -#define WARNF(fmt, ...) \ - debugf("W " fmt, __VA_ARGS__) -#define WARN(msg) \ - WARNF("%s", msg) - -#define INFOF(fmt, ...) \ - debugf("I " fmt, __VA_ARGS__) -#define INFO(msg) \ - INFOF("%s", msg) - -/** - * A printf the prints messages through the UART - * EP6. - */ -void debugf(const char *format, ...); - -#else - -#define ERRF(fmt, ...) \ - ((void) 0) -#define ERR(msg) \ - ((void) 0) - -#define WARNF(fmt, ...) \ - ((void) 0) -#define WARN(msg) \ - ((void) 0) - -#define INFOF(fmt, ...) \ - ((void) 0) -#define INFO(msg) \ - ((void) 0) - -#endif diff --git a/fx2lafw.h b/fx2lafw.h deleted file mode 100644 index 5819b6c6..00000000 --- a/fx2lafw.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * This file is part of the fx2lafw project. - * - * Copyright (C) 2012 Joel Holdsworth - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include - -/** - * Performs setup common to all fx2lafw devices. - */ -void fx2lafw_init(void); - -/** - * Performs a single iteration of the main loop code which is common - * to all fx2lafw devices. - */ -void fx2lafw_run(void); diff --git a/fx2lafw.mk b/fx2lafw.mk index 20956ec8..a8f7a3b4 100644 --- a/fx2lafw.mk +++ b/fx2lafw.mk @@ -28,6 +28,6 @@ else SDCCFLAGS += -DNDEBUG endif -SDCCFLAGS += -I../ +SDCCFLAGS += -I../include/ include $(FX2LIBDIR)/lib/fx2.mk diff --git a/include/debug.h b/include/debug.h new file mode 100644 index 00000000..5cb6861e --- /dev/null +++ b/include/debug.h @@ -0,0 +1,62 @@ +/* + * This file is part of the fx2lafw project. + * + * Copyright (C) 2012 Joel Holdsworth + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifdef DEBUG + +#define ERRF(fmt, ...) \ + do { debugf("E " fmt, __VA_ARGS__); \ + while(1); } while(0) +#define ERR(msg) \ + ERRF("%s", msg) + +#define WARNF(fmt, ...) \ + debugf("W " fmt, __VA_ARGS__) +#define WARN(msg) \ + WARNF("%s", msg) + +#define INFOF(fmt, ...) \ + debugf("I " fmt, __VA_ARGS__) +#define INFO(msg) \ + INFOF("%s", msg) + +/** + * A printf the prints messages through the UART + * EP6. + */ +void debugf(const char *format, ...); + +#else + +#define ERRF(fmt, ...) \ + ((void) 0) +#define ERR(msg) \ + ((void) 0) + +#define WARNF(fmt, ...) \ + ((void) 0) +#define WARN(msg) \ + ((void) 0) + +#define INFOF(fmt, ...) \ + ((void) 0) +#define INFO(msg) \ + ((void) 0) + +#endif diff --git a/include/fx2lafw.h b/include/fx2lafw.h new file mode 100644 index 00000000..5819b6c6 --- /dev/null +++ b/include/fx2lafw.h @@ -0,0 +1,32 @@ +/* + * This file is part of the fx2lafw project. + * + * Copyright (C) 2012 Joel Holdsworth + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include + +/** + * Performs setup common to all fx2lafw devices. + */ +void fx2lafw_init(void); + +/** + * Performs a single iteration of the main loop code which is common + * to all fx2lafw devices. + */ +void fx2lafw_run(void);