Make default interupt buffer smaller

This commit is contained in:
Gregory Nutt 2016-06-19 07:03:10 -06:00
parent b594552c09
commit fedf00033c
3 changed files with 13 additions and 18 deletions

View File

@ -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.

View File

@ -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

View File

@ -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
/****************************************************************************