Missing Initialization of FDIR in FreshDeviceHandlerBase #33
@ -1,5 +1,6 @@
|
|||||||
#include "fsfw/container/SharedRingBuffer.h"
|
#include "fsfw/container/SharedRingBuffer.h"
|
||||||
|
|
||||||
|
#include "SharedRingBuffer.h"
|
||||||
#include "fsfw/ipc/MutexFactory.h"
|
#include "fsfw/ipc/MutexFactory.h"
|
||||||
#include "fsfw/ipc/MutexGuard.h"
|
#include "fsfw/ipc/MutexGuard.h"
|
||||||
|
|
||||||
@ -15,7 +16,12 @@ SharedRingBuffer::SharedRingBuffer(object_id_t objectId, uint8_t* buffer, const
|
|||||||
mutex = MutexFactory::instance()->createMutex();
|
mutex = MutexFactory::instance()->createMutex();
|
||||||
}
|
}
|
||||||
|
|
||||||
SharedRingBuffer::~SharedRingBuffer() { MutexFactory::instance()->deleteMutex(mutex); }
|
SharedRingBuffer::~SharedRingBuffer() {
|
||||||
|
MutexFactory::instance()->deleteMutex(mutex);
|
||||||
|
if (receiveSizesFifo != nullptr) {
|
||||||
|
delete (receiveSizesFifo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void SharedRingBuffer::setToUseReceiveSizeFIFO(size_t fifoDepth) { this->fifoDepth = fifoDepth; }
|
void SharedRingBuffer::setToUseReceiveSizeFIFO(size_t fifoDepth) { this->fifoDepth = fifoDepth; }
|
||||||
|
|
||||||
@ -30,18 +36,30 @@ MutexIF* SharedRingBuffer::getMutexHandle() const { return mutex; }
|
|||||||
|
|
||||||
ReturnValue_t SharedRingBuffer::initialize() {
|
ReturnValue_t SharedRingBuffer::initialize() {
|
||||||
if (fifoDepth > 0) {
|
if (fifoDepth > 0) {
|
||||||
receiveSizesFIFO = new DynamicFIFO<size_t>(fifoDepth);
|
receiveSizesFifo = new DynamicFIFO<size_t>(fifoDepth);
|
||||||
}
|
}
|
||||||
return SystemObject::initialize();
|
return SystemObject::initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
DynamicFIFO<size_t>* SharedRingBuffer::getReceiveSizesFIFO() {
|
DynamicFIFO<size_t>* SharedRingBuffer::getReceiveSizesFifo() {
|
||||||
if (receiveSizesFIFO == nullptr) {
|
if (receiveSizesFifo == nullptr) {
|
||||||
// Configuration error.
|
// Configuration error.
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::warning << "SharedRingBuffer::getReceiveSizesFIFO: Ring buffer"
|
sif::warning << "SharedRingBuffer::getReceiveSizesFIFO: Ring buffer"
|
||||||
<< " was not configured to have sizes FIFO, returning nullptr!" << std::endl;
|
<< " was not configured to have sizes FIFO, returning nullptr!" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
return receiveSizesFIFO;
|
return receiveSizesFifo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ReturnValue_t SharedRingBuffer::fifoEmpty(bool& empty, MutexIF::TimeoutType timeoutType, uint32_t timeoutMs) {
|
||||||
|
if(receiveSizesFifo == nullptr) {
|
||||||
|
return returnvalue::FAILED;
|
||||||
|
}
|
||||||
|
MutexGuard mg(mutex, timeoutType, timeoutMs);
|
||||||
|
if(mg.getLockResult() != returnvalue::OK) {
|
||||||
|
return mg.getLockResult();
|
||||||
|
}
|
||||||
|
empty = receiveSizesFifo->empty();
|
||||||
|
return returnvalue::OK;
|
||||||
|
}
|
@ -78,13 +78,15 @@ class SharedRingBuffer : public SystemObject, public SimpleRingBuffer {
|
|||||||
* Do not forget to protect access with a lock if required!
|
* Do not forget to protect access with a lock if required!
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
DynamicFIFO<size_t>* getReceiveSizesFIFO();
|
DynamicFIFO<size_t>* getReceiveSizesFifo();
|
||||||
|
|
||||||
|
ReturnValue_t fifoEmpty(bool& empty, MutexIF::TimeoutType timeoutType, uint32_t timeoutMs);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MutexIF* mutex = nullptr;
|
MutexIF* mutex = nullptr;
|
||||||
|
|
||||||
size_t fifoDepth = 0;
|
size_t fifoDepth = 0;
|
||||||
DynamicFIFO<size_t>* receiveSizesFIFO = nullptr;
|
DynamicFIFO<size_t>* receiveSizesFifo = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* FSFW_CONTAINER_SHAREDRINGBUFFER_H_ */
|
#endif /* FSFW_CONTAINER_SHAREDRINGBUFFER_H_ */
|
@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <condition_variable>
|
#include <condition_variable>
|
||||||
|
#include <string>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include "fsfw/objectmanager/ObjectManagerIF.h"
|
#include "fsfw/objectmanager/ObjectManagerIF.h"
|
||||||
#include "fsfw/tasks/FixedSlotSequence.h"
|
#include "fsfw/tasks/FixedSlotSequence.h"
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <condition_variable>
|
#include <condition_variable>
|
||||||
|
#include <string>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include "fsfw/objectmanager/ObjectManagerIF.h"
|
#include "fsfw/objectmanager/ObjectManagerIF.h"
|
||||||
#include "fsfw/tasks/PeriodicTaskBase.h"
|
#include "fsfw/tasks/PeriodicTaskBase.h"
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
#include <fsfw/returnvalues/returnvalue.h>
|
#include <fsfw/returnvalues/returnvalue.h>
|
||||||
|
|
||||||
#include <thread>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <thread>
|
||||||
|
|
||||||
namespace tasks {
|
namespace tasks {
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::handleResetCom
|
|||||||
template <size_t MAX_NUM_TCS>
|
template <size_t MAX_NUM_TCS>
|
||||||
inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::doInsertActivity(
|
inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::doInsertActivity(
|
||||||
const uint8_t *data, size_t size) {
|
const uint8_t *data, size_t size) {
|
||||||
if(telecommandMap.full()) {
|
if (telecommandMap.full()) {
|
||||||
return MAP_IS_FULL;
|
return MAP_IS_FULL;
|
||||||
}
|
}
|
||||||
uint32_t timestamp = 0;
|
uint32_t timestamp = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user