From fedf00033cd9ad203fbf3b03bc6c5fbe7a558526 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 19 Jun 2016 07:03:10 -0600 Subject: [PATCH] Make default interupt buffer smaller --- drivers/syslog/Kconfig | 2 +- drivers/syslog/syslog_channel.c | 15 ++++----------- include/nuttx/syslog/syslog.h | 14 ++++++++------ 3 files changed, 13 insertions(+), 18 deletions(-) diff --git a/drivers/syslog/Kconfig b/drivers/syslog/Kconfig index 7084291e7f..579e8bed12 100644 --- a/drivers/syslog/Kconfig +++ b/drivers/syslog/Kconfig @@ -14,7 +14,7 @@ config SYSLOG_INTBUFFER config SYSLOG_INTBUFSIZE int "Interrupt buffer size" - default 2048 + default 512 depends on SYSLOG_INTBUFFER ---help--- The size of the interrupt buffer in bytes. diff --git a/drivers/syslog/syslog_channel.c b/drivers/syslog/syslog_channel.c index 817518dab7..9b2e26c41e 100644 --- a/drivers/syslog/syslog_channel.c +++ b/drivers/syslog/syslog_channel.c @@ -73,15 +73,6 @@ static int syslog_default_flush(void) return OK; } -#ifndef CONFIG_SYSLOG_INTBUFFER -static int syslog_force(int ch) -{ - DEBUGASSERT(g_syslog_channel != NULL && g_syslog_channel->sc_force != NULL); - - return g_syslog_channel->sc_force(ch); -} -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -141,7 +132,7 @@ int syslog_putc(int ch) if (up_interrupt_context()) { -#ifdef CONFIG_SYSLOG_INTBUFFER +#if defined(CONFIG_SYSLOG_INTBUFFER) /* Buffer the character in the interrupt buffer. The interrupt buffer * will be flushed before the next normal, non-interrupt SYSLOG output. */ @@ -153,7 +144,9 @@ int syslog_putc(int ch) * with output data that may have been buffered by sc_putc(). */ - return syslog_force(ch); + DEBUGASSERT(g_syslog_channel->sc_force != NULL); + + return g_syslog_channel->sc_force(ch); #endif } else diff --git a/include/nuttx/syslog/syslog.h b/include/nuttx/syslog/syslog.h index 1fe3bef8e3..fe9be6920b 100644 --- a/include/nuttx/syslog/syslog.h +++ b/include/nuttx/syslog/syslog.h @@ -83,13 +83,15 @@ # define CONFIG_SYSLOG_DEVPATH "/dev/ttyS1" #endif -#if defined(CONFIG_SYSLOG_INTBUFFER) && !defined(CONFIG_SYSLOG_INTBUFSIZE) -# define CONFIG_SYSLOG_INTBUFSIZE 2048 -#endif -#if CONFIG_SYSLOG_INTBUFSIZE > 65535 -# undef CONFIG_SYSLOG_INTBUFSIZE -# define CONFIG_SYSLOG_INTBUFSIZE 65535 +#ifdef CONFIG_SYSLOG_INTBUFFER +# ifndef CONFIG_SYSLOG_INTBUFSIZE +# define CONFIG_SYSLOG_INTBUFSIZE 512 +# endif +# if CONFIG_SYSLOG_INTBUFSIZE > 65535 +# undef CONFIG_SYSLOG_INTBUFSIZE +# define CONFIG_SYSLOG_INTBUFSIZE 65535 +# endif #endif /****************************************************************************