From 24c51ec1ff176b15a7533c7345932806d007eae1 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 15 Jun 2016 11:40:33 -0600 Subject: [PATCH] Centralize definitions associated with CONFIG_DEBUG_LCD --- Kconfig | 31 +++++++++- arch/sim/src/board_lcd.c | 12 ---- configs/compal_e99/src/ssd1783.c | 9 +-- configs/hymini-stm32v/src/stm32_r61505u.c | 12 ---- configs/hymini-stm32v/src/stm32_ssd1289.c | 26 --------- configs/kwikstik-k40/src/k40_lcd.c | 33 ----------- configs/lpcxpresso-lpc1768/src/lpc17_oled.c | 16 ------ configs/maple/src/stm32_lcd.c | 22 -------- configs/mikroe-stm32f4/src/stm32_mio283qt2.c | 25 --------- configs/mikroe-stm32f4/src/stm32_mio283qt9a.c | 25 --------- configs/nucleo-f303re/src/stm32_ssd1351.c | 10 ---- configs/olimex-lpc1766stk/src/lpc17_lcd.c | 9 --- .../pcblogic-pic32mx/src/pic32mx_lcd1602.c | 30 +--------- configs/pic32mx7mmb/src/pic32_mio283qt2.c | 24 -------- configs/sam3u-ek/src/sam_lcd.c | 48 +++++----------- configs/sam4e-ek/src/sam_ili9325.c | 25 --------- configs/sam4e-ek/src/sam_ili9341.c | 25 --------- configs/sam4l-xplained/src/sam_slcd.c | 30 +--------- .../sam4l-xplained/src/sam_ug2832hsweg04.c | 10 ---- .../samd20-xplained/src/sam_ug2832hsweg04.c | 10 ---- .../samd21-xplained/src/sam_ug2832hsweg04.c | 10 ---- .../saml21-xplained/src/sam_ug2832hsweg04.c | 10 ---- configs/samv71-xult/src/sam_ili9488.c | 23 -------- configs/shenzhou/src/stm32_ili93xx.c | 25 --------- configs/shenzhou/src/stm32_ssd1289.c | 25 --------- configs/stm3210e-eval/src/stm32_lcd.c | 26 --------- configs/stm3220g-eval/src/stm32_lcd.c | 26 --------- configs/stm3240g-eval/src/stm32_lcd.c | 26 --------- .../stm32f429i-disco/src/stm32_ili93414ws.c | 12 ---- configs/stm32f429i-disco/src/stm32_lcd.c | 14 +---- configs/stm32f4discovery/src/stm32_rgbled.c | 22 ++++---- configs/stm32f4discovery/src/stm32_ssd1289.c | 29 +--------- configs/stm32f4discovery/src/stm32_ssd1351.c | 12 ---- .../src/stm32_ug2864ambag01.c | 12 ---- .../src/stm32_ug2864hsweg01.c | 12 ---- configs/stm32ldiscovery/src/stm32_lcd.c | 30 ++-------- configs/sure-pic32mx/src/pic32mx_lcd1602.c | 30 +--------- .../viewtool-stm32f107/src/stm32_ssd1289.c | 30 ---------- configs/zp214xpa/src/lpc2148_ug2864ambag01.c | 12 ---- drivers/lcd/ili9341.c | 20 ++----- drivers/lcd/memlcd.c | 12 ---- drivers/lcd/mio283qt2.c | 26 --------- drivers/lcd/mio283qt9a.c | 26 --------- drivers/lcd/nokia6100.c | 12 ---- drivers/lcd/pcf8574_lcd_backpack.c | 10 ---- drivers/lcd/ra8875.c | 24 -------- drivers/lcd/ssd1289.c | 26 --------- drivers/lcd/ssd1306.h | 10 ---- drivers/lcd/ug-2864ambag01.c | 10 ---- drivers/lcd/ug-9664hswag01.c | 10 ---- drivers/leds/rgbled.c | 4 -- include/debug.h | 56 +++++++++++++++++++ libc/misc/lib_slcddecode.c | 25 --------- 53 files changed, 130 insertions(+), 959 deletions(-) diff --git a/Kconfig b/Kconfig index 9ea4948e01..9a22437dda 100644 --- a/Kconfig +++ b/Kconfig @@ -882,9 +882,34 @@ config DEBUG_LCD default n depends on LCD ---help--- - Enable low level debug SYSLOG output from the LCD driver (disabled - by default). Support for this debug option is board-specific and - may not be available for some boards. + Enable LCD driver debug features. + + Support for this debug option is board-specific and may not + be available for some boards. +if DEBUG_LCD + +config DEBUG_LCD_ERROR + bool "LCD Driver Error Output" + default n + depends on DEBUG_ERROR + ---help--- + Enable LCD driver error output to SYSLOG. + +config DEBUG_LCD_WARN + bool "LCD Driver Warnings Output" + default n + depends on DEBUG_WARN + ---help--- + Enable LCD driver warning output to SYSLOG. + +config DEBUG_LCD_INFO + bool "LCD Driver Informational Output" + default n + depends on DEBUG_INFO + ---help--- + Enable LCD driver informational output to SYSLOG. + +endif # DEBUG_LCD config DEBUG_LEDS bool "Low-level LED Debug Output" diff --git a/arch/sim/src/board_lcd.c b/arch/sim/src/board_lcd.c index 76b68bbeb7..0467c77b9f 100644 --- a/arch/sim/src/board_lcd.c +++ b/arch/sim/src/board_lcd.c @@ -100,18 +100,6 @@ # error "Unsupported BPP" #endif -/* Debug ********************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr(format, ...) err(format, ##__VA_ARGS__) -# define lcdwarn(format, ...) warn(format, ##__VA_ARGS__) -# define lcdinfo(format, ...) info(format, ##__VA_ARGS__) -#else -# define lcderr(x...) -# define lcdwarn(x...) -# define lcdinfo(x...) -#endif - /**************************************************************************** * Private Type Definition ****************************************************************************/ diff --git a/configs/compal_e99/src/ssd1783.c b/configs/compal_e99/src/ssd1783.c index de9cd80494..1482bb85eb 100644 --- a/configs/compal_e99/src/ssd1783.c +++ b/configs/compal_e99/src/ssd1783.c @@ -75,15 +75,8 @@ #define LCD_XRES 98 #define LCD_YRES 67 -/* Debug ******************************************************************************/ +/* This should be put elsewhere */ -#ifdef CONFIG_DEBUG_LCD -# define lcderr(format, ...) info(format, ##__VA_ARGS__) -#else -# define lcderr(x...) -#endif - -/** This should be put elsewhere */ #ifdef __CC_ARM /* ARM Compiler */ #define lcd_inline static __inline #elif defined (__ICCARM__) /* for IAR Compiler */ diff --git a/configs/hymini-stm32v/src/stm32_r61505u.c b/configs/hymini-stm32v/src/stm32_r61505u.c index 40da4c42ec..cb787eae4a 100644 --- a/configs/hymini-stm32v/src/stm32_r61505u.c +++ b/configs/hymini-stm32v/src/stm32_r61505u.c @@ -91,18 +91,6 @@ #define LCD_ID 0x1505 -/* Debug ******************************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr err -# define lcdwarn warn -# define lcdinfo info -#else -# define lcderr(x...) -# define lcdwarn(x...) -# define lcdinfo(x...) -#endif - /* This should be put elsewhere (possibly include/nuttx/compiler.h) */ #ifdef __CC_ARM /* ARM Compiler */ diff --git a/configs/hymini-stm32v/src/stm32_ssd1289.c b/configs/hymini-stm32v/src/stm32_ssd1289.c index dc9c0b964c..d55964bb12 100644 --- a/configs/hymini-stm32v/src/stm32_ssd1289.c +++ b/configs/hymini-stm32v/src/stm32_ssd1289.c @@ -65,20 +65,6 @@ # error "CONFIG_STM32_FSMC is required to use the LCD" #endif -/* Define CONFIG_DEBUG_LCD to enable detailed LCD debug output. Verbose debug must - * also be enabled. - */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_GRAPHICS -# undef CONFIG_DEBUG_LCD -#endif - -#ifndef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_LCD -#endif - /* Color depth and format */ #define LCD_BPP 16 @@ -102,18 +88,6 @@ #define LCD_INDEX 0x60000000 /* RS = 0 */ #define LCD_DATA 0x60020000 /* RS = 1 */ -/* Debug ******************************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr err -# define lcdwarn warn -# define lcdinfo info -#else -# define lcderr(x...) -# define lcdwarn(x...) -# define lcdinfo(x...) -#endif - /************************************************************************************** * Private Function Prototypes **************************************************************************************/ diff --git a/configs/kwikstik-k40/src/k40_lcd.c b/configs/kwikstik-k40/src/k40_lcd.c index a1d9985531..9200e2333c 100644 --- a/configs/kwikstik-k40/src/k40_lcd.c +++ b/configs/kwikstik-k40/src/k40_lcd.c @@ -49,39 +49,6 @@ #include "up_arch.h" #include "kwikstik-k40.h" - -/************************************************************************************** - * Pre-processor Definitions - **************************************************************************************/ - -/* Configuration **********************************************************************/ - -/* Display/Color Properties ***********************************************************/ - -/* Debug ******************************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr(format, ...) info(format, ##__VA_ARGS__) -#else -# define lcderr(x...) -#endif - -/************************************************************************************** - * Private Type Definition - **************************************************************************************/ - -/************************************************************************************** - * Private Function Prototypes - **************************************************************************************/ - -/************************************************************************************** - * Private Data - **************************************************************************************/ - -/************************************************************************************** - * Private Functions - **************************************************************************************/ - /************************************************************************************** * Public Functions **************************************************************************************/ diff --git a/configs/lpcxpresso-lpc1768/src/lpc17_oled.c b/configs/lpcxpresso-lpc1768/src/lpc17_oled.c index 4f3717190d..b759aa7f0c 100644 --- a/configs/lpcxpresso-lpc1768/src/lpc17_oled.c +++ b/configs/lpcxpresso-lpc1768/src/lpc17_oled.c @@ -69,27 +69,11 @@ #endif /* Debug ********************************************************************/ -/* Define the CONFIG_DEBUG_LCD to enable detailed debug output (stuff you - * would never want to see unless you are debugging this file). - * - * Verbose debug must also be enabled - */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_GRAPHICS -#endif - -#ifndef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_LCD -#endif #ifdef CONFIG_DEBUG_LCD -# define ugerr(format, ...) info(format, ##__VA_ARGS__) # define oleddc_dumpgpio(m) lpc17_dumpgpio(LPCXPRESSO_OLED_POWER, m) # define oledcs_dumpgpio(m) lpc17_dumpgpio(LPCXPRESSO_OLED_CS, m) #else -# define ugerr(x...) # define oleddc_dumpgpio(m) # define oledcs_dumpgpio(m) #endif diff --git a/configs/maple/src/stm32_lcd.c b/configs/maple/src/stm32_lcd.c index 1df1a23709..64f506563b 100644 --- a/configs/maple/src/stm32_lcd.c +++ b/configs/maple/src/stm32_lcd.c @@ -67,28 +67,6 @@ #define EXTCOMIN_FREQ 24 #define TIMER_FREQ 1200 /* 72000000/60000 */ -/* Debug ********************************************************************/ - -/* Define CONFIG_DEBUG_LCD to enable detailed LCD debug output. Verbose debug must - * also be enabled. - */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_GRAPHICS -# undef CONFIG_DEBUG_LCD -#endif - -#ifndef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_LCD -#endif - -#ifdef CONFIG_DEBUG_LCD -# define lcderr(format, ...) info(format, ##__VA_ARGS__) -#else -# define lcderr(x...) -#endif - /**************************************************************************** * Private Data ****************************************************************************/ diff --git a/configs/mikroe-stm32f4/src/stm32_mio283qt2.c b/configs/mikroe-stm32f4/src/stm32_mio283qt2.c index f889efe80b..46ee2a54d6 100644 --- a/configs/mikroe-stm32f4/src/stm32_mio283qt2.c +++ b/configs/mikroe-stm32f4/src/stm32_mio283qt2.c @@ -67,21 +67,6 @@ /************************************************************************************** * Pre-processor Definitions **************************************************************************************/ -/* Configuration **********************************************************************/ - -/* Define CONFIG_DEBUG_LCD to enable detailed LCD debug output. Verbose debug must - * also be enabled. - */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_GRAPHICS -# undef CONFIG_DEBUG_LCD -#endif - -#ifndef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_LCD -#endif /* Mikroe-STM32F4 Hardware Definitions ************************************************/ /* --- ---------------------------------- -------------------- ------------------------ @@ -117,16 +102,6 @@ * 96 PB9 DRIVEB TFT display */ -/* Debug ******************************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr err -# define lcdinfo info -#else -# define lcderr(x...) -# define lcdinfo(x...) -#endif - /************************************************************************************** * Private Type Definition **************************************************************************************/ diff --git a/configs/mikroe-stm32f4/src/stm32_mio283qt9a.c b/configs/mikroe-stm32f4/src/stm32_mio283qt9a.c index ae2e8555a4..9ea31f5571 100644 --- a/configs/mikroe-stm32f4/src/stm32_mio283qt9a.c +++ b/configs/mikroe-stm32f4/src/stm32_mio283qt9a.c @@ -68,21 +68,6 @@ /************************************************************************************** * Pre-processor Definitions **************************************************************************************/ -/* Configuration **********************************************************************/ - -/* Define CONFIG_DEBUG_LCD to enable detailed LCD debug output. Verbose debug must - * also be enabled. - */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_GRAPHICS -# undef CONFIG_DEBUG_LCD -#endif - -#ifndef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_LCD -#endif /* Mikroe-STM32F4 Hardware Definitions ************************************************/ /* --- ---------------------------------- -------------------- ------------------------ @@ -118,16 +103,6 @@ * 96 PB9 DRIVEB TFT display */ -/* Debug ******************************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr err -# define lcdinfo info -#else -# define lcderr(x...) -# define lcdinfo(x...) -#endif - /************************************************************************************** * Private Type Definition **************************************************************************************/ diff --git a/configs/nucleo-f303re/src/stm32_ssd1351.c b/configs/nucleo-f303re/src/stm32_ssd1351.c index e006c03c06..01461fa06a 100644 --- a/configs/nucleo-f303re/src/stm32_ssd1351.c +++ b/configs/nucleo-f303re/src/stm32_ssd1351.c @@ -71,16 +71,6 @@ # error "The configuration requires the SPI 4-wire interface" #endif -/* Debug ********************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr(format, ...) err(format, ##__VA_ARGS__) -# define lcdinfo(format, ...) info(format, ##__VA_ARGS__) -#else -# define lcderr(x...) -# define lcdinfo(x...) -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/configs/olimex-lpc1766stk/src/lpc17_lcd.c b/configs/olimex-lpc1766stk/src/lpc17_lcd.c index acd8923677..d1bfc3481b 100644 --- a/configs/olimex-lpc1766stk/src/lpc17_lcd.c +++ b/configs/olimex-lpc1766stk/src/lpc17_lcd.c @@ -75,24 +75,15 @@ /* Define the CONFIG_LCD_NOKIADBG to enable detailed debug output (stuff you * would never want to see unless you are debugging this file). - * - * Verbose debug must also be enabled */ -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_GRAPHICS -#endif - #ifndef CONFIG_DEBUG_INFO # undef CONFIG_LCD_NOKIADBG #endif #ifdef CONFIG_LCD_NOKIADBG -# define lcderr(format, ...) info(format, ##__VA_ARGS__) # define lcd_dumpgpio(m) lpc17_dumpgpio(LPC1766STK_LCD_RST, m) #else -# define lcderr(x...) # define lcd_dumpgpio(m) #endif diff --git a/configs/pcblogic-pic32mx/src/pic32mx_lcd1602.c b/configs/pcblogic-pic32mx/src/pic32mx_lcd1602.c index f62dcb0545..4c4ca65951 100644 --- a/configs/pcblogic-pic32mx/src/pic32mx_lcd1602.c +++ b/configs/pcblogic-pic32mx/src/pic32mx_lcd1602.c @@ -102,20 +102,6 @@ # error "CONFIG_PIC32MX_PMP is required to use the LCD" #endif -/* Define CONFIG_DEBUG_LCD to enable detailed LCD debug output. Verbose debug must - * also be enabled. - */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_GRAPHICS -# undef CONFIG_DEBUG_LCD -#endif - -#ifndef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_LCD -#endif - /* The ever-present MIN/MAX macros ******************************************/ #ifndef MIN @@ -137,16 +123,6 @@ #define LCD_NCOLUMNS 16 #define LCD_NCHARS (LCD_NROWS * LCD_NCOLUMNS) -/* Debug ********************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr err -# define lcdinfo info -#else -# define lcderr(x...) -# define lcdinfo(x...) -#endif - /**************************************************************************** * Private Type Definition ****************************************************************************/ @@ -174,7 +150,7 @@ struct lcd1602_2 ****************************************************************************/ /* Debug */ -#if defined(CONFIG_DEBUG_LCD) && defined(CONFIG_DEBUG_INFO) +#ifdef CONFIG_DEBUG_LCD_INFO static void lcd_dumpstate(FAR const char *msg); static void lcd_dumpstream(FAR const char *msg, FAR const struct lcd_instream_s *stream); @@ -234,7 +210,7 @@ static struct lcd1602_2 g_lcd1602; * Name: lcd_dumpstate ****************************************************************************/ -#if defined(CONFIG_DEBUG_LCD) && defined(CONFIG_DEBUG_INFO) +#ifdef CONFIG_DEBUG_LCD_INFO static void lcd_dumpstate(FAR const char *msg) { uint8_t buffer[LCD_NCOLUMNS]; @@ -269,7 +245,7 @@ static void lcd_dumpstate(FAR const char *msg) * Name: lcd_dumpstate ****************************************************************************/ -#if defined(CONFIG_DEBUG_LCD) && defined(CONFIG_DEBUG_INFO) +#ifdef CONFIG_DEBUG_LCD_INFO static void lcd_dumpstream(FAR const char *msg, FAR const struct lcd_instream_s *stream) { diff --git a/configs/pic32mx7mmb/src/pic32_mio283qt2.c b/configs/pic32mx7mmb/src/pic32_mio283qt2.c index 972a2fbd67..16b1c7518a 100644 --- a/configs/pic32mx7mmb/src/pic32_mio283qt2.c +++ b/configs/pic32mx7mmb/src/pic32_mio283qt2.c @@ -69,20 +69,6 @@ # error "CONFIG_PIC32MX_PMP is required to use the LCD" #endif -/* Define CONFIG_DEBUG_LCD to enable detailed LCD debug output. Verbose debug must - * also be enabled. - */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_GRAPHICS -# undef CONFIG_DEBUG_LCD -#endif - -#ifndef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_LCD -#endif - /* PIC32MX7MMB LCD Hardware Definitions ***********************************************/ /* --- ---------------------------------- -------------------- ------------------------ * PIN CONFIGURATIONS SIGNAL NAME ON-BOARD CONNECTIONS @@ -136,16 +122,6 @@ #define GPIO_LCD_RS (GPIO_OUTPUT|GPIO_VALUE_ZERO|GPIO_PORTB|GPIO_PIN15) -/* Debug ******************************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr err -# define lcdinfo info -#else -# define lcderr(x...) -# define lcdinfo(x...) -#endif - #ifdef CONFIG_LCD_MIO283QT2 /************************************************************************************** diff --git a/configs/sam3u-ek/src/sam_lcd.c b/configs/sam3u-ek/src/sam_lcd.c index c9e11964c5..25aa1822ae 100644 --- a/configs/sam3u-ek/src/sam_lcd.c +++ b/configs/sam3u-ek/src/sam_lcd.c @@ -157,28 +157,6 @@ # error "CONFIG_LCD_MAXCONTRAST must be defined in the range 1 to 31" #endif -/* Debug ******************************************************************************/ - -#ifdef CONFIG_LCD_REGDEBUG -# define regerr(format, ...) err(format, ##__VA_ARGS__) -# define regwarn(format, ...) warn(format, ##__VA_ARGS__) -# define reginfo(format, ...) info(format, ##__VA_ARGS__) -#else -# define regerr(x...) -# define regwarn(x...) -# define reginfo(x...) -#endif - -#ifdef CONFIG_DEBUG_LCD -# define lcderr(format, ...) err(format, ##__VA_ARGS__) -# define lcdwarn(format, ...) warn(format, ##__VA_ARGS__) -# define lcdinfo(format, ...) info(format, ##__VA_ARGS__) -#else -# define lcderr(x...) -# define lcdwarn(x...) -# define lcdinfo(x...) -#endif - /* Graphics Capbilities ***************************************************************/ /* LCD resolution: 320 (columns) by 240 (rows). The physical dimensions of the device @@ -320,7 +298,7 @@ struct sam_dev_s /* Low-level HX834x Register access */ static void sam_putreg(uint16_t reg, uint16_t data); -#ifdef CONFIG_DEBUG_LCD +#ifdef CONFIG_DEBUG_LCD_INFO static uint16_t sam_getreg(uint16_t reg); #endif @@ -333,7 +311,7 @@ static inline uint16_t sam_rdram(void); static void sam_lcdon(void); static void sam_lcdoff(void); -#if 0 /* CONFIG_DEBUG_LCD */ +#if 0 /* CONFIG_DEBUG_LCD_INFO */ static void sam_dumpreg(uint8_t startreg, uint8_t endreg); #endif @@ -444,7 +422,8 @@ static struct sam_dev_s g_lcddev_s = static void sam_putreg(uint16_t reg, uint16_t data) { - reginfo("base: %08x RS: %04x data: %04x\n", LCD_BASE, LCD_BASE + HX843X_LCD_RS, data); + lcdinfo("base: %08x RS: %04x data: %04x\n", + LCD_BASE, LCD_BASE + HX843X_LCD_RS, data); putreg16(reg, LCD_BASE); putreg16(data, LCD_BASE + HX843X_LCD_RS); } @@ -457,13 +436,15 @@ static void sam_putreg(uint16_t reg, uint16_t data) * **************************************************************************************/ -#ifdef CONFIG_DEBUG_LCD +#ifdef CONFIG_DEBUG_LCD_INFO static uint16_t sam_getreg(uint16_t reg) { uint16_t data; + putreg16(reg, LCD_BASE); data = getreg16(LCD_BASE + HX843X_LCD_RS); - reginfo("base: %08x RS: %04x data: %04x\n", LCD_BASE, LCD_BASE + HX843X_LCD_RS, data); + lcdinfo("base: %08x RS: %04x data: %04x\n", + LCD_BASE, LCD_BASE + HX843X_LCD_RS, data); return data; } #endif @@ -583,7 +564,7 @@ static void sam_lcdoff(void) * **************************************************************************************/ -#if 0 /* CONFIG_DEBUG_LCD */ +#if 0 /* CONFIG_DEBUG_LCD_INFO */ static void sam_dumpreg(uint8_t startreg, uint8_t endreg) { uint16_t value; @@ -874,7 +855,7 @@ static int sam_setcontrast(struct lcd_dev_s *dev, unsigned int contrast) int board_lcd_initialize(void) { -#ifdef CONFIG_DEBUG_LCD +#ifdef CONFIG_DEBUG_LCD_INFO uint16_t hxregval; #endif uint32_t regval; @@ -918,7 +899,8 @@ int board_lcd_initialize(void) /* Enable SMC peripheral clock */ putreg32((1 << SAM_PID_SMC), SAM_PMC_PCER); - reginfo("PMC PCSR: %08x SMC: %08x\n", getreg32(SAM_PMC_PCSR), (1 << SAM_PID_SMC)); + lcdinfo("PMC PCSR: %08x SMC: %08x\n", + getreg32(SAM_PMC_PCSR), (1 << SAM_PID_SMC)); /* Configure SMC CS2 */ @@ -938,16 +920,16 @@ int board_lcd_initialize(void) regval |= (SMCCS_MODE_READMODE) | (SMCCS_MODE_WRITEMODE) | (SMCCS_MODE_DBW_16BITS); putreg32(regval, SAM_SMCCS_MODE(2)); - reginfo("SMC SETUP[%08x]: %08x PULSE[%08x]: %08x\n", + lcdinfo("SMC SETUP[%08x]: %08x PULSE[%08x]: %08x\n", SAM_SMCCS_SETUP(2), getreg32(SAM_SMCCS_SETUP(2)), SAM_SMCCS_PULSE(2), getreg32(SAM_SMCCS_PULSE(2))); - reginfo(" CYCLE[%08x]: %08x MODE[%08x]: %08x\n", + lcdinfo(" CYCLE[%08x]: %08x MODE[%08x]: %08x\n", SAM_SMCCS_CYCLE(2), getreg32(SAM_SMCCS_CYCLE(2)), SAM_SMCCS_MODE(2), getreg32(SAM_SMCCS_MODE(2))); +#ifdef CONFIG_DEBUG_LCD_INFO /* Check HX8347 Chip ID */ -#ifdef CONFIG_DEBUG_LCD hxregval = sam_getreg(HX8347_R67H); lcdinfo("Chip ID: %04x\n", hxregval); if (hxregval != HX8347_CHIPID) diff --git a/configs/sam4e-ek/src/sam_ili9325.c b/configs/sam4e-ek/src/sam_ili9325.c index ab0bf49c59..19c00ebd2d 100644 --- a/configs/sam4e-ek/src/sam_ili9325.c +++ b/configs/sam4e-ek/src/sam_ili9325.c @@ -197,21 +197,6 @@ # define CONFIG_SAM4EEK_LCD_BGCOLOR 0 #endif -/* Define CONFIG_DEBUG_LCD to enable detailed LCD debug output. Verbose debug must - * also be enabled. - */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_GRAPHICS -# undef CONFIG_DEBUG_LCD -# undef CONFIG_LCD_REGDEBUG -#endif - -#ifndef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_LCD -#endif - /* Display/Color Properties ***********************************************************/ /* Display Resolution */ @@ -266,16 +251,6 @@ #define BKL_ENABLE_DURATION (128*1024) #define BKL_DISABLE_DURATION (128*1024) -/* Debug ******************************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr err -# define lcdinfo info -#else -# define lcderr(x...) -# define lcdinfo(x...) -#endif - /************************************************************************************ * Private Type Definition ************************************************************************************/ diff --git a/configs/sam4e-ek/src/sam_ili9341.c b/configs/sam4e-ek/src/sam_ili9341.c index d6164b9e77..8b68912389 100644 --- a/configs/sam4e-ek/src/sam_ili9341.c +++ b/configs/sam4e-ek/src/sam_ili9341.c @@ -198,21 +198,6 @@ # define CONFIG_SAM4EEK_LCD_BGCOLOR 0 #endif -/* Define CONFIG_DEBUG_LCD to enable detailed LCD debug output. Verbose debug must - * also be enabled. - */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_GRAPHICS -# undef CONFIG_DEBUG_LCD -# undef CONFIG_LCD_REGDEBUG -#endif - -#ifndef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_LCD -#endif - /* Display/Color Properties ***********************************************************/ /* Display Resolution */ @@ -269,16 +254,6 @@ #define BKL_ENABLE_DURATION (128*1024) #define BKL_DISABLE_DURATION (128*1024) -/* Debug ******************************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr err -# define lcdinfo info -#else -# define lcderr(x...) -# define lcdinfo(x...) -#endif - /************************************************************************************ * Private Type Definition ************************************************************************************/ diff --git a/configs/sam4l-xplained/src/sam_slcd.c b/configs/sam4l-xplained/src/sam_slcd.c index 391673d521..28b86101c5 100644 --- a/configs/sam4l-xplained/src/sam_slcd.c +++ b/configs/sam4l-xplained/src/sam_slcd.c @@ -72,10 +72,6 @@ ****************************************************************************/ /* Configuration ************************************************************/ -/* Define CONFIG_DEBUG_LCD to enable detailed LCD debug output. Verbose debug - * must also be enabled. - */ - #ifndef CONFIG_LIB_SLCDCODEC # error This SLCD driver requires CONFIG_LIB_SLCDCODEC #endif @@ -85,16 +81,6 @@ # error CONFIG_SAM34_RC32K be selected in the board configuration #endif -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_GRAPHICS -# undef CONFIG_DEBUG_LCD -#endif - -#ifndef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_LCD -#endif - /* The ever-present MIN/MAX macros ******************************************/ #ifndef MIN @@ -248,16 +234,6 @@ #define SLCD_PM (&g_einfo[6]) #define SLCD_AM (&g_einfo[7]) -/* Debug ********************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr err -# define lcdinfo info -#else -# define lcderr(x...) -# define lcdinfo(x...) -#endif - /**************************************************************************** * Private Type Definition ****************************************************************************/ @@ -294,7 +270,7 @@ struct slcd_pixel_s ****************************************************************************/ /* Debug */ -#if defined(CONFIG_DEBUG_LCD) && defined(CONFIG_DEBUG_INFO) +#ifdef CONFIG_DEBUG_LCD_INFO static void slcd_dumpstate(FAR const char *msg); static void slcd_dumpslcd(FAR const char *msg); #else @@ -405,7 +381,7 @@ static const struct slcd_pixel_s g_einfo[SLCD_NE] = * Name: slcd_dumpstate ****************************************************************************/ -#if defined(CONFIG_DEBUG_LCD) && defined(CONFIG_DEBUG_INFO) +#ifdef CONFIG_DEBUG_LCD_INFO static void slcd_dumpstate(FAR const char *msg) { lcdinfo("%s:\n", msg); @@ -424,7 +400,7 @@ static void slcd_dumpstate(FAR const char *msg) * Name: slcd_dumpslcd ****************************************************************************/ -#if defined(CONFIG_DEBUG_LCD) && defined(CONFIG_DEBUG_INFO) +#ifdef CONFIG_DEBUG_LCD_INFO static void slcd_dumpslcd(FAR const char *msg) { lcdinfo("%s:\n", msg); diff --git a/configs/sam4l-xplained/src/sam_ug2832hsweg04.c b/configs/sam4l-xplained/src/sam_ug2832hsweg04.c index e2de87e24a..a99aacc987 100644 --- a/configs/sam4l-xplained/src/sam_ug2832hsweg04.c +++ b/configs/sam4l-xplained/src/sam_ug2832hsweg04.c @@ -114,16 +114,6 @@ # error "The OLED driver requires CONFIG_SPI_CMDDATA in the configuration" #endif -/* Debug ********************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr(format, ...) err(format, ##__VA_ARGS__) -# define lcdinfo(format, ...) info(format, ##__VA_ARGS__) -#else -# define lcderr(x...) -# define lcdinfo(x...) -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/configs/samd20-xplained/src/sam_ug2832hsweg04.c b/configs/samd20-xplained/src/sam_ug2832hsweg04.c index 2728353e9f..33755c18ad 100644 --- a/configs/samd20-xplained/src/sam_ug2832hsweg04.c +++ b/configs/samd20-xplained/src/sam_ug2832hsweg04.c @@ -144,16 +144,6 @@ # error "The OLED driver requires CONFIG_SPI_CMDDATA in the configuration" #endif -/* Debug ********************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr(format, ...) err(format, ##__VA_ARGS__) -# define lcdinfo(format, ...) info(format, ##__VA_ARGS__) -#else -# define lcderr(x...) -# define lcdinfo(x...) -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/configs/samd21-xplained/src/sam_ug2832hsweg04.c b/configs/samd21-xplained/src/sam_ug2832hsweg04.c index 35999d286d..3414df2c28 100644 --- a/configs/samd21-xplained/src/sam_ug2832hsweg04.c +++ b/configs/samd21-xplained/src/sam_ug2832hsweg04.c @@ -144,16 +144,6 @@ # error "The OLED driver requires CONFIG_SPI_CMDDATA in the configuration" #endif -/* Debug ********************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr(format, ...) err(format, ##__VA_ARGS__) -# define lcdinfo(format, ...) info(format, ##__VA_ARGS__) -#else -# define lcderr(x...) -# define lcdinfo(x...) -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/configs/saml21-xplained/src/sam_ug2832hsweg04.c b/configs/saml21-xplained/src/sam_ug2832hsweg04.c index bee4cc4f3a..0cbdb6f795 100644 --- a/configs/saml21-xplained/src/sam_ug2832hsweg04.c +++ b/configs/saml21-xplained/src/sam_ug2832hsweg04.c @@ -144,16 +144,6 @@ # error "The OLED driver requires CONFIG_SPI_CMDDATA in the configuration" #endif -/* Debug ********************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr(format, ...) err(format, ##__VA_ARGS__) -# define lcdinfo(format, ...) info(format, ##__VA_ARGS__) -#else -# define lcderr(x...) -# define lcdinfo(x...) -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/configs/samv71-xult/src/sam_ili9488.c b/configs/samv71-xult/src/sam_ili9488.c index 21f939f644..313dcac419 100644 --- a/configs/samv71-xult/src/sam_ili9488.c +++ b/configs/samv71-xult/src/sam_ili9488.c @@ -203,21 +203,6 @@ # define CONFIG_SAMV71XULT_LCD_BGCOLOR 0 #endif -/* Define CONFIG_DEBUG_LCD to enable detailed LCD debug output. Verbose debug must - * also be enabled. - */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_GRAPHICS -# undef CONFIG_DEBUG_LCD -# undef CONFIG_LCD_REGDEBUG -#endif - -#ifndef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_LCD -#endif - /* Display/Color Properties **************************************************/ /* Display Resolution */ @@ -300,14 +285,6 @@ /* Debug *********************************************************************/ -#ifdef CONFIG_DEBUG_LCD -# define lcderr err -# define lcdinfo info -#else -# define lcderr(x...) -# define lcdinfo(x...) -#endif - #ifdef CONFIG_DEBUG_DMA # define SAMPLENDX_BEFORE_SETUP 0 # define SAMPLENDX_AFTER_SETUP 1 diff --git a/configs/shenzhou/src/stm32_ili93xx.c b/configs/shenzhou/src/stm32_ili93xx.c index 6b43340ad5..84646484fa 100644 --- a/configs/shenzhou/src/stm32_ili93xx.c +++ b/configs/shenzhou/src/stm32_ili93xx.c @@ -202,21 +202,6 @@ #undef CONFIG_LCD_FASTCONFIG #define CONFIG_LCD_FASTCONFIG 1 -/* Define CONFIG_DEBUG_LCD to enable detailed LCD debug output. Verbose debug must - * also be enabled. - */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_GRAPHICS -# undef CONFIG_DEBUG_LCD -# undef CONFIG_LCD_REGDEBUG -#endif - -#ifndef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_LCD -#endif - /* Display/Color Properties ***********************************************************/ /* Display Resolution */ @@ -368,16 +353,6 @@ #define ILI9331_ID 0x9331 #define ILI9919_ID 0x9919 -/* Debug ******************************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr err -# define lcdinfo info -#else -# define lcderr(x...) -# define lcdinfo(x...) -#endif - /************************************************************************************ * Private Type Definition ************************************************************************************/ diff --git a/configs/shenzhou/src/stm32_ssd1289.c b/configs/shenzhou/src/stm32_ssd1289.c index f602f7e9d0..65b7f70e20 100644 --- a/configs/shenzhou/src/stm32_ssd1289.c +++ b/configs/shenzhou/src/stm32_ssd1289.c @@ -67,35 +67,10 @@ * Pre-processor Definitions ************************************************************************************/ /* Configuration ********************************************************************/ -/* Define CONFIG_DEBUG_LCD to enable detailed LCD debug output. Verbose debug must - * also be enabled. - */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_GRAPHICS -# undef CONFIG_DEBUG_LCD -# undef CONFIG_LCD_REGDEBUG -#endif - -#ifndef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_LCD -#endif #undef CONFIG_LCD_FASTCONFIG #define CONFIG_LCD_FASTCONFIG 1 -/* Shenzhou LCD Hardware Definitions ************************************************/ -/* Debug ****************************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr err -# define lcdinfo info -#else -# define lcderr(x...) -# define lcdinfo(x...) -#endif - /************************************************************************************ * Private Type Definition ************************************************************************************/ diff --git a/configs/stm3210e-eval/src/stm32_lcd.c b/configs/stm3210e-eval/src/stm32_lcd.c index f4893cb512..cc4f25d6b7 100644 --- a/configs/stm3210e-eval/src/stm32_lcd.c +++ b/configs/stm3210e-eval/src/stm32_lcd.c @@ -159,20 +159,6 @@ #define SPFD5408B_RDSHIFT 5 -/* Define CONFIG_DEBUG_LCD to enable detailed LCD debug output. Verbose debug must - * also be enabled. - */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_GRAPHICS -# undef CONFIG_DEBUG_LCD -#endif - -#ifndef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_LCD -#endif - /* Display/Color Properties ***********************************************************/ /* Display Resolution */ @@ -311,18 +297,6 @@ #define SPFD5408B_ID 0x5408 #define R61580_ID 0x1580 -/* Debug ******************************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr(format, ...) err(format, ##__VA_ARGS__) -# define lcdwarn(format, ...) warn(format, ##__VA_ARGS__) -# define lcdinfo(format, ...) info(format, ##__VA_ARGS__) -#else -# define lcderr(x...) -# define lcdwarn(x...) -# define lcdinfo(x...) -#endif - /************************************************************************************** * Private Type Definition **************************************************************************************/ diff --git a/configs/stm3220g-eval/src/stm32_lcd.c b/configs/stm3220g-eval/src/stm32_lcd.c index 704433da76..f2002c1371 100644 --- a/configs/stm3220g-eval/src/stm32_lcd.c +++ b/configs/stm3220g-eval/src/stm32_lcd.c @@ -110,20 +110,6 @@ # define CONFIG_LCD_LANDSCAPE 1 #endif -/* Define CONFIG_DEBUG_LCD to enable detailed LCD debug output. Verbose debug must - * also be enabled. - */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_GRAPHICS -# undef CONFIG_DEBUG_LCD -#endif - -#ifndef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_LCD -#endif - /* Display/Color Properties ***********************************************************/ /* Display Resolution */ @@ -263,18 +249,6 @@ #define ILI9321_ID 0x9321 #define ILI9325_ID 0x9325 -/* Debug ******************************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr err -# define lcdwarn warn -# define lcdinfo info -#else -# define lcderr(x...) -# define lcdwarn(x...) -# define lcdinfo(x...) -#endif - /************************************************************************************** * Private Type Definition **************************************************************************************/ diff --git a/configs/stm3240g-eval/src/stm32_lcd.c b/configs/stm3240g-eval/src/stm32_lcd.c index 71c06380c9..1db5638706 100644 --- a/configs/stm3240g-eval/src/stm32_lcd.c +++ b/configs/stm3240g-eval/src/stm32_lcd.c @@ -110,20 +110,6 @@ # define CONFIG_LCD_LANDSCAPE 1 #endif -/* Define CONFIG_DEBUG_LCD to enable detailed LCD debug output. Verbose debug must - * also be enabled. - */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_GRAPHICS -# undef CONFIG_DEBUG_LCD -#endif - -#ifndef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_LCD -#endif - /* Display/Color Properties ***********************************************************/ /* Display Resolution */ @@ -263,18 +249,6 @@ #define ILI9321_ID 0x9321 #define ILI9325_ID 0x9325 -/* Debug ******************************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr err -# define lcdwarn warn -# define lcdinfo info -#else -# define lcderr(x...) -# define lcdwarn(x...) -# define lcdinfo(x...) -#endif - /************************************************************************************** * Private Type Definition **************************************************************************************/ diff --git a/configs/stm32f429i-disco/src/stm32_ili93414ws.c b/configs/stm32f429i-disco/src/stm32_ili93414ws.c index 150d5f95de..04a24411f6 100644 --- a/configs/stm32f429i-disco/src/stm32_ili93414ws.c +++ b/configs/stm32f429i-disco/src/stm32_ili93414ws.c @@ -132,18 +132,6 @@ # define ILI93414WS_SPI #endif -/* Debug option */ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr err -# define lcdwarn warn -# define lcdinfo info -#else -# define lcderr(x...) -# define lcdwarn(x...) -# define lcdinfo(x...) -#endif - /**************************************************************************** * Private Type Definition ****************************************************************************/ diff --git a/configs/stm32f429i-disco/src/stm32_lcd.c b/configs/stm32f429i-disco/src/stm32_lcd.c index f674bfdebd..7aa094e57a 100644 --- a/configs/stm32f429i-disco/src/stm32_lcd.c +++ b/configs/stm32f429i-disco/src/stm32_lcd.c @@ -280,18 +280,6 @@ #define ILI9341_YRES BOARD_LTDC_HEIGHT #endif /* CONFIG_STM32F429I_DISCO_ILI9341_FBIFACE */ -/* Debug */ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr err -# define lcdwarn warn -# define lcdinfo info -#else -# define lcderr(x...) -# define lcdwarn(x...) -# define lcdinfo(x...) -#endif - /************************************************************************************ * Private Data ************************************************************************************/ @@ -333,7 +321,7 @@ static int stm32_ili9341_initialize(void) lcdinfo("Initialize ili9341 lcd driver\n"); lcd->select(lcd); -#ifdef CONFIG_DEBUG_LCD +#ifdef CONFIG_DEBUG_LCD_INFO /* Read display identification */ lcd->sendcmd(lcd, ILI9341_READ_ID1); diff --git a/configs/stm32f4discovery/src/stm32_rgbled.c b/configs/stm32f4discovery/src/stm32_rgbled.c index 614fb9b57e..39bec28aad 100644 --- a/configs/stm32f4discovery/src/stm32_rgbled.c +++ b/configs/stm32f4discovery/src/stm32_rgbled.c @@ -86,14 +86,14 @@ # undef HAVE_RGBLED #endif -#ifdef CONFIG_DEBUG_LCD -# define lcderr llerr -# define lcdwarn llwarn -# define lcdinfo llinfo +#ifdef CONFIG_DEBUG_LEDS +# define lederr llerr +# define ledwarn llwarn +# define ledinfo llinfo #else -# define lcderr(x...) -# define lcdwarn(x...) -# define lcdinfo(x...) +# define lederr(x...) +# define ledwarn(x...) +# define ledinfo(x...) #endif #ifdef HAVE_RGBLED @@ -129,7 +129,7 @@ int stm32_rgbled_setup(void) ledr = stm32_pwminitialize(1); if (!ledr) { - lcderr("ERROR: Failed to get the STM32 PWM lower half to LEDR\n"); + lederr("ERROR: Failed to get the STM32 PWM lower half to LEDR\n"); return -ENODEV; } @@ -148,7 +148,7 @@ int stm32_rgbled_setup(void) ledg = stm32_pwminitialize(2); if (!ledg) { - lcderr("ERROR: Failed to get the STM32 PWM lower half to LEDG\n"); + lederr("ERROR: Failed to get the STM32 PWM lower half to LEDG\n"); return -ENODEV; } @@ -162,7 +162,7 @@ int stm32_rgbled_setup(void) ledb = stm32_pwminitialize(3); if (!ledb) { - lcderr("ERROR: Failed to get the STM32 PWM lower half to LEDB\n"); + lederr("ERROR: Failed to get the STM32 PWM lower half to LEDB\n"); return -ENODEV; } @@ -176,7 +176,7 @@ int stm32_rgbled_setup(void) ret = rgbled_register("/dev/rgbled0", ledr, ledg, ledb); if (ret < 0) { - lcderr("ERROR: rgbled_register failed: %d\n", ret); + lederr("ERROR: rgbled_register failed: %d\n", ret); return ret; } diff --git a/configs/stm32f4discovery/src/stm32_ssd1289.c b/configs/stm32f4discovery/src/stm32_ssd1289.c index 7f0b1dd5ad..488316763c 100644 --- a/configs/stm32f4discovery/src/stm32_ssd1289.c +++ b/configs/stm32f4discovery/src/stm32_ssd1289.c @@ -72,20 +72,6 @@ # error "CONFIG_STM32_FSMC is required to use the LCD" #endif -/* Define CONFIG_DEBUG_LCD to enable detailed LCD debug output. Verbose debug must - * also be enabled. - */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_GRAPHICS -# undef CONFIG_DEBUG_LCD -#endif - -#ifndef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_LCD -#endif - /* STM32F4Discovery LCD Hardware Definitions ******************************************/ /* LCD /CS is CE1 == NOR/SRAM Bank 1 * @@ -107,23 +93,10 @@ #define LCD_NADDRLINES 1 /* A16 */ #define LCD_NDATALINES 16 /* D0-15 */ -/* Debug ******************************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr err -# define lcdinfo info -#else -# define lcderr(x...) -# define lcdinfo(x...) -#endif - -/************************************************************************************** - * Private Type Definition - **************************************************************************************/ - /************************************************************************************** * Private Function Protototypes **************************************************************************************/ + /* Low Level LCD access */ static void stm32_select(FAR struct ssd1289_lcd_s *dev); diff --git a/configs/stm32f4discovery/src/stm32_ssd1351.c b/configs/stm32f4discovery/src/stm32_ssd1351.c index c7996ff08b..7df8510a35 100644 --- a/configs/stm32f4discovery/src/stm32_ssd1351.c +++ b/configs/stm32f4discovery/src/stm32_ssd1351.c @@ -71,18 +71,6 @@ # error "The configuration requires the SPI 4-wire interface" #endif -/* Debug ********************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr(format, ...) err(format, ##__VA_ARGS__) -# define lcdwarn(format, ...) warn(format, ##__VA_ARGS__) -# define lcdinfo(format, ...) info(format, ##__VA_ARGS__) -#else -# define lcderr(x...) -# define lcdwarn(x...) -# define lcdinfo(x...) -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/configs/stm32f4discovery/src/stm32_ug2864ambag01.c b/configs/stm32f4discovery/src/stm32_ug2864ambag01.c index 8395d3830c..c67a570388 100644 --- a/configs/stm32f4discovery/src/stm32_ug2864ambag01.c +++ b/configs/stm32f4discovery/src/stm32_ug2864ambag01.c @@ -93,18 +93,6 @@ /* Definitions in stm32f4discovery.h */ -/* Debug ********************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr(format, ...) err(format, ##__VA_ARGS__) -# define lcdwarn(format, ...) warn(format, ##__VA_ARGS__) -# define lcdinfo(format, ...) info(format, ##__VA_ARGS__) -#else -# define lcderr(x...) -# define lcdwarn(x...) -# define lcdinfo(x...) -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/configs/stm32f4discovery/src/stm32_ug2864hsweg01.c b/configs/stm32f4discovery/src/stm32_ug2864hsweg01.c index b2711d89d0..3723f3ecbc 100644 --- a/configs/stm32f4discovery/src/stm32_ug2864hsweg01.c +++ b/configs/stm32f4discovery/src/stm32_ug2864hsweg01.c @@ -93,18 +93,6 @@ /* Definitions in stm32f4discovery.h */ -/* Debug ********************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr(format, ...) err(format, ##__VA_ARGS__) -# define lcdwarn(format, ...) warn(format, ##__VA_ARGS__) -# define lcdinfo(format, ...) info(format, ##__VA_ARGS__) -#else -# define lcderr(x...) -# define lcdwarn(x...) -# define lcdinfo(x...) -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/configs/stm32ldiscovery/src/stm32_lcd.c b/configs/stm32ldiscovery/src/stm32_lcd.c index 24cee12b23..1f4a843c87 100644 --- a/configs/stm32ldiscovery/src/stm32_lcd.c +++ b/configs/stm32ldiscovery/src/stm32_lcd.c @@ -76,24 +76,12 @@ ****************************************************************************/ /* Configuration ************************************************************/ -/* Define CONFIG_DEBUG_LCD to enable detailed LCD debug output. Verbose debug - * must also be enabled. - */ +/* Define CONFIG_DEBUG_LCD_INFO to enable detailed LCD debug output. */ #ifndef CONFIG_LIB_SLCDCODEC # error "This SLCD driver requires CONFIG_LIB_SLCDCODEC" #endif -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_GRAPHICS -# undef CONFIG_DEBUG_LCD -#endif - -#ifndef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_LCD -#endif - /* The ever-present MIN/MAX macros ******************************************/ #ifndef MIN @@ -259,16 +247,6 @@ (((uint32_t)(s) & 0x03) << 14) #define SLCD_CHAR6_UPDATE3(s) SLCD_CHAR6_UPDATE2(s) -/* Debug ********************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr err -# define lcdinfo info -#else -# define lcderr(x...) -# define lcdinfo(x...) -#endif - /**************************************************************************** * Private Type Definition ****************************************************************************/ @@ -298,7 +276,7 @@ struct stm32_slcdstate_s ****************************************************************************/ /* Debug */ -#if defined(CONFIG_DEBUG_LCD) && defined(CONFIG_DEBUG_INFO) +#ifdef CONFIG_DEBUG_LCD_INFO static void slcd_dumpstate(FAR const char *msg); static void slcd_dumpslcd(FAR const char *msg); #else @@ -440,7 +418,7 @@ static uint32_t g_slcdgpio[BOARD_SLCD_NGPIOS] = * Name: slcd_dumpstate ****************************************************************************/ -#if defined(CONFIG_DEBUG_LCD) && defined(CONFIG_DEBUG_INFO) +#ifdef CONFIG_DEBUG_LCD_INFO static void slcd_dumpstate(FAR const char *msg) { lcdinfo("%s:\n", msg); @@ -461,7 +439,7 @@ static void slcd_dumpstate(FAR const char *msg) * Name: slcd_dumpslcd ****************************************************************************/ -#if defined(CONFIG_DEBUG_LCD) && defined(CONFIG_DEBUG_INFO) +#ifdef CONFIG_DEBUG_LCD_INFO static void slcd_dumpslcd(FAR const char *msg) { lcdinfo("%s:\n", msg); diff --git a/configs/sure-pic32mx/src/pic32mx_lcd1602.c b/configs/sure-pic32mx/src/pic32mx_lcd1602.c index 39488c66f7..53663f11e0 100644 --- a/configs/sure-pic32mx/src/pic32mx_lcd1602.c +++ b/configs/sure-pic32mx/src/pic32mx_lcd1602.c @@ -109,20 +109,6 @@ # define CONFIG_LCD_MAXPOWER 100 #endif -/* Define CONFIG_DEBUG_LCD to enable detailed LCD debug output. Verbose debug must - * also be enabled. - */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_GRAPHICS -# undef CONFIG_DEBUG_LCD -#endif - -#ifndef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_LCD -#endif - /* The ever-present MIN/MAX macros ******************************************/ #ifndef MIN @@ -141,16 +127,6 @@ #define NOP __asm__ __volatile__ ("nop"); -/* Debug ********************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr err -# define lcdinfo info -#else -# define lcderr(x...) -# define lcdinfo(x...) -#endif - /**************************************************************************** * Private Type Definition ****************************************************************************/ @@ -179,7 +155,7 @@ struct lcd1602_2 ****************************************************************************/ /* Debug */ -#if defined(CONFIG_DEBUG_LCD) && defined(CONFIG_DEBUG_INFO) +#ifdef CONFIG_DEBUG_LCD_INFO static void lcd_dumpstate(FAR const char *msg); static void lcd_dumpstream(FAR const char *msg, FAR const struct lcd_instream_s *stream); @@ -243,7 +219,7 @@ static struct lcd1602_2 g_lcd1602; * Name: lcd_dumpstate ****************************************************************************/ -#if defined(CONFIG_DEBUG_LCD) && defined(CONFIG_DEBUG_INFO) +#ifdef CONFIG_DEBUG_LCD_INFO static void lcd_dumpstate(FAR const char *msg) { uint8_t buffer[LCD_NCOLUMNS]; @@ -278,7 +254,7 @@ static void lcd_dumpstate(FAR const char *msg) * Name: lcd_dumpstate ****************************************************************************/ -#if defined(CONFIG_DEBUG_LCD) && defined(CONFIG_DEBUG_INFO) +#ifdef CONFIG_DEBUG_LCD_INFO static void lcd_dumpstream(FAR const char *msg, FAR const struct lcd_instream_s *stream) { diff --git a/configs/viewtool-stm32f107/src/stm32_ssd1289.c b/configs/viewtool-stm32f107/src/stm32_ssd1289.c index a19b0a5695..de4d3a57a8 100644 --- a/configs/viewtool-stm32f107/src/stm32_ssd1289.c +++ b/configs/viewtool-stm32f107/src/stm32_ssd1289.c @@ -64,20 +64,6 @@ # error "CONFIG_STM32_FSMC is required to use the LCD" #endif -/* Define CONFIG_DEBUG_LCD to enable detailed LCD debug output. Verbose debug must - * also be enabled. - */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_GRAPHICS -# undef CONFIG_DEBUG_LCD -#endif - -#ifndef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_LCD -#endif - /* Color depth and format */ #define LCD_BPP 16 @@ -101,22 +87,6 @@ #define LCD_INDEX 0x60000000 /* RS = 0 */ #define LCD_DATA 0x60020000 /* RS = 1 */ -/* Debug ******************************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr err -# define lcdwarn warn -# define lcdinfo info -#else -# define lcderr(x...) -# define lcdwarn(x...) -# define lcdinfo(x...) -#endif - -/************************************************************************************** - * Private Type Definition - **************************************************************************************/ - /************************************************************************************** * Private Function Prototypes **************************************************************************************/ diff --git a/configs/zp214xpa/src/lpc2148_ug2864ambag01.c b/configs/zp214xpa/src/lpc2148_ug2864ambag01.c index e2e221a925..ca43d45553 100644 --- a/configs/zp214xpa/src/lpc2148_ug2864ambag01.c +++ b/configs/zp214xpa/src/lpc2148_ug2864ambag01.c @@ -97,18 +97,6 @@ # define RESET_DIR_REGISTER (LPC214X_GPIO0_BASE+LPC214X_GPIO_DIR_OFFSET) #endif -/* Debug ********************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr(format, ...) err(format, ##__VA_ARGS__) -# define lcdwarn(format, ...) warn(format, ##__VA_ARGS__) -# define lcdinfo(format, ...) info(format, ##__VA_ARGS__) -#else -# define lcderr(x...) -# define lcdwarm(x...) -# define lcdinfo(x...) -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/drivers/lcd/ili9341.c b/drivers/lcd/ili9341.c index a920a12f0a..c281ab86c3 100644 --- a/drivers/lcd/ili9341.c +++ b/drivers/lcd/ili9341.c @@ -365,20 +365,6 @@ # endif #endif -/* Add next LCD display */ - -/* Debug option */ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr err -# define lcdinfo warn -# define lcdinfo info -#else -# define lcderr(x...) -# define lcdwarn(x...) -# define lcdinfo(x...) -#endif - /**************************************************************************** * Private Type Definition ****************************************************************************/ @@ -767,7 +753,7 @@ static int ili9341_getrun(int devno, fb_coord_t row, fb_coord_t col, static int ili9341_hwinitialize(FAR struct ili9341_dev_s *dev) { -#ifdef CONFIG_DEBUG_LCD +#ifdef CONFIG_DEBUG_LCD_INFO uint8_t param; #endif FAR struct ili9341_lcd_s *lcd = dev->lcd; @@ -777,15 +763,17 @@ static int ili9341_hwinitialize(FAR struct ili9341_dev_s *dev) lcdinfo("Initialize lcd driver\n"); lcd->select(lcd); -#ifdef CONFIG_DEBUG_LCD +#ifdef CONFIG_DEBUG_LCD_INFO /* Read display identification */ lcd->sendcmd(lcd, ILI9341_READ_ID1); lcd->recvparam(lcd, ¶m); lcdinfo("ili9341 LCD driver: LCD modules manufacturer ID: %d\n", param); + lcd->sendcmd(lcd, ILI9341_READ_ID2); lcd->recvparam(lcd, ¶m); lcdinfo("ili9341 LCD driver: LCD modules driver version ID: %d\n", param); + lcd->sendcmd(lcd, ILI9341_READ_ID3); lcd->recvparam(lcd, ¶m); lcdinfo("ili9341 LCD driver: LCD modules driver ID: %d\n", param); diff --git a/drivers/lcd/memlcd.c b/drivers/lcd/memlcd.c index b9e31ed75c..59976b7a52 100644 --- a/drivers/lcd/memlcd.c +++ b/drivers/lcd/memlcd.c @@ -109,18 +109,6 @@ #define LS_BIT (1 << 0) #define MS_BIT (1 << 7) -/* Debug */ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr(format, ...) err(format, ##__VA_ARGS__) -# define lcdwarn(format, ...) warn(format, ##__VA_ARGS__) -# define lcdinfo(format, ...) info(format, ##__VA_ARGS__) -#else -# define lcderr(x...) -# define lcdwarn(x...) -# define lcdinfo(x...) -#endif - /**************************************************************************** * Private Type Definition ****************************************************************************/ diff --git a/drivers/lcd/mio283qt2.c b/drivers/lcd/mio283qt2.c index 96f97b6109..047716614c 100644 --- a/drivers/lcd/mio283qt2.c +++ b/drivers/lcd/mio283qt2.c @@ -102,20 +102,6 @@ # define CONFIG_LCD_LANDSCAPE 1 #endif -/* Define CONFIG_DEBUG_LCD to enable detailed LCD debug output. Verbose debug must - * also be enabled. - */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_GRAPHICS -# undef CONFIG_DEBUG_LCD -#endif - -#ifndef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_LCD -#endif - /* Display/Color Properties ***********************************************************/ /* Display Resolution */ @@ -237,18 +223,6 @@ #endif -/* Debug ******************************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr err -# define lcdwarn warn -# define lcdinfo info -#else -# define lcderr(x...) -# define lcdwarn(x...) -# define lcdinfo(x...) -#endif - /************************************************************************************** * Private Type Definition **************************************************************************************/ diff --git a/drivers/lcd/mio283qt9a.c b/drivers/lcd/mio283qt9a.c index 9b50bc183d..7228b23c4d 100644 --- a/drivers/lcd/mio283qt9a.c +++ b/drivers/lcd/mio283qt9a.c @@ -96,20 +96,6 @@ # define CONFIG_LCD_LANDSCAPE 1 #endif -/* Define CONFIG_DEBUG_LCD to enable detailed LCD debug output. Verbose debug must - * also be enabled. - */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_GRAPHICS -# undef CONFIG_DEBUG_LCD -#endif - -#ifndef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_LCD -#endif - /* Display/Color Properties ***********************************************************/ /* Display Resolution */ @@ -136,18 +122,6 @@ #define ILI9341_ID_1 0x93 #define ILI9341_ID_2 0x41 -/* Debug ******************************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr err -# define lcdwarn warn -# define lcdinfo info -#else -# define lcderr(x...) -# define lcdwarn(x...) -# define lcdinfo(x...) -#endif - /************************************************************************************** * Private Type Definition **************************************************************************************/ diff --git a/drivers/lcd/nokia6100.c b/drivers/lcd/nokia6100.c index eafcb10fd8..3b4a05383d 100644 --- a/drivers/lcd/nokia6100.c +++ b/drivers/lcd/nokia6100.c @@ -305,18 +305,6 @@ #define NOKIA_ENDPAGE 131 #define NOKIA_ENDCOL 131 -/* Debug ******************************************************************************/ - -#ifdef CONFIG_LCD_REGDEBUG -# define lcderr(format, ...) llerr(format, ##__VA_ARGS__) -# define lcdwarn(format, ...) llwarn(format, ##__VA_ARGS__) -# define lcdinfo(format, ...) llinfo(format, ##__VA_ARGS__) -#else -# define lcderr(x...) -# define lcdwarn(x...) -# define lcdinfo(x...) -#endif - /************************************************************************************** * Private Type Definition **************************************************************************************/ diff --git a/drivers/lcd/pcf8574_lcd_backpack.c b/drivers/lcd/pcf8574_lcd_backpack.c index 9f802aa1b1..ad107f1ff4 100644 --- a/drivers/lcd/pcf8574_lcd_backpack.c +++ b/drivers/lcd/pcf8574_lcd_backpack.c @@ -78,16 +78,6 @@ #define CMD_SET_CGADDR 0x40 #define CMD_SET_DDADDR 0x80 -#ifdef CONFIG_DEBUG_LCD -# define lcderr err -# define lcdwarn warn -# define lcdinfo info -#else -# define lcderr(x...) -# define lcdwarn(x...) -# define lcdinfo(x...) -#endif - #define MAX_OPENCNT (255) /* Limit of uint8_t */ /**************************************************************************** diff --git a/drivers/lcd/ra8875.c b/drivers/lcd/ra8875.c index a046c7af64..b9d7a30d4d 100644 --- a/drivers/lcd/ra8875.c +++ b/drivers/lcd/ra8875.c @@ -99,20 +99,6 @@ # define CONFIG_LCD_LANDSCAPE 1 #endif -/* Define CONFIG_DEBUG_LCD to enable detailed LCD debug output. Verbose debug must - * also be enabled. - */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_GRAPHICS -# undef CONFIG_DEBUG_LCD -#endif - -#ifndef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_LCD -#endif - /* Display/Color Properties ***********************************************************/ /* Display Resolution */ @@ -172,16 +158,6 @@ # define RA8875_2LAYER_POSSIBLE 1 #endif -/* Debug ******************************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr err -# define lcdinfo info -#else -# define lcderr(x...) -# define lcdinfo(x...) -#endif - /************************************************************************************** * Private Type Definition **************************************************************************************/ diff --git a/drivers/lcd/ssd1289.c b/drivers/lcd/ssd1289.c index ea89ce3929..78c2362d14 100644 --- a/drivers/lcd/ssd1289.c +++ b/drivers/lcd/ssd1289.c @@ -100,20 +100,6 @@ # define CONFIG_LCD_LANDSCAPE 1 #endif -/* Define CONFIG_DEBUG_LCD to enable detailed LCD debug output. Verbose debug must - * also be enabled. - */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_GRAPHICS -# undef CONFIG_DEBUG_LCD -#endif - -#ifndef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_LCD -#endif - /* Display/Color Properties ***********************************************************/ /* Display Resolution */ @@ -226,18 +212,6 @@ #endif -/* Debug ******************************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr err -# define lcdwarn warn -# define lcdinfo info -#else -# define lcderr(x...) -# define lcdwarn(x...) -# define lcdinfo(x...) -#endif - /************************************************************************************** * Private Type Definition **************************************************************************************/ diff --git a/drivers/lcd/ssd1306.h b/drivers/lcd/ssd1306.h index 11fce32c73..696371ebfb 100644 --- a/drivers/lcd/ssd1306.h +++ b/drivers/lcd/ssd1306.h @@ -209,16 +209,6 @@ #define LS_BIT (1 << 0) #define MS_BIT (1 << 7) -/* Debug ******************************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr(format, ...) err(format, ##__VA_ARGS__) -# define lcdinfo(format, ...) info(format, ##__VA_ARGS__) -#else -# define lcderr(x...) -# define lcdinfo(x...) -#endif - /************************************************************************************** * Public Type Definition **************************************************************************************/ diff --git a/drivers/lcd/ug-2864ambag01.c b/drivers/lcd/ug-2864ambag01.c index 54d003f6f5..ea6175a856 100644 --- a/drivers/lcd/ug-2864ambag01.c +++ b/drivers/lcd/ug-2864ambag01.c @@ -260,16 +260,6 @@ #define LS_BIT (1 << 0) #define MS_BIT (1 << 7) -/* Debug ******************************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr(format, ...) err(format, ##__VA_ARGS__) -# define lcdinfo(format, ...) info(format, ##__VA_ARGS__) -#else -# define lcderr(x...) -# define lcdinfo(x...) -#endif - /************************************************************************************** * Private Type Definition **************************************************************************************/ diff --git a/drivers/lcd/ug-9664hswag01.c b/drivers/lcd/ug-9664hswag01.c index e69694367e..1dadf52620 100644 --- a/drivers/lcd/ug-9664hswag01.c +++ b/drivers/lcd/ug-9664hswag01.c @@ -123,16 +123,6 @@ # undef CONFIG_LCD_RPORTRAIT #endif -/* Verbose debug must also be enabled to use the extra OLED debug */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -#endif - -#ifndef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_LCD -#endif - /* Check contrast selection */ #ifndef CONFIG_LCD_MAXCONTRAST diff --git a/drivers/leds/rgbled.c b/drivers/leds/rgbled.c index 05c9976059..503ffea722 100644 --- a/drivers/leds/rgbled.c +++ b/drivers/leds/rgbled.c @@ -33,10 +33,6 @@ * ****************************************************************************/ -/**************************************************************************** - * Compilation Switches - ****************************************************************************/ - /**************************************************************************** * Included Files ****************************************************************************/ diff --git a/include/debug.h b/include/debug.h index 85eea4fe5b..84700d2ca3 100644 --- a/include/debug.h +++ b/include/debug.h @@ -549,6 +549,30 @@ # define irqllinfo(x...) #endif +#ifdef CONFIG_DEBUG_LCD_ERROR +# define lcderr(format, ...) err(format, ##__VA_ARGS__) +# define lcdllerr(format, ...) llerr(format, ##__VA_ARGS__) +#else +# define lcderr(x...) +# define lcdllerr(x...) +#endif + +#ifdef CONFIG_DEBUG_LCD_WARN +# define lcdwarn(format, ...) warn(format, ##__VA_ARGS__) +# define lcdllwarn(format, ...) llwarn(format, ##__VA_ARGS__) +#else +# define lcdwarn(x...) +# define lcdllwarn(x...) +#endif + +#ifdef CONFIG_DEBUG_LCD_INFO +# define lcdinfo(format, ...) info(format, ##__VA_ARGS__) +# define lcdllinfo(format, ...) llinfo(format, ##__VA_ARGS__) +#else +# define lcdinfo(x...) +# define lcdllinfo(x...) +#endif + #ifdef CONFIG_DEBUG_GPIO_ERROR # define gpioerr(format, ...) err(format, ##__VA_ARGS__) # define gpiollerr(format, ...) llerr(format, ##__VA_ARGS__) @@ -1018,6 +1042,30 @@ # define irqllinfo (void) #endif +#ifdef CONFIG_DEBUG_LCD_ERROR +# define lcderr err +# define lcdllerr llerr +#else +# define lcderr (void) +# define lcdllerr (void) +#endif + +#ifdef CONFIG_DEBUG_LCD_WARN +# define lcdwarn warn +# define lcdllwarn llwarn +#else +# define lcdwarn (void) +# define lcdllwarn (void) +#endif + +#ifdef CONFIG_DEBUG_LCD_INFO +# define lcdinfo info +# define lcdllinfo llinfo +#else +# define lcdinfo (void) +# define lcdllinfo (void) +#endif + #ifdef CONFIG_DEBUG_GPIO_ERROR # define gpioerr err # define gpiollerr llerr @@ -1212,6 +1260,14 @@ # define irqinfodumpbuffer(m,b,n) #endif +#ifdef CONFIG_DEBUG_LCD +# define lcderrdumpbuffer(m,b,n) errdumpbuffer(m,b,n) +# define lcdinfodumpbuffer(m,b,n) infodumpbuffer(m,b,n) +#else +# define lcderrdumpbuffer(m,b,n) +# define lcdinfodumpbuffer(m,b,n) +#endif + #ifdef CONFIG_DEBUG_GPIO # define gpioerrdumpbuffer(m,b,n) errdumpbuffer(m,b,n) # define gpioinfodumpbuffer(m,b,n) infodumpbuffer(m,b,n) diff --git a/libc/misc/lib_slcddecode.c b/libc/misc/lib_slcddecode.c index 1c079018dc..14d4e5253c 100644 --- a/libc/misc/lib_slcddecode.c +++ b/libc/misc/lib_slcddecode.c @@ -52,19 +52,6 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ -/* Configuration ************************************************************/ -/* Define CONFIG_DEBUG_LCD to enable detailed LCD debug output. Verbose - * debug must also be enabled. - */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_LCD -#endif - -#ifndef CONFIG_DEBUG_INFO -# undef CONFIG_DEBUG_LCD -#endif /* Indices, counts, helper macros ******************************************/ @@ -89,18 +76,6 @@ #define IS_CODE(a) (((a) >= CODE_MIN) && ((a) <= CODE_MAX)) #define CODE_RETURN(a) (enum slcdcode_e)((a) - 'A') -/* Debug ********************************************************************/ - -#ifdef CONFIG_DEBUG_LCD -# define lcderr err -# define lcdwarn warn -# define lcdinfo info -#else -# define lcderr(x...) -# define lcdwarn(x...) -# define lcdinfo(x...) -#endif - /**************************************************************************** * Private Functions ****************************************************************************/