FS queue size configurable

This commit is contained in:
Robin Müller 2021-07-12 16:32:14 +02:00
parent 32ef21ea22
commit 3a6b8cc66b
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
7 changed files with 22 additions and 24 deletions

View File

@ -1,6 +1,5 @@
target_sources(${TARGET_NAME} PRIVATE
FileSystemHandler.cpp
SdCardAccess.cpp
SdCardManager.cpp
scratchApi.cpp
)

View File

@ -6,7 +6,7 @@
FileSystemHandler::FileSystemHandler(object_id_t fileSystemHandler):
SystemObject(fileSystemHandler) {
mq = QueueFactory::instance()->createMessageQueue(50);
mq = QueueFactory::instance()->createMessageQueue(FS_MAX_QUEUE_SIZE);
}
FileSystemHandler::~FileSystemHandler() {

View File

@ -1,11 +1,15 @@
#ifndef BSP_Q7S_MEMORY_FILESYSTEMHANDLER_H_
#define BSP_Q7S_MEMORY_FILESYSTEMHANDLER_H_
#include "OBSWConfig.h"
#include "fsfw/ipc/MessageQueueIF.h"
#include "fsfw/tasks/ExecutableObjectIF.h"
#include "fsfw/objectmanager/SystemObject.h"
#include "fsfw/memory/HasFileSystemIF.h"
#include <string>
class FileSystemHandler: public SystemObject,
public ExecutableObjectIF,
public HasFileSystemIF {
@ -23,6 +27,8 @@ public:
private:
MessageQueueIF* mq = nullptr;
std::string currentMountPrefix;
static constexpr uint32_t FS_MAX_QUEUE_SIZE = config::OBSW_FILESYSTEM_HANDLER_QUEUE_SIZE;
ReturnValue_t appendToFile(const char* repositoryPath,
const char* filename, const uint8_t* data, size_t size,

View File

@ -1,7 +0,0 @@
#include "SdCardAccess.h"
#include "fsfw/ipc/MutexGuard.h"
SdCardAccess::SdCardAccess() {
}

View File

@ -1,13 +0,0 @@
#ifndef BSP_Q7S_MEMORY_SDCARDACCESS_H_
#define BSP_Q7S_MEMORY_SDCARDACCESS_H_
#include "definitions.h"
class SdCardAccess {
public:
SdCardAccess();
private:
};
#endif /* BSP_Q7S_MEMORY_SDCARDACCESS_H_ */

View File

@ -56,8 +56,21 @@ public:
*/
static SdCardManager* instance();
/**
* Set the preferred SD card which will determine which SD card will be used as the primary
* SD card in hot redundant and cold redundant mode. This function will not switch the
* SD cards which are currently on and mounted, this needs to be implemented by
* an upper layer by using #switchOffSdCard , #switchOnSdCard and #updateSdCardStateFile
* @param sdCard
* @return
*/
ReturnValue_t setPreferredSdCard(sd::SdCard sdCard);
/**
* Get the currently configured preferred SD card
* @param sdCard
* @return
*/
ReturnValue_t getPreferredSdCard(sd::SdCard& sdCard) const;
/**
@ -124,8 +137,6 @@ private:
ReturnValue_t setSdCardState(sd::SdCard sdCard, bool on);
sd::SdCard preferredSdCard = sd::SdCard::SLOT_0;
void processSdStatusLine(SdStatusPair& active, std::string& line, uint8_t& idx,
sd::SdCard& currentSd);

View File

@ -14,6 +14,8 @@
#include "commonConfig.h"
#include "OBSWVersion.h"
#define OBSW_FILESYSTEM_HANDLER_QUEUE_SIZE 50
/* These defines should be disabled for mission code but are useful for
debugging. */
#define OBSW_VERBOSE_LEVEL 1