1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-03-15 07:29:15 +01:00

REVONANO - Make debuglog, FlashFS and other bits optional

This commit is contained in:
Alessio Morale 2014-10-24 01:55:28 +02:00
parent 690e04f4f0
commit 375f23ff0c
8 changed files with 20 additions and 7 deletions

View File

@ -101,9 +101,6 @@ static enum { STACKOVERFLOW_NONE = 0, STACKOVERFLOW_WARNING = 1, STACKOVERFLOW_C
static bool mallocFailed;
static HwSettingsData bootHwSettings;
static FrameType_t bootFrameType;
#if !defined(ARCH_POSIX) && !defined(ARCH_WIN32)
static struct PIOS_FLASHFS_Stats fsStats;
#endif
// Private functions
static void objectUpdatedCb(UAVObjEvent *ev);
@ -541,7 +538,9 @@ static void updateStats()
// Get Irq stack status
stats.IRQStackRemaining = GetFreeIrqStackSize();
#if !defined(ARCH_POSIX) && !defined(ARCH_WIN32)
#if !defined(ARCH_POSIX) && !defined(ARCH_WIN32) && defined(PIOS_INCLUDE_FLASH_LOGFS_SETTINGS)
static struct PIOS_FLASHFS_Stats fsStats;
if (pios_uavo_settings_fs_id) {
PIOS_FLASHFS_GetStats(pios_uavo_settings_fs_id, &fsStats);
stats.SysSlotsFree = fsStats.num_free_slots;

View File

@ -34,7 +34,7 @@
#include "debuglogentry.h"
// global definitions
#ifdef PIOS_INCLUDE_DEBUGLOG
// Global variables
extern uintptr_t pios_user_fs_id; // flash filesystem for logging
@ -281,6 +281,7 @@ bool write_current_buffer()
}
return true;
}
#endif /* ifdef PIOS_INCLUDE_DEBUGLOG */
/**
* @}
* @}

View File

@ -123,6 +123,8 @@
#define FLASH_FREERTOS
/* #define PIOS_INCLUDE_FLASH_EEPROM */
#define PIOS_INCLUDE_DEBUGLOG
/* PIOS radio modules */
// #define PIOS_INCLUDE_RFM22B
// #define PIOS_INCLUDE_RFM22B_COM

View File

@ -117,6 +117,8 @@
/* #define FLASH_FREERTOS */
/* #define PIOS_INCLUDE_FLASH_EEPROM */
#define PIOS_INCLUDE_DEBUGLOG
/* PIOS radio modules */
/* #define PIOS_INCLUDE_RFM22B */
/* #define PIOS_INCLUDE_RFM22B_COM */

View File

@ -125,6 +125,8 @@
#define FLASH_FREERTOS
/* #define PIOS_INCLUDE_FLASH_EEPROM */
#define PIOS_INCLUDE_DEBUGLOG
/* PIOS radio modules */
#define PIOS_INCLUDE_RFM22B
#define PIOS_INCLUDE_RFM22B_COM

View File

@ -116,6 +116,8 @@
#define FLASH_FREERTOS
/* #define PIOS_INCLUDE_FLASH_EEPROM */
#define PIOS_INCLUDE_DEBUGLOG
/* PIOS radio modules */
/* #define PIOS_INCLUDE_RFM22B */
/* #define PIOS_INCLUDE_RFM22B_COM */

View File

@ -96,9 +96,11 @@
#define PIOS_INCLUDE_SETTINGS
#define PIOS_INCLUDE_FLASH
/* A really shitty setting saving implementation */
// #define PIOS_INCLUDE_FLASH_LOGFS_SETTINGS
#define PIOS_INCLUDE_DEBUGLOG
/* Other Interfaces */
// #define PIOS_INCLUDE_I2C_ESC

View File

@ -634,6 +634,7 @@ unlock_exit:
* \param[in] obj The object handle
* \param[in] instId The object instance ID
*/
#ifdef PIOS_INCLUDE_DEBUGLOG
void UAVObjInstanceWriteToLog(UAVObjHandle obj_handle, uint16_t instId)
{
PIOS_Assert(obj_handle);
@ -665,7 +666,9 @@ void UAVObjInstanceWriteToLog(UAVObjHandle obj_handle, uint16_t instId)
unlock_exit:
xSemaphoreGiveRecursive(mutex);
}
#else /* ifdef PIOS_INCLUDE_DEBUGLOG */
void UAVObjInstanceWriteToLog(__attribute__((unused)) UAVObjHandle obj_handle, __attribute__((unused)) uint16_t instId) {}
#endif /* ifdef PIOS_INCLUDE_DEBUGLOG */
/**
* Save all settings objects to the SD card.
* @return 0 if success or -1 if failure