AP_Logger: disable HAL_LOGGING_BLOCK_ENABLED if not HAL_LOGGING_ENABLED

HAL_LOGGING_DATAFLASH_ENABLED is set unconditionally in some hwdefs, but we still need to honour HAL_LOGGING_ENABLED
This commit is contained in:
Peter Barker 2024-02-26 11:27:02 +11:00 committed by Peter Barker
parent 0e6543f0e4
commit 580199dfba
5 changed files with 20 additions and 10 deletions

View File

@ -4,7 +4,7 @@
#include "AP_Logger_config.h"
#if HAL_LOGGING_DATAFLASH_ENABLED
#if HAL_LOGGING_FLASH_JEDEC_ENABLED
#include <AP_HAL/AP_HAL.h>
@ -323,4 +323,4 @@ void AP_Logger_Flash_JEDEC::WriteEnable(void)
dev->transfer(&b, 1, nullptr, 0);
}
#endif // HAL_LOGGING_DATAFLASH_ENABLED
#endif // HAL_LOGGING_FLASH_JEDEC_ENABLED

View File

@ -7,7 +7,7 @@
#include "AP_Logger_Block.h"
#if HAL_LOGGING_DATAFLASH_ENABLED
#if HAL_LOGGING_FLASH_JEDEC_ENABLED
class AP_Logger_Flash_JEDEC : public AP_Logger_Block {
public:
@ -46,4 +46,4 @@ private:
bool read_cache_valid;
};
#endif // HAL_LOGGING_DATAFLASH_ENABLED
#endif // HAL_LOGGING_FLASH_JEDEC_ENABLED

View File

@ -7,7 +7,7 @@
#include "AP_Logger_W25NXX.h"
#if HAL_LOGGING_DATAFLASH_ENABLED
#if HAL_LOGGING_FLASH_W25NXX_ENABLED
#include <stdio.h>
@ -341,4 +341,4 @@ void AP_Logger_W25NXX::WriteEnable(void)
dev->transfer(&b, 1, nullptr, 0);
}
#endif // HAL_LOGGING_DATAFLASH_ENABLED
#endif // HAL_LOGGING_FLASH_W25NXX_ENABLED

View File

@ -3,12 +3,14 @@
*/
#pragma once
#include "AP_Logger_config.h"
#if HAL_LOGGING_FLASH_W25NXX_ENABLED
#include <AP_HAL/AP_HAL.h>
#include "AP_Logger_Block.h"
#if HAL_LOGGING_DATAFLASH_ENABLED
class AP_Logger_W25NXX : public AP_Logger_Block {
public:
AP_Logger_W25NXX(AP_Logger &front, LoggerMessageWriter_DFLogStart *writer) :
@ -47,4 +49,4 @@ private:
bool read_cache_valid;
};
#endif // HAL_LOGGING_DATAFLASH_ENABLED
#endif // HAL_LOGGING_FLASH_W25NXX_ENABLED

View File

@ -26,11 +26,19 @@
#endif
#if HAL_LOGGING_DATAFLASH_ENABLED
#define HAL_LOGGING_BLOCK_ENABLED 1
#define HAL_LOGGING_BLOCK_ENABLED HAL_LOGGING_ENABLED
#else
#define HAL_LOGGING_BLOCK_ENABLED 0
#endif
#ifndef HAL_LOGGING_FLASH_W25NXX_ENABLED
#define HAL_LOGGING_FLASH_W25NXX_ENABLED HAL_LOGGING_BLOCK_ENABLED
#endif
#ifndef HAL_LOGGING_FLASH_JEDEC_ENABLED
#define HAL_LOGGING_FLASH_JEDEC_ENABLED HAL_LOGGING_BLOCK_ENABLED
#endif
#if HAL_LOGGING_FILESYSTEM_ENABLED
#if !defined (HAL_BOARD_LOG_DIRECTORY)