From cc38189f7167fcf74f3c829cc4735aa0308db762 Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Fri, 9 Dec 2011 15:01:14 -0800 Subject: [PATCH] ArduCopter config: Correct LOGGING_ENABLED defaults to force disable for 1280 Per email, this is what Jason meant to do in aeb92870, but previous code forced logging enable for all non-1280 users. --- ArduCopter/config.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/ArduCopter/config.h b/ArduCopter/config.h index 3fe6b47297..fbed0507b7 100644 --- a/ArduCopter/config.h +++ b/ArduCopter/config.h @@ -662,14 +662,20 @@ ////////////////////////////////////////////////////////////////////////////// // Dataflash logging control // -#ifdef LOGGING_ENABLED - #undef LOGGING_ENABLED -#endif -#if defined( __AVR_ATmega2560__ ) // determines if optical flow code is included - #define LOGGING_ENABLED ENABLED +// Logging must be disabled for 1280 build. +#if defined( __AVR_ATmega1280__ ) +# if LOGGING_ENABLED == ENABLED +// If logging was enabled in APM_Config or command line, warn the user. +# warning "Logging is not supported on ATmega1280" +# undef LOGGING_ENABLED +# endif +# ifndef LOGGING_ENABLED +# define LOGGING_ENABLED DISABLED +# endif #else - #define LOGGING_ENABLED DISABLED +// Logging is enabled by default for all other builds. +# define LOGGING_ENABLED ENABLED #endif