From 1003c37e0b468f04c6b328e000de2a5c109bad82 Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Wed, 26 Sep 2012 20:18:18 +0200 Subject: [PATCH] cleanups --- drivers/gdisp/S6D1121/s6d1121_lld.c.h | 7 ++++- drivers/gdisp/TestStub/gdisp_lld.c | 18 ++++++++++-- drivers/touchpad/ADS7843/touchpad_lld.c | 9 ------ drivers/touchpad/XPT2046/touchpad_lld.c | 9 ------ include/gdisp_emulation.c | 13 ++------- include/touchpad.h | 2 +- include/touchpad_lld.h | 2 +- src/gdisp.c | 12 ++------ src/touchpad.c | 39 ++++++++++--------------- templates/touchpadXXXXX/touchpad_lld.c | 9 ------ 10 files changed, 44 insertions(+), 76 deletions(-) diff --git a/drivers/gdisp/S6D1121/s6d1121_lld.c.h b/drivers/gdisp/S6D1121/s6d1121_lld.c.h index 417a8001..d4ac694a 100644 --- a/drivers/gdisp/S6D1121/s6d1121_lld.c.h +++ b/drivers/gdisp/S6D1121/s6d1121_lld.c.h @@ -131,7 +131,12 @@ } static __inline void lld_lcdReadStreamStart(void) { /* TODO */ } static __inline void lld_lcdReadStreamStop(void) { /* TODO */ } - static __inline void lld_lcdReadStream(uint16_t *UNUSED(buffer), size_t UNUSED(size)) { /* TODO */ } + static __inline void lld_lcdReadStream(uint16_t *buffer, size_t size) { + (void)buffer; + (void)size; + + /* TODO */ + } #elif defined(LCD_USE_FSMC) #define LCD_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */ diff --git a/drivers/gdisp/TestStub/gdisp_lld.c b/drivers/gdisp/TestStub/gdisp_lld.c index e5b88416..8e658fae 100644 --- a/drivers/gdisp/TestStub/gdisp_lld.c +++ b/drivers/gdisp/TestStub/gdisp_lld.c @@ -72,7 +72,10 @@ bool_t GDISP_LLD(init)(void) { * * @notapi */ -void GDISP_LLD(drawpixel)(coord_t UNUSED(x), coord_t UNUSED(y), color_t UNUSED(color)) { +void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) { + (void)x; + (void)y; + (void)color; } /* ---- Optional Routines ---- */ @@ -87,7 +90,10 @@ void GDISP_LLD(drawpixel)(coord_t UNUSED(x), coord_t UNUSED(y), color_t UNUSED(c * * @notapi */ - color_t GDISP_LLD(getpixelcolor)(coord_t UNUSED(x), coord_t UNUSED(y)) { + color_t GDISP_LLD(getpixelcolor)(coord_t x, coord_t y) { + (void)x; + (void)y; + return 0; } #endif @@ -106,7 +112,13 @@ void GDISP_LLD(drawpixel)(coord_t UNUSED(x), coord_t UNUSED(y), color_t UNUSED(c * * @notapi */ - void GDISP_LLD(verticalscroll)(coord_t UNUSED(x), coord_t UNUSED(y), coord_t UNUSED(cx), coord_t UNUSED(cy), int UNUSED(lines), color_t UNUSED(bgcolor)) { + void GDISP_LLD(verticalscroll)(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) { + (void)x; + (void)y; + (void)cx; + (void)cy; + (void)lines; + (void)bgcolor; } #endif diff --git a/drivers/touchpad/ADS7843/touchpad_lld.c b/drivers/touchpad/ADS7843/touchpad_lld.c index 50f73e12..eeaf11b5 100644 --- a/drivers/touchpad/ADS7843/touchpad_lld.c +++ b/drivers/touchpad/ADS7843/touchpad_lld.c @@ -36,15 +36,6 @@ /* Driver local definitions. */ /*===========================================================================*/ -#ifdef UNUSED -#elif defined(__GNUC__) -# define UNUSED(x) UNUSED_ ## x __attribute__((unused)) -#elif defined(__LCLINT__) -# define UNUSED(x) /*@unused@*/ x -#else -# define UNUSED(x) x -#endif - /*===========================================================================*/ /* Driver exported variables. */ /*===========================================================================*/ diff --git a/drivers/touchpad/XPT2046/touchpad_lld.c b/drivers/touchpad/XPT2046/touchpad_lld.c index 50f73e12..eeaf11b5 100644 --- a/drivers/touchpad/XPT2046/touchpad_lld.c +++ b/drivers/touchpad/XPT2046/touchpad_lld.c @@ -36,15 +36,6 @@ /* Driver local definitions. */ /*===========================================================================*/ -#ifdef UNUSED -#elif defined(__GNUC__) -# define UNUSED(x) UNUSED_ ## x __attribute__((unused)) -#elif defined(__LCLINT__) -# define UNUSED(x) /*@unused@*/ x -#else -# define UNUSED(x) x -#endif - /*===========================================================================*/ /* Driver exported variables. */ /*===========================================================================*/ diff --git a/include/gdisp_emulation.c b/include/gdisp_emulation.c index b38ca281..c81bd305 100644 --- a/include/gdisp_emulation.c +++ b/include/gdisp_emulation.c @@ -33,15 +33,6 @@ #if HAL_USE_GDISP || defined(__DOXYGEN__) -#ifdef UNUSED -#elif defined(__GNUC__) -# define UNUSED(x) UNUSED_ ## x __attribute__((unused)) -#elif defined(__LCLINT__) -# define UNUSED(x) /*@unused@*/ x -#else -# define UNUSED(x) x -#endif - #ifndef GDISP_LLD_NO_STRUCT static struct GDISPDriver { coord_t Width; @@ -587,7 +578,9 @@ #if GDISP_NEED_CONTROL && !GDISP_HARDWARE_CONTROL - void GDISP_LLD(control)(unsigned UNUSED(what), void *UNUSED(value)) { + void GDISP_LLD(control)(unsigned what, void *value) { + (void)what; + (void)value; /* Ignore everything */ } #endif diff --git a/include/touchpad.h b/include/touchpad.h index 4d4931fe..d168fc0c 100644 --- a/include/touchpad.h +++ b/include/touchpad.h @@ -1,5 +1,5 @@ /* - ChibiOS/GFX/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/include/touchpad_lld.h b/include/touchpad_lld.h index 0292aac4..d00b6e6f 100644 --- a/include/touchpad_lld.h +++ b/include/touchpad_lld.h @@ -1,5 +1,5 @@ /* - ChibiOS/GFX/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/src/gdisp.c b/src/gdisp.c index b97260c1..d566d89f 100644 --- a/src/gdisp.c +++ b/src/gdisp.c @@ -43,15 +43,6 @@ /* Driver local definitions. */ /*===========================================================================*/ -#ifdef UNUSED -#elif defined(__GNUC__) -# define UNUSED(x) UNUSED_ ## x __attribute__((unused)) -#elif defined(__LCLINT__) -# define UNUSED(x) /*@unused@*/ x -#else -# define UNUSED(x) x -#endif - #if GDISP_NEED_MULTITHREAD #if !CH_USE_MUTEXES #error "GDISP: CH_USE_MUTEXES must be defined in chconf.h because GDISP_NEED_MULTITHREAD is defined" @@ -94,7 +85,8 @@ /*===========================================================================*/ #if GDISP_NEED_ASYNC - static msg_t GDISPThreadHandler(void *UNUSED(arg)) { + static msg_t GDISPThreadHandler(void *arg) { + (void)arg; gdisp_lld_msg_t *pmsg; #if CH_USE_REGISTRY diff --git a/src/touchpad.c b/src/touchpad.c index 676e8e33..f0da743c 100644 --- a/src/touchpad.c +++ b/src/touchpad.c @@ -36,15 +36,6 @@ /* Driver local definitions. */ /*===========================================================================*/ -#ifdef UNUSED -#elif defined(__GNUC__) -# define UNUSED(x) UNUSED_ ## x __attribute__((unused)) -#elif defined(__LCLINT__) -# define UNUSED(x) /*@unused@*/ x -#else -# define UNUSED(x) x -#endif - /*===========================================================================*/ /* Driver exported variables. */ /*===========================================================================*/ @@ -172,6 +163,7 @@ uint16_t tpReadX(void) { case landscapeInv: return y; } + return 0; } @@ -198,6 +190,7 @@ uint16_t tpReadY(void) { case landscapeInv: return SCREEN_WIDTH - x; } + return 0; } @@ -232,27 +225,27 @@ void tpCalibrate(void) { #endif } +/** + * @brief returns if touchpad is pressed or not + * + * @return 1 if pressed, 0 otherwise + * + * @api + */ #if TOUCHPAD_HAS_IRQ || defined(__DOXYGEN__) - /** - * @brief returns if touchpad is pressed or not - * - * @return 1 if pressed, 0 otherwise - * - * @api - */ uint8_t tpIRQ(void) { return tp_lld_irq(); } #endif +/** + * @brief Get the pressure. + * + * @return The pressure. + * + * @api + */ #if TOUCHPAD_HAS_PRESSURE || defined(__DOXYGEN__) - /** - * @brief Get the pressure. - * - * @return The pressure. - * - * @api - */ uint16_t tpReadZ(void) { /* ToDo */ return (tp_lld_read_z()); diff --git a/templates/touchpadXXXXX/touchpad_lld.c b/templates/touchpadXXXXX/touchpad_lld.c index 8717bb4f..9a1e8dad 100644 --- a/templates/touchpadXXXXX/touchpad_lld.c +++ b/templates/touchpadXXXXX/touchpad_lld.c @@ -42,15 +42,6 @@ #define TP_CS_HIGH palSetPad(TP_CS_PORT, TP_CS) #define TP_CS_LOW palClearPad(TP_CS_PORT, TP_CS) -#ifdef UNUSED -#elif defined(__GNUC__) -# define UNUSED(x) UNUSED_ ## x __attribute__((unused)) -#elif defined(__LCLINT__) -# define UNUSED(x) /*@unused@*/ x -#else -# define UNUSED(x) x -#endif - /*===========================================================================*/ /* Driver exported variables. */ /*===========================================================================*/