diff --git a/drivers/syslog/Kconfig b/drivers/syslog/Kconfig index 7084291e7f0..579e8bed126 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 817518dab7b..9b2e26c41e0 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 1fe3bef8e3f..fe9be6920bd 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 /****************************************************************************