Changes to last pull request needed for conformance with coding standard
This commit is contained in:
parent
203899cca8
commit
d0578bfc2b
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/avr/include/debug.h
|
||||
*
|
||||
* Copyright (C) 2007-2011, 2014 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -47,9 +47,11 @@
|
||||
|
||||
#include <syslog.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Since format string that is passed to __arch_syslog() can be a
|
||||
/* Since format string that is passed to __arch_syslog() can be a
|
||||
* comma-separated list, we need some cpp trickery to handle it
|
||||
*
|
||||
* __dbg_first() helper macro accepts the format (that is potentially
|
||||
@ -58,22 +60,25 @@
|
||||
* __dbg_subst() helper macro substitutes first element in the format
|
||||
* with prefix.
|
||||
*/
|
||||
|
||||
#define __dbg_first(format, ...) format
|
||||
#define __dbg_subst(prefix, format, ...) prefix, ##__VA_ARGS__
|
||||
|
||||
#define __dbg_expand(logger, prio, format, ...) \
|
||||
do { \
|
||||
do \
|
||||
{ \
|
||||
static const IOBJ char dbg_s[] = __dbg_first(format); \
|
||||
logger(prio, __dbg_subst(dbg_s, format), ##__VA_ARGS__); \
|
||||
} while(0)
|
||||
} \
|
||||
while(0)
|
||||
|
||||
/*
|
||||
* __arch_syslog() and __arch_lowsyslog() override behavior of NuttX
|
||||
/* __arch_syslog() and __arch_lowsyslog() override behavior of NuttX
|
||||
* dbg macros. They put the format string into program memory and
|
||||
* utilize IPTR (__memx) parameter of syslog to take the format
|
||||
* directly from program memory. This reduces amount of RAM held by
|
||||
* the format strings used in debug statements.
|
||||
*/
|
||||
|
||||
#define __arch_syslog(...) \
|
||||
__dbg_expand(syslog, ##__VA_ARGS__)
|
||||
|
||||
|
@ -65,7 +65,7 @@ config AVR_BUILDROOT_TOOLCHAIN
|
||||
available at ../buildroot/build_avr. Edit the setenv.sh
|
||||
file if this is not the case.
|
||||
|
||||
endchoice
|
||||
endchoice # Toolchain
|
||||
|
||||
menu "Atmel AVR Toolchain options"
|
||||
depends on AVR_ATMEL_AVR_TOOLCHAIN
|
||||
@ -82,6 +82,5 @@ config AVR_HAS_MEMX_PTR
|
||||
directly from there. This will dramatically decrease amount
|
||||
of RAM needed to hold this static data.
|
||||
|
||||
endmenu
|
||||
|
||||
endif
|
||||
endmenu # Atmel AVR Toolchain options
|
||||
endif # ARCH_FAMILY_AVR
|
||||
|
Loading…
Reference in New Issue
Block a user