diff --git a/Drv/BlockDriver/BlockDriverImpl.cpp b/Drv/BlockDriver/BlockDriverImpl.cpp index ecd20c2083..929e5e9a1d 100644 --- a/Drv/BlockDriver/BlockDriverImpl.cpp +++ b/Drv/BlockDriver/BlockDriverImpl.cpp @@ -34,7 +34,7 @@ namespace Drv { this->BufferOut_out(0,buffer); } - void BlockDriverImpl::Sched_handler(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context) { + void BlockDriverImpl::Sched_handler(NATIVE_INT_TYPE portNum, U32 context) { } void BlockDriverImpl::callIsr() { diff --git a/Drv/BlockDriver/BlockDriverImpl.hpp b/Drv/BlockDriver/BlockDriverImpl.hpp index bd7fcfe9f8..1c56962579 100644 --- a/Drv/BlockDriver/BlockDriverImpl.hpp +++ b/Drv/BlockDriver/BlockDriverImpl.hpp @@ -22,7 +22,7 @@ namespace Drv { // downcalls for input ports void InterruptReport_internalInterfaceHandler(U32 ip); void BufferIn_handler(NATIVE_INT_TYPE portNum, Drv::DataBuffer& buffer); - void Sched_handler(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context); + void Sched_handler(NATIVE_INT_TYPE portNum, U32 context); //! Handler implementation for PingIn //! void PingIn_handler( diff --git a/Drv/Ip/SocketReadTask.cpp b/Drv/Ip/SocketReadTask.cpp index 73cef229ca..70adb50f64 100644 --- a/Drv/Ip/SocketReadTask.cpp +++ b/Drv/Ip/SocketReadTask.cpp @@ -25,9 +25,9 @@ SocketReadTask::~SocketReadTask() {} void SocketReadTask::startSocketTask(const Fw::StringBase &name, const bool reconnect, - const NATIVE_UINT_TYPE priority, - const NATIVE_UINT_TYPE stack, - const NATIVE_UINT_TYPE cpuAffinity) { + const Os::Task::ParamType priority, + const Os::Task::ParamType stack, + const Os::Task::ParamType cpuAffinity) { FW_ASSERT(not m_task.isStarted()); // It is a coding error to start this task multiple times FW_ASSERT(not this->m_stop); // It is a coding error to stop the thread before it is started m_reconnect = reconnect; diff --git a/Drv/Ip/SocketReadTask.hpp b/Drv/Ip/SocketReadTask.hpp index 19bbe4233f..dd3741d25e 100644 --- a/Drv/Ip/SocketReadTask.hpp +++ b/Drv/Ip/SocketReadTask.hpp @@ -51,9 +51,9 @@ class SocketReadTask { */ void startSocketTask(const Fw::StringBase &name, const bool reconnect = true, - const NATIVE_UINT_TYPE priority = Os::Task::TASK_DEFAULT, - const NATIVE_UINT_TYPE stack = Os::Task::TASK_DEFAULT, - const NATIVE_UINT_TYPE cpuAffinity = Os::Task::TASK_DEFAULT); + const Os::Task::ParamType priority = Os::Task::TASK_DEFAULT, + const Os::Task::ParamType stack = Os::Task::TASK_DEFAULT, + const Os::Task::ParamType cpuAffinity = Os::Task::TASK_DEFAULT); /** * \brief startup the socket for communications diff --git a/FppTest/dp/DpTest.cpp b/FppTest/dp/DpTest.cpp index a8edd75e1f..25459c1798 100644 --- a/FppTest/dp/DpTest.cpp +++ b/FppTest/dp/DpTest.cpp @@ -39,7 +39,7 @@ DpTest ::~DpTest() {} // Handler implementations for user-defined typed input ports // ---------------------------------------------------------------------- -void DpTest::schedIn_handler(const NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context) { +void DpTest::schedIn_handler(const NATIVE_INT_TYPE portNum, U32 context) { // Request a buffer for Container 1 this->dpRequest_Container1(CONTAINER_1_DATA_SIZE); // Request a buffer for Container 2 diff --git a/FppTest/dp/DpTest.hpp b/FppTest/dp/DpTest.hpp index 61a831cd1e..88876d876d 100644 --- a/FppTest/dp/DpTest.hpp +++ b/FppTest/dp/DpTest.hpp @@ -76,7 +76,7 @@ class DpTest : public DpTestComponentBase { //! Handler implementation for schedIn void schedIn_handler(const NATIVE_INT_TYPE portNum, //!< The port number - NATIVE_UINT_TYPE context //!< The call order + U32 context //!< The call order ) override; PRIVATE: diff --git a/Fw/Comp/ActiveComponentBase.cpp b/Fw/Comp/ActiveComponentBase.cpp index 0ec0a8bb41..fe96ad6136 100644 --- a/Fw/Comp/ActiveComponentBase.cpp +++ b/Fw/Comp/ActiveComponentBase.cpp @@ -53,13 +53,7 @@ namespace Fw { } #endif - void ActiveComponentBase::start(NATIVE_INT_TYPE identifier, NATIVE_INT_TYPE priority, NATIVE_INT_TYPE stackSize, NATIVE_INT_TYPE cpuAffinity) { - this->start(static_cast(priority), static_cast(stackSize), - ((cpuAffinity == -1) ? Os::Task::TASK_DEFAULT : static_cast(cpuAffinity)), - static_cast(identifier)); - } - - void ActiveComponentBase::start(NATIVE_UINT_TYPE priority, NATIVE_UINT_TYPE stackSize, NATIVE_UINT_TYPE cpuAffinity, NATIVE_UINT_TYPE identifier) { + void ActiveComponentBase::start(Os::Task::ParamType priority, Os::Task::ParamType stackSize, Os::Task::ParamType cpuAffinity, Os::Task::ParamType identifier) { Os::TaskString taskName; #if FW_OBJECT_NAMES == 1 diff --git a/Fw/Comp/ActiveComponentBase.hpp b/Fw/Comp/ActiveComponentBase.hpp index 440232bad8..1b19635547 100644 --- a/Fw/Comp/ActiveComponentBase.hpp +++ b/Fw/Comp/ActiveComponentBase.hpp @@ -11,40 +11,41 @@ #ifndef FW_ACTIVE_COMPONENT_BASE_HPP #define FW_ACTIVE_COMPONENT_BASE_HPP -#include -#include #include +#include #include +#include namespace Fw { - class ActiveComponentBase : public QueuedComponentBase { - public: - void start(NATIVE_UINT_TYPE priority = Os::Task::TASK_DEFAULT, NATIVE_UINT_TYPE stackSize = Os::Task::TASK_DEFAULT, NATIVE_UINT_TYPE cpuAffinity = Os::Task::TASK_DEFAULT, NATIVE_UINT_TYPE identifier = Os::Task::TASK_DEFAULT); //!< called by instantiator when task is to be started +class ActiveComponentBase : public QueuedComponentBase { + public: + void start(Os::Task::ParamType priority = Os::Task::TASK_DEFAULT, + Os::Task::ParamType stackSize = Os::Task::TASK_DEFAULT, + Os::Task::ParamType cpuAffinity = Os::Task::TASK_DEFAULT, + Os::Task::ParamType identifier = + Os::Task::TASK_DEFAULT); //!< called by instantiator when task is to be started + void exit(); //!< exit task in active component + Os::Task::TaskStatus join(void** value_ptr); //!< provide return value of thread if value_ptr is not NULL - DEPRECATED(void start(NATIVE_INT_TYPE identifier, NATIVE_INT_TYPE priority, NATIVE_INT_TYPE stackSize, NATIVE_INT_TYPE cpuAffinity = -1), - "Please switch to start(NATIVE_UINT_TYPE priority, NATIVE_UINT_TYPE stackSize, NATIVE_UINT_TYPE cpuAffinity, NATIVE_UINT_TYPE identifier)"); //!< called by instantiator when task is to be started - void exit(); //!< exit task in active component - Os::Task::TaskStatus join(void **value_ptr); //!< provide return value of thread if value_ptr is not NULL - - enum { - ACTIVE_COMPONENT_EXIT //!< message to exit active component task - }; - - PROTECTED: - ActiveComponentBase(const char* name); //!< Constructor - virtual ~ActiveComponentBase(); //!< Destructor - void init(NATIVE_INT_TYPE instance); //!< initialization code - virtual void preamble(); //!< A function that will be called before the event loop is entered - virtual void loop(); //!< The function that will loop dispatching messages - virtual void finalizer(); //!< A function that will be called after exiting the loop - Os::Task m_task; //!< task object for active component -#if FW_OBJECT_TO_STRING == 1 - virtual void toString(char* str, NATIVE_INT_TYPE size); //!< create string description of component -#endif - PRIVATE: - static void s_baseTask(void*); //!< function provided to task class for new thread. - static void s_baseBareTask(void*); //!< function provided to task class for new thread. + enum { + ACTIVE_COMPONENT_EXIT //!< message to exit active component task }; -} + PROTECTED: + explicit ActiveComponentBase(const char* name); //!< Constructor + virtual ~ActiveComponentBase(); //!< Destructor + void init(NATIVE_INT_TYPE instance); //!< initialization code + virtual void preamble(); //!< A function that will be called before the event loop is entered + virtual void loop(); //!< The function that will loop dispatching messages + virtual void finalizer(); //!< A function that will be called after exiting the loop + Os::Task m_task; //!< task object for active component +#if FW_OBJECT_TO_STRING == 1 + virtual void toString(char* str, NATIVE_INT_TYPE size); //!< create string description of component +#endif + PRIVATE: + static void s_baseTask(void*); //!< function provided to task class for new thread. + static void s_baseBareTask(void*); //!< function provided to task class for new thread. +}; + +} // namespace Fw #endif diff --git a/Fw/Types/Serializable.cpp b/Fw/Types/Serializable.cpp index 609bd32a45..2cddeddca0 100644 --- a/Fw/Types/Serializable.cpp +++ b/Fw/Types/Serializable.cpp @@ -65,7 +65,7 @@ namespace Fw { // serialization routines SerializeStatus SerializeBufferBase::serialize(U8 val) { - if (this->m_serLoc + static_cast(sizeof(val)) - 1 >= this->getBuffCapacity()) { + if (this->m_serLoc + static_cast(sizeof(val)) - 1 >= this->getBuffCapacity()) { return FW_SERIALIZE_NO_ROOM_LEFT; } FW_ASSERT(this->getBuffAddr()); @@ -77,7 +77,7 @@ namespace Fw { } SerializeStatus SerializeBufferBase::serialize(I8 val) { - if (this->m_serLoc + static_cast(sizeof(val)) - 1 >= this->getBuffCapacity()) { + if (this->m_serLoc + static_cast(sizeof(val)) - 1 >= this->getBuffCapacity()) { return FW_SERIALIZE_NO_ROOM_LEFT; } FW_ASSERT(this->getBuffAddr()); @@ -89,7 +89,7 @@ namespace Fw { #if FW_HAS_16_BIT==1 SerializeStatus SerializeBufferBase::serialize(U16 val) { - if (this->m_serLoc + static_cast(sizeof(val)) - 1 >= this->getBuffCapacity()) { + if (this->m_serLoc + static_cast(sizeof(val)) - 1 >= this->getBuffCapacity()) { return FW_SERIALIZE_NO_ROOM_LEFT; } FW_ASSERT(this->getBuffAddr()); @@ -102,7 +102,7 @@ namespace Fw { } SerializeStatus SerializeBufferBase::serialize(I16 val) { - if (this->m_serLoc + static_cast(sizeof(val)) - 1 >= this->getBuffCapacity()) { + if (this->m_serLoc + static_cast(sizeof(val)) - 1 >= this->getBuffCapacity()) { return FW_SERIALIZE_NO_ROOM_LEFT; } FW_ASSERT(this->getBuffAddr()); @@ -116,7 +116,7 @@ namespace Fw { #endif #if FW_HAS_32_BIT==1 SerializeStatus SerializeBufferBase::serialize(U32 val) { - if (this->m_serLoc + static_cast(sizeof(val)) - 1 >= this->getBuffCapacity()) { + if (this->m_serLoc + static_cast(sizeof(val)) - 1 >= this->getBuffCapacity()) { return FW_SERIALIZE_NO_ROOM_LEFT; } FW_ASSERT(this->getBuffAddr()); @@ -131,7 +131,7 @@ namespace Fw { } SerializeStatus SerializeBufferBase::serialize(I32 val) { - if (this->m_serLoc + static_cast(sizeof(val)) - 1 >= this->getBuffCapacity()) { + if (this->m_serLoc + static_cast(sizeof(val)) - 1 >= this->getBuffCapacity()) { return FW_SERIALIZE_NO_ROOM_LEFT; } FW_ASSERT(this->getBuffAddr()); @@ -148,7 +148,7 @@ namespace Fw { #if FW_HAS_64_BIT==1 SerializeStatus SerializeBufferBase::serialize(U64 val) { - if (this->m_serLoc + static_cast(sizeof(val)) - 1 >= this->getBuffCapacity()) { + if (this->m_serLoc + static_cast(sizeof(val)) - 1 >= this->getBuffCapacity()) { return FW_SERIALIZE_NO_ROOM_LEFT; } FW_ASSERT(this->getBuffAddr()); @@ -167,7 +167,7 @@ namespace Fw { } SerializeStatus SerializeBufferBase::serialize(I64 val) { - if (this->m_serLoc + static_cast(sizeof(val)) - 1 >= this->getBuffCapacity()) { + if (this->m_serLoc + static_cast(sizeof(val)) - 1 >= this->getBuffCapacity()) { return FW_SERIALIZE_NO_ROOM_LEFT; } FW_ASSERT(this->getBuffAddr()); @@ -208,7 +208,7 @@ namespace Fw { } SerializeStatus SerializeBufferBase::serialize(bool val) { - if (this->m_serLoc + static_cast(sizeof(U8)) - 1 >= this->getBuffCapacity()) { + if (this->m_serLoc + static_cast(sizeof(U8)) - 1 >= this->getBuffCapacity()) { return FW_SERIALIZE_NO_ROOM_LEFT; } @@ -225,7 +225,7 @@ namespace Fw { } SerializeStatus SerializeBufferBase::serialize(const void* val) { - if (this->m_serLoc + static_cast(sizeof(void*)) - 1 + if (this->m_serLoc + static_cast(sizeof(void*)) - 1 >= this->getBuffCapacity()) { return FW_SERIALIZE_NO_ROOM_LEFT; } @@ -234,11 +234,11 @@ namespace Fw { } - SerializeStatus SerializeBufferBase::serialize(const U8* buff, NATIVE_UINT_TYPE length) { + SerializeStatus SerializeBufferBase::serialize(const U8* buff, Serializable::SizeType length) { return this->serialize(buff, static_cast(length), Serialization::INCLUDE_LENGTH); } - SerializeStatus SerializeBufferBase::serialize(const U8* buff, NATIVE_UINT_TYPE length, bool noLength) { + SerializeStatus SerializeBufferBase::serialize(const U8* buff, Serializable::SizeType length, bool noLength) { return this->serialize(buff, static_cast(length), noLength ? Serialization::OMIT_LENGTH : Serialization::INCLUDE_LENGTH); } @@ -246,7 +246,7 @@ namespace Fw { // First serialize length SerializeStatus stat; if (mode == Serialization::INCLUDE_LENGTH) { - stat = this->serialize(static_cast(length)); + stat = this->serialize(static_cast(length)); if (stat != FW_SERIALIZE_OK) { return stat; } @@ -271,14 +271,14 @@ namespace Fw { SerializeStatus SerializeBufferBase::serialize( const SerializeBufferBase& val) { - NATIVE_UINT_TYPE size = val.getBuffLength(); - if (this->m_serLoc + size + static_cast(sizeof(FwBuffSizeType)) + Serializable::SizeType size = val.getBuffLength(); + if (this->m_serLoc + size + static_cast(sizeof(FwSizeStoreType)) > this->getBuffCapacity()) { return FW_SERIALIZE_NO_ROOM_LEFT; } // First, serialize size - SerializeStatus stat = this->serialize(static_cast(size)); + SerializeStatus stat = this->serialize(static_cast(size)); if (stat != FW_SERIALIZE_OK) { return stat; } @@ -310,7 +310,7 @@ namespace Fw { // check for room if (this->getBuffLength() == this->m_deserLoc) { return FW_DESERIALIZE_BUFFER_EMPTY; - } else if (this->getBuffLength() - this->m_deserLoc < static_cast(sizeof(val))) { + } else if (this->getBuffLength() - this->m_deserLoc < static_cast(sizeof(val))) { return FW_DESERIALIZE_SIZE_MISMATCH; } // read from current location @@ -324,7 +324,7 @@ namespace Fw { // check for room if (this->getBuffLength() == this->m_deserLoc) { return FW_DESERIALIZE_BUFFER_EMPTY; - } else if (this->getBuffLength() - this->m_deserLoc < static_cast(sizeof(val))) { + } else if (this->getBuffLength() - this->m_deserLoc < static_cast(sizeof(val))) { return FW_DESERIALIZE_SIZE_MISMATCH; } // read from current location @@ -339,7 +339,7 @@ namespace Fw { // check for room if (this->getBuffLength() == this->m_deserLoc) { return FW_DESERIALIZE_BUFFER_EMPTY; - } else if (this->getBuffLength() - this->m_deserLoc < static_cast(sizeof(val))) { + } else if (this->getBuffLength() - this->m_deserLoc < static_cast(sizeof(val))) { return FW_DESERIALIZE_SIZE_MISMATCH; } // read from current location @@ -357,7 +357,7 @@ namespace Fw { // check for room if (this->getBuffLength() == this->m_deserLoc) { return FW_DESERIALIZE_BUFFER_EMPTY; - } else if (this->getBuffLength() - this->m_deserLoc < static_cast(sizeof(val))) { + } else if (this->getBuffLength() - this->m_deserLoc < static_cast(sizeof(val))) { return FW_DESERIALIZE_SIZE_MISMATCH; } // read from current location @@ -376,7 +376,7 @@ namespace Fw { // check for room if (this->getBuffLength() == this->m_deserLoc) { return FW_DESERIALIZE_BUFFER_EMPTY; - } else if (this->getBuffLength() - this->m_deserLoc < static_cast(sizeof(val))) { + } else if (this->getBuffLength() - this->m_deserLoc < static_cast(sizeof(val))) { return FW_DESERIALIZE_SIZE_MISMATCH; } // read from current location @@ -394,7 +394,7 @@ namespace Fw { // check for room if (this->getBuffLength() == this->m_deserLoc) { return FW_DESERIALIZE_BUFFER_EMPTY; - } else if (this->getBuffLength() - this->m_deserLoc < static_cast(sizeof(val))) { + } else if (this->getBuffLength() - this->m_deserLoc < static_cast(sizeof(val))) { return FW_DESERIALIZE_SIZE_MISMATCH; } // read from current location @@ -415,7 +415,7 @@ namespace Fw { // check for room if (this->getBuffLength() == this->m_deserLoc) { return FW_DESERIALIZE_BUFFER_EMPTY; - } else if (this->getBuffLength() - this->m_deserLoc < static_cast(sizeof(val))) { + } else if (this->getBuffLength() - this->m_deserLoc < static_cast(sizeof(val))) { return FW_DESERIALIZE_SIZE_MISMATCH; } // read from current location @@ -438,7 +438,7 @@ namespace Fw { // check for room if (this->getBuffLength() == this->m_deserLoc) { return FW_DESERIALIZE_BUFFER_EMPTY; - } else if (this->getBuffLength() - this->m_deserLoc < static_cast(sizeof(val))) { + } else if (this->getBuffLength() - this->m_deserLoc < static_cast(sizeof(val))) { return FW_DESERIALIZE_SIZE_MISMATCH; } // read from current location @@ -479,7 +479,7 @@ namespace Fw { // check for room if (this->getBuffLength() == this->m_deserLoc) { return FW_DESERIALIZE_BUFFER_EMPTY; - } else if (this->getBuffLength() - this->m_deserLoc < static_cast(sizeof(U8))) { + } else if (this->getBuffLength() - this->m_deserLoc < static_cast(sizeof(U8))) { return FW_DESERIALIZE_SIZE_MISMATCH; } // read from current location @@ -518,17 +518,17 @@ namespace Fw { return FW_SERIALIZE_OK; } - SerializeStatus SerializeBufferBase::deserialize(U8* buff, NATIVE_UINT_TYPE& length) { + SerializeStatus SerializeBufferBase::deserialize(U8* buff, Serializable::SizeType& length) { FwSizeType length_in_out = static_cast(length); SerializeStatus status = this->deserialize(buff, length_in_out, Serialization::INCLUDE_LENGTH); - length = static_cast(length_in_out); + length = static_cast(length_in_out); return status; } - SerializeStatus SerializeBufferBase::deserialize(U8* buff, NATIVE_UINT_TYPE& length, bool noLength) { + SerializeStatus SerializeBufferBase::deserialize(U8* buff, Serializable::SizeType& length, bool noLength) { FwSizeType length_in_out = static_cast(length); SerializeStatus status = this->deserialize(buff, length_in_out, noLength ? Serialization::OMIT_LENGTH : Serialization::INCLUDE_LENGTH); - length = static_cast(length_in_out); + length = static_cast(length_in_out); return status; } @@ -537,7 +537,7 @@ namespace Fw { FW_ASSERT(this->getBuffAddr()); if (mode == Serialization::INCLUDE_LENGTH) { - FwBuffSizeType storedLength; + FwSizeStoreType storedLength; SerializeStatus stat = this->deserialize(storedLength); @@ -576,7 +576,7 @@ namespace Fw { FW_ASSERT(val.getBuffAddr()); SerializeStatus stat = FW_SERIALIZE_OK; - FwBuffSizeType storedLength; + FwSizeStoreType storedLength; stat = this->deserialize(storedLength); @@ -665,11 +665,11 @@ namespace Fw { return this->deserializeSkip(offset); } - NATIVE_UINT_TYPE SerializeBufferBase::getBuffLength() const { + Serializable::SizeType SerializeBufferBase::getBuffLength() const { return this->m_serLoc; } - SerializeStatus SerializeBufferBase::setBuff(const U8* src, NATIVE_UINT_TYPE length) { + SerializeStatus SerializeBufferBase::setBuff(const U8* src, Serializable::SizeType length) { if (this->getBuffCapacity() < length) { return FW_SERIALIZE_NO_ROOM_LEFT; } else { @@ -682,7 +682,7 @@ namespace Fw { } } - SerializeStatus SerializeBufferBase::setBuffLen(NATIVE_UINT_TYPE length) { + SerializeStatus SerializeBufferBase::setBuffLen(Serializable::SizeType length) { if (this->getBuffCapacity() < length) { return FW_SERIALIZE_NO_ROOM_LEFT; } else { @@ -692,11 +692,11 @@ namespace Fw { } } - NATIVE_UINT_TYPE SerializeBufferBase::getBuffLeft() const { + Serializable::SizeType SerializeBufferBase::getBuffLeft() const { return this->m_serLoc - this->m_deserLoc; } - SerializeStatus SerializeBufferBase::copyRaw(SerializeBufferBase& dest, NATIVE_UINT_TYPE size) { + SerializeStatus SerializeBufferBase::copyRaw(SerializeBufferBase& dest, Serializable::SizeType size) { // make sure there is sufficient size in destination if (dest.getBuffCapacity() < size) { return FW_SERIALIZE_NO_ROOM_LEFT; @@ -710,7 +710,7 @@ namespace Fw { } - SerializeStatus SerializeBufferBase::copyRawOffset(SerializeBufferBase& dest, NATIVE_UINT_TYPE size) { + SerializeStatus SerializeBufferBase::copyRawOffset(SerializeBufferBase& dest, Serializable::SizeType size) { // make sure there is sufficient size in destination if (dest.getBuffCapacity() < size + dest.getBuffLength()) { return FW_SERIALIZE_NO_ROOM_LEFT; @@ -752,7 +752,7 @@ namespace Fw { FW_ASSERT(us); FW_ASSERT(them); - for (NATIVE_UINT_TYPE byte = 0; byte < this->getBuffLength(); byte++) { + for (Serializable::SizeType byte = 0; byte < this->getBuffLength(); byte++) { if (us[byte] != them[byte]) { return false; } @@ -767,7 +767,7 @@ namespace Fw { FW_ASSERT(us); - for (NATIVE_UINT_TYPE byte = 0; byte < buff.getBuffLength(); byte++) { + for (Serializable::SizeType byte = 0; byte < buff.getBuffLength(); byte++) { os << "[" << std::setw(2) << std::hex << std::setfill('0') << us[byte] << "]" << std::dec; } @@ -775,7 +775,7 @@ namespace Fw { } #endif - ExternalSerializeBuffer::ExternalSerializeBuffer(U8* buffPtr, NATIVE_UINT_TYPE size) { + ExternalSerializeBuffer::ExternalSerializeBuffer(U8* buffPtr, Serializable::SizeType size) { this->setExtBuffer(buffPtr,size); } @@ -783,7 +783,7 @@ namespace Fw { this->clear(); } - void ExternalSerializeBuffer::setExtBuffer(U8* buffPtr, NATIVE_UINT_TYPE size) { + void ExternalSerializeBuffer::setExtBuffer(U8* buffPtr, Serializable::SizeType size) { FW_ASSERT(buffPtr != nullptr); this->m_buff = buffPtr; this->m_buffSize = size; @@ -794,7 +794,7 @@ namespace Fw { this->m_buffSize = 0; } - NATIVE_UINT_TYPE ExternalSerializeBuffer::getBuffCapacity() const { + Serializable::SizeType ExternalSerializeBuffer::getBuffCapacity() const { return this->m_buffSize; } diff --git a/Fw/Types/Serializable.hpp b/Fw/Types/Serializable.hpp index a3dc654119..db1f164db0 100644 --- a/Fw/Types/Serializable.hpp +++ b/Fw/Types/Serializable.hpp @@ -23,6 +23,9 @@ namespace Fw { class SerializeBufferBase; //!< forward declaration class Serializable { + public: + // Size type for backwards compatibility + using SizeType = NATIVE_UINT_TYPE; public: virtual SerializeStatus serialize(SerializeBufferBase& buffer) const = 0; //!< serialize contents virtual SerializeStatus deserialize(SerializeBufferBase& buffer) = 0; //!< deserialize to contents @@ -159,18 +162,18 @@ namespace Fw { SerializeStatus serializeSkip(FwSizeType numBytesToSkip); //!< Skips the number of specified bytes for serialization SerializeStatus deserializeSkip(FwSizeType numBytesToSkip); //!< Skips the number of specified bytes for deserialization - virtual NATIVE_UINT_TYPE getBuffCapacity() const = 0; //!< returns capacity, not current size, of buffer - NATIVE_UINT_TYPE getBuffLength() const; //!< returns current buffer size - NATIVE_UINT_TYPE getBuffLeft() const; //!< returns how much deserialization buffer is left + virtual Serializable::SizeType getBuffCapacity() const = 0; //!< returns capacity, not current size, of buffer + Serializable::SizeType getBuffLength() const; //!< returns current buffer size + Serializable::SizeType getBuffLeft() const; //!< returns how much deserialization buffer is left virtual U8* getBuffAddr() = 0; //!< gets buffer address for data filling virtual const U8* getBuffAddr() const = 0; //!< gets buffer address for data reading, const version const U8* getBuffAddrLeft() const; //!< gets address of remaining non-deserialized data. U8* getBuffAddrSer(); //!< gets address of end of serialization. DANGEROUS! Need to know max buffer size and adjust when done - SerializeStatus setBuff(const U8* src, NATIVE_UINT_TYPE length); //!< sets buffer contents and size - SerializeStatus setBuffLen(NATIVE_UINT_TYPE length); //!< sets buffer length manually after filling with data - SerializeStatus copyRaw(SerializeBufferBase& dest, NATIVE_UINT_TYPE size); //!< directly copies buffer without looking for a size in the stream. + SerializeStatus setBuff(const U8* src, Serializable::SizeType length); //!< sets buffer contents and size + SerializeStatus setBuffLen(Serializable::SizeType length); //!< sets buffer length manually after filling with data + SerializeStatus copyRaw(SerializeBufferBase& dest, Serializable::SizeType size); //!< directly copies buffer without looking for a size in the stream. // Will increment deserialization pointer - SerializeStatus copyRawOffset(SerializeBufferBase& dest, NATIVE_UINT_TYPE size); //!< directly copies buffer without looking for a size in the stream. + SerializeStatus copyRawOffset(SerializeBufferBase& dest, Serializable::SizeType size); //!< directly copies buffer without looking for a size in the stream. // Will increment deserialization pointer @@ -188,21 +191,21 @@ namespace Fw { SerializeBufferBase(const SerializeBufferBase &src); //!< constructor with buffer as source void copyFrom(const SerializeBufferBase& src); //!< copy data from source buffer - NATIVE_UINT_TYPE m_serLoc; //!< current offset in buffer of serialized data - NATIVE_UINT_TYPE m_deserLoc; //!< current offset for deserialization + Serializable::SizeType m_serLoc; //!< current offset in buffer of serialized data + Serializable::SizeType m_deserLoc; //!< current offset for deserialization }; // Helper class for building buffers with external storage class ExternalSerializeBuffer : public SerializeBufferBase { public: - ExternalSerializeBuffer(U8* buffPtr, NATIVE_UINT_TYPE size); //!< construct with external buffer + ExternalSerializeBuffer(U8* buffPtr, Serializable::SizeType size); //!< construct with external buffer ExternalSerializeBuffer(); //!< default constructor - void setExtBuffer(U8* buffPtr, NATIVE_UINT_TYPE size); //!< Set the external buffer + void setExtBuffer(U8* buffPtr, Serializable::SizeType size); //!< Set the external buffer void clear(); //!< clear external buffer // pure virtual functions - NATIVE_UINT_TYPE getBuffCapacity() const; + Serializable::SizeType getBuffCapacity() const; U8* getBuffAddr(); const U8* getBuffAddr() const ; @@ -214,7 +217,7 @@ namespace Fw { // private data U8* m_buff; //!< pointer to external buffer - NATIVE_UINT_TYPE m_buffSize; //!< size of external buffer + Serializable::SizeType m_buffSize; //!< size of external buffer }; } diff --git a/Fw/Types/StringType.cpp b/Fw/Types/StringType.cpp index 23c032a61a..423c05733e 100644 --- a/Fw/Types/StringType.cpp +++ b/Fw/Types/StringType.cpp @@ -36,7 +36,7 @@ namespace Fw { } bool StringBase::operator==(const StringBase& other) const { - NATIVE_UINT_TYPE len = this->length(); + SizeType len = this->length(); if (len != other.length()) { return false; } else { @@ -51,7 +51,7 @@ namespace Fw { return false; } - const NATIVE_UINT_TYPE capacity = this->getCapacity(); + const SizeType capacity = this->getCapacity(); const size_t result = strncmp(us, other, capacity); return (result == 0); @@ -59,7 +59,7 @@ namespace Fw { void StringBase::format(const CHAR* formatString, ...) { CHAR* us = const_cast(this->toChar()); - NATIVE_UINT_TYPE cap = this->getCapacity(); + SizeType cap = this->getCapacity(); FW_ASSERT(us); va_list args; va_start(args, formatString); @@ -107,12 +107,12 @@ namespace Fw { return *this; } - void StringBase::appendBuff(const CHAR* buff, NATIVE_UINT_TYPE size) { - const U32 capacity = this->getCapacity(); - const U32 length = this->length(); + void StringBase::appendBuff(const CHAR* buff, SizeType size) { + const SizeType capacity = this->getCapacity(); + const SizeType length = this->length(); FW_ASSERT(capacity > length, capacity, length); // Subtract 1 to leave space for null terminator - U32 remaining = capacity - length - 1; + SizeType remaining = capacity - length - 1; if(size < remaining) { remaining = size; } @@ -120,21 +120,21 @@ namespace Fw { (void) strncat(const_cast(this->toChar()), buff, remaining); } - NATIVE_UINT_TYPE StringBase::length() const { - return static_cast(StringUtils::string_length(this->toChar(),this->getCapacity())); + StringBase::SizeType StringBase::length() const { + return static_cast(StringUtils::string_length(this->toChar(),this->getCapacity())); } SerializeStatus StringBase::serialize(SerializeBufferBase& buffer) const { return buffer.serialize(reinterpret_cast(this->toChar()),this->length()); } - SerializeStatus StringBase::serialize(SerializeBufferBase& buffer, NATIVE_UINT_TYPE maxLength) const { - NATIVE_INT_TYPE len = FW_MIN(maxLength,this->length()); + SerializeStatus StringBase::serialize(SerializeBufferBase& buffer, SizeType maxLength) const { + SizeType len = FW_MIN(maxLength,this->length()); return buffer.serialize(reinterpret_cast(this->toChar()), len); } SerializeStatus StringBase::deserialize(SerializeBufferBase& buffer) { - NATIVE_UINT_TYPE maxSize = this->getCapacity() - 1; + SizeType maxSize = this->getCapacity() - 1; CHAR* raw = const_cast(this->toChar()); SerializeStatus stat = buffer.deserialize(reinterpret_cast(raw),maxSize); // Null terminate deserialized string diff --git a/Fw/Types/StringType.hpp b/Fw/Types/StringType.hpp index 4264e3fc96..e74c777ba4 100644 --- a/Fw/Types/StringType.hpp +++ b/Fw/Types/StringType.hpp @@ -22,9 +22,10 @@ namespace Fw { class StringBase : public Serializable { public: + using SizeType = NATIVE_UINT_TYPE; virtual const CHAR* toChar() const = 0; //(min_priority)) { + if (priority != Task::TASK_DEFAULT and priority < static_cast(min_priority)) { Fw::Logger::logMsg("[WARNING] Low task priority of %d being clamped to %d\n", priority, min_priority); priority = min_priority; } - if (priority != Task::TASK_DEFAULT and priority > static_cast(max_priority)) { + if (priority != Task::TASK_DEFAULT and priority > static_cast(max_priority)) { Fw::Logger::logMsg("[WARNING] High task priority of %d being clamped to %d\n", priority, max_priority); priority = max_priority; } @@ -193,7 +193,7 @@ namespace Os { Task::Task() : m_handle(reinterpret_cast(nullptr)), m_identifier(0), m_affinity(-1), m_started(false), m_suspendedOnPurpose(false), m_routineWrapper() { } - Task::TaskStatus Task::start(const Fw::StringBase &name, taskRoutine routine, void* arg, NATIVE_UINT_TYPE priority, NATIVE_UINT_TYPE stackSize, NATIVE_UINT_TYPE cpuAffinity, NATIVE_UINT_TYPE identifier) { + Task::TaskStatus Task::start(const Fw::StringBase &name, taskRoutine routine, void* arg, ParamType priority, ParamType stackSize, ParamType cpuAffinity, ParamType identifier) { FW_ASSERT(routine); this->m_name = "TP_"; diff --git a/Os/Task.hpp b/Os/Task.hpp index 5e9d865195..be5e40fcf9 100644 --- a/Os/Task.hpp +++ b/Os/Task.hpp @@ -5,89 +5,89 @@ #include #include -#include #include +#include #include namespace Os { - class TaskRegistry; //!< forward declaration - class Task { - public: - static const NATIVE_UINT_TYPE TASK_DEFAULT; - typedef enum { - TASK_OK, //!< message sent/received okay - TASK_INVALID_PARAMS, //!< started task with invalid parameters - TASK_INVALID_STACK, //!< started with invalid stack size - TASK_UNKNOWN_ERROR, //!< unexpected error return value - TASK_INVALID_AFFINITY, //!< unable to set the task affinity - TASK_DELAY_ERROR, //!< error trying to delay the task - TASK_JOIN_ERROR, //!< error trying to join the task - TASK_ERROR_RESOURCES, //!< unable to allocate more tasks - TASK_ERROR_PERMISSION, //!< permissions error setting-up tasks - } TaskStatus ; +class TaskRegistry; //!< forward declaration +class Task { + public: + using ParamType = NATIVE_UINT_TYPE; + static const ParamType TASK_DEFAULT; + typedef enum { + TASK_OK, //!< message sent/received okay + TASK_INVALID_PARAMS, //!< started task with invalid parameters + TASK_INVALID_STACK, //!< started with invalid stack size + TASK_UNKNOWN_ERROR, //!< unexpected error return value + TASK_INVALID_AFFINITY, //!< unable to set the task affinity + TASK_DELAY_ERROR, //!< error trying to delay the task + TASK_JOIN_ERROR, //!< error trying to join the task + TASK_ERROR_RESOURCES, //!< unable to allocate more tasks + TASK_ERROR_PERMISSION, //!< permissions error setting-up tasks + } TaskStatus; - typedef void (*taskRoutine)(void* ptr); //!< prototype for task routine started in task context - - struct TaskRoutineWrapper { - taskRoutine routine; //!< contains the task entrypoint - void* arg; //!< contains the task entrypoint pointer - }; - - Task(); //!< constructor - virtual ~Task(); //!< destructor - - TaskStatus start(const Fw::StringBase &name, taskRoutine routine, void* arg, NATIVE_UINT_TYPE priority = TASK_DEFAULT, NATIVE_UINT_TYPE stackSize = TASK_DEFAULT, NATIVE_UINT_TYPE cpuAffinity = TASK_DEFAULT, NATIVE_UINT_TYPE identifier = TASK_DEFAULT); //!< start the task - - // Deprecated: only the name, routine, and argument are **required** parameters. This ordering of parameters is therefore inappropriate and will be removed in the future - DEPRECATED(TaskStatus start(const Fw::StringBase &name, NATIVE_INT_TYPE identifier, NATIVE_INT_TYPE priority, NATIVE_INT_TYPE stackSize, taskRoutine routine, void* arg, NATIVE_INT_TYPE cpuAffinity = static_cast(TASK_DEFAULT)), - "Please switch to start(Fw::StringBase &name, taskRoutine routine, void* arg, NATIVE_UINT_TYPE priority, NATIVE_UINT_TYPE stackSize, NATIVE_UINT_TYPE cpuAffinity, NATIVE_UINT_TYPE identifier)"); //!< start the task - I32 getIdentifier(); //!< get the identifier for the task - static TaskId getOsIdentifier(); //Gets the Os Task ID. Useful for passive components. - - static TaskStatus delay(NATIVE_UINT_TYPE msecs); //!< delay the task - static NATIVE_INT_TYPE getNumTasks(); - - TaskStatus join(void **value_ptr); //!< Wait for task to finish - void suspend(bool onPurpose = false); //!< suspend task - void resume(); //!< resume execution of task - bool wasSuspended(); //!< returns whether or not task was suspended on purpose - bool isSuspended(); //!< check with OS to see if it is suspended already - bool isStarted(); //!< check to see if task is started - void setStarted(bool started); //!< set task to started when thread is fully up. Avoids a VxWorks race condition. - /** - * Returns the task-handle owned by this task - */ - POINTER_CAST getRawHandle(); - - static void registerTaskRegistry(TaskRegistry* registry); - - private: - - POINTER_CAST m_handle; //!< handle for implementation specific task - NATIVE_INT_TYPE m_identifier; //!< thread independent identifier - TaskString m_name; //!< object name - NATIVE_INT_TYPE m_affinity; //!< CPU affinity for SMP targets - - void toString(char* buf, NATIVE_INT_TYPE buffSize); //!< print a string of the state of the task - bool m_started; //!< set when task has reached entry point - bool m_suspendedOnPurpose; //!< set when task was suspended in purpose (i.e. simulation) - TaskRoutineWrapper m_routineWrapper; //! Contains task entrypoint and argument for task wrapper - - static TaskRegistry* s_taskRegistry; //!< pointer to registered task - static NATIVE_INT_TYPE s_numTasks; //!< stores the number of tasks created. + typedef void (*taskRoutine)(void* ptr); //!< prototype for task routine started in task context + struct TaskRoutineWrapper { + taskRoutine routine; //!< contains the task entrypoint + void* arg; //!< contains the task entrypoint pointer }; - class TaskRegistry { - public: - TaskRegistry(); //!< constructor for task registry - virtual ~TaskRegistry(); //!< destructor for task registry - virtual void addTask(Task* task) = 0; //!< Add a task to the registry - virtual void removeTask(Task* task) = 0; //!< remove a task from the registry + Task(); //!< constructor + virtual ~Task(); //!< destructor - private: - }; -} + TaskStatus start(const Fw::StringBase& name, + taskRoutine routine, + void* arg, + ParamType priority = TASK_DEFAULT, + ParamType stackSize = TASK_DEFAULT, + ParamType cpuAffinity = TASK_DEFAULT, + ParamType identifier = TASK_DEFAULT); //!< start the task + + I32 getIdentifier(); //!< get the identifier for the task + static TaskId getOsIdentifier(); // Gets the Os Task ID. Useful for passive components. + + static TaskStatus delay(ParamType msecs); //!< delay the task + static NATIVE_INT_TYPE getNumTasks(); + + TaskStatus join(void** value_ptr); //!< Wait for task to finish + void suspend(bool onPurpose = false); //!< suspend task + void resume(); //!< resume execution of task + bool wasSuspended(); //!< returns whether or not task was suspended on purpose + bool isSuspended(); //!< check with OS to see if it is suspended already + bool isStarted(); //!< check to see if task is started + void setStarted(bool started); //!< set task to started when thread is fully up. Avoids a VxWorks race condition. + /** + * Returns the task-handle owned by this task + */ + POINTER_CAST getRawHandle(); + + static void registerTaskRegistry(TaskRegistry* registry); + + private: + POINTER_CAST m_handle; //!< handle for implementation specific task + NATIVE_INT_TYPE m_identifier; //!< thread independent identifier + TaskString m_name; //!< object name + NATIVE_INT_TYPE m_affinity; //!< CPU affinity for SMP targets + + void toString(char* buf, NATIVE_INT_TYPE buffSize); //!< print a string of the state of the task + bool m_started; //!< set when task has reached entry point + bool m_suspendedOnPurpose; //!< set when task was suspended in purpose (i.e. simulation) + TaskRoutineWrapper m_routineWrapper; //! Contains task entrypoint and argument for task wrapper + + static TaskRegistry* s_taskRegistry; //!< pointer to registered task + static NATIVE_INT_TYPE s_numTasks; //!< stores the number of tasks created. +}; + +class TaskRegistry { + public: + TaskRegistry(); //!< constructor for task registry + virtual ~TaskRegistry(); //!< destructor for task registry + virtual void addTask(Task* task) = 0; //!< Add a task to the registry + virtual void removeTask(Task* task) = 0; //!< remove a task from the registry +}; +} // namespace Os #endif diff --git a/Os/TaskCommon.cpp b/Os/TaskCommon.cpp index 023bf6f742..94f9cd9c2c 100644 --- a/Os/TaskCommon.cpp +++ b/Os/TaskCommon.cpp @@ -4,7 +4,7 @@ namespace Os { - const NATIVE_UINT_TYPE Task::TASK_DEFAULT = std::numeric_limits::max(); + const Task::ParamType Task::TASK_DEFAULT = std::numeric_limits::max(); TaskRegistry* Task::s_taskRegistry = nullptr; NATIVE_INT_TYPE Task::s_numTasks = 0; @@ -43,10 +43,6 @@ namespace Os { } - Task::TaskStatus Task::start(const Fw::StringBase &name, NATIVE_INT_TYPE identifier, NATIVE_INT_TYPE priority, NATIVE_INT_TYPE stackSize, taskRoutine routine, void* arg, NATIVE_INT_TYPE cpuAffinity) { - return this->start(name, routine, arg, priority, stackSize, cpuAffinity, identifier); - } - TaskRegistry::~TaskRegistry() { } diff --git a/RPI/RpiDemo/RpiDemoComponentImpl.cpp b/RPI/RpiDemo/RpiDemoComponentImpl.cpp index aa285559b6..d133f3bd65 100644 --- a/RPI/RpiDemo/RpiDemoComponentImpl.cpp +++ b/RPI/RpiDemo/RpiDemoComponentImpl.cpp @@ -81,7 +81,7 @@ namespace RPI { void RpiDemoComponentImpl :: Run_handler( const NATIVE_INT_TYPE portNum, - NATIVE_UINT_TYPE context + U32 context ) { // check which rate group call it is diff --git a/RPI/RpiDemo/RpiDemoComponentImpl.hpp b/RPI/RpiDemo/RpiDemoComponentImpl.hpp index 3b42dda276..27302d7901 100644 --- a/RPI/RpiDemo/RpiDemoComponentImpl.hpp +++ b/RPI/RpiDemo/RpiDemoComponentImpl.hpp @@ -67,7 +67,7 @@ namespace RPI { //! void Run_handler( const NATIVE_INT_TYPE portNum, /*!< The port number*/ - NATIVE_UINT_TYPE context /*!< The call order*/ + U32 context /*!< The call order*/ ) override; //! Handler implementation for UartRead diff --git a/Ref/SendBuffApp/SendBuffComponentImpl.cpp b/Ref/SendBuffApp/SendBuffComponentImpl.cpp index 6dc43b056f..a9335252bf 100644 --- a/Ref/SendBuffApp/SendBuffComponentImpl.cpp +++ b/Ref/SendBuffApp/SendBuffComponentImpl.cpp @@ -31,7 +31,7 @@ namespace Ref { SendBuffComponentBase::init(queueDepth,instance); } - void SendBuffImpl::SchedIn_handler(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context) { + void SendBuffImpl::SchedIn_handler(NATIVE_INT_TYPE portNum, U32 context) { // first, dequeue any messages diff --git a/Ref/SendBuffApp/SendBuffComponentImpl.hpp b/Ref/SendBuffApp/SendBuffComponentImpl.hpp index f1d4d61cac..7a9e742b74 100644 --- a/Ref/SendBuffApp/SendBuffComponentImpl.hpp +++ b/Ref/SendBuffApp/SendBuffComponentImpl.hpp @@ -17,7 +17,7 @@ namespace Ref { private: - void SchedIn_handler(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context); //!< downcall for input port + void SchedIn_handler(NATIVE_INT_TYPE portNum, U32 context); //!< downcall for input port void SB_START_PKTS_cmdHandler(FwOpcodeType opcode, U32 cmdSeq); //!< START_PKTS command handler void SB_INJECT_PKT_ERROR_cmdHandler(FwOpcodeType opcode, U32 cmdSeq); //!< START_PKTS command handler void SB_GEN_FATAL_cmdHandler( diff --git a/Ref/SignalGen/SignalGen.cpp b/Ref/SignalGen/SignalGen.cpp index 1d0e8a048b..a8f70404f9 100644 --- a/Ref/SignalGen/SignalGen.cpp +++ b/Ref/SignalGen/SignalGen.cpp @@ -97,7 +97,7 @@ namespace Ref { void SignalGen :: schedIn_handler( NATIVE_INT_TYPE portNum, /*!< The port number*/ - NATIVE_UINT_TYPE context /*!< The call order*/ + U32 context /*!< The call order*/ ) { F32 value = 0.0f; diff --git a/Ref/SignalGen/SignalGen.hpp b/Ref/SignalGen/SignalGen.hpp index ddad62b3d7..69b36c6e76 100644 --- a/Ref/SignalGen/SignalGen.hpp +++ b/Ref/SignalGen/SignalGen.hpp @@ -30,7 +30,7 @@ namespace Ref { void schedIn_handler( NATIVE_INT_TYPE portNum, /*!< The port number*/ - NATIVE_UINT_TYPE context /*!< The call order*/ + U32 context /*!< The call order*/ ); void SignalGen_Settings_cmdHandler( diff --git a/Svc/ActiveRateGroup/docs/sdd.md b/Svc/ActiveRateGroup/docs/sdd.md index d7e08f5ec4..392a2e54cd 100644 --- a/Svc/ActiveRateGroup/docs/sdd.md +++ b/Svc/ActiveRateGroup/docs/sdd.md @@ -45,7 +45,7 @@ The `Svc::ActiveRateGroup` component has one input port that is called to wake u A set of context values are passed in as an array to the configure function: ``` -void configure(NATIVE_UINT_TYPE contexts[], NATIVE_UINT_TYPE numContexts); +void configure(NATIVE_INT_TYPE contexts[], NATIVE_INT_TYPE numContexts); ``` A context value can be used by a component to discriminate between more than one call in the rate group. diff --git a/Svc/ActiveRateGroup/test/ut/ActiveRateGroupImplTester.cpp b/Svc/ActiveRateGroup/test/ut/ActiveRateGroupImplTester.cpp index 57e88a7ffa..f2e0972624 100644 --- a/Svc/ActiveRateGroup/test/ut/ActiveRateGroupImplTester.cpp +++ b/Svc/ActiveRateGroup/test/ut/ActiveRateGroupImplTester.cpp @@ -42,7 +42,7 @@ namespace Svc { ActiveRateGroupImplTester::~ActiveRateGroupImplTester() { } - void ActiveRateGroupImplTester::from_RateGroupMemberOut_handler(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context) { + void ActiveRateGroupImplTester::from_RateGroupMemberOut_handler(NATIVE_INT_TYPE portNum, U32 context) { ASSERT_TRUE(portNum < static_cast(FW_NUM_ARRAY_ELEMENTS(m_impl.m_RateGroupMemberOut_OutputPort))); this->m_callLog[portNum].portCalled = true; this->m_callLog[portNum].contextVal = context; diff --git a/Svc/ActiveRateGroup/test/ut/ActiveRateGroupImplTester.hpp b/Svc/ActiveRateGroup/test/ut/ActiveRateGroupImplTester.hpp index 53431da41e..3f930c0f78 100644 --- a/Svc/ActiveRateGroup/test/ut/ActiveRateGroupImplTester.hpp +++ b/Svc/ActiveRateGroup/test/ut/ActiveRateGroupImplTester.hpp @@ -34,7 +34,7 @@ namespace Svc { private: - void from_RateGroupMemberOut_handler(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context); + void from_RateGroupMemberOut_handler(NATIVE_INT_TYPE portNum, U32 context); //! Handler for from_PingOut //! @@ -49,7 +49,7 @@ namespace Svc { struct { bool portCalled; - NATIVE_UINT_TYPE contextVal; + U32 contextVal; NATIVE_UINT_TYPE order; } m_callLog[Svc::ActiveRateGroupComponentBase::NUM_RATEGROUPMEMBEROUT_OUTPUT_PORTS]; diff --git a/Svc/BufferLogger/BufferLogger.cpp b/Svc/BufferLogger/BufferLogger.cpp index 6f0df8ac11..bc4942a7c4 100644 --- a/Svc/BufferLogger/BufferLogger.cpp +++ b/Svc/BufferLogger/BufferLogger.cpp @@ -94,7 +94,7 @@ namespace Svc { void BufferLogger :: schedIn_handler( const NATIVE_INT_TYPE portNum, - NATIVE_UINT_TYPE context + U32 context ) { // TODO diff --git a/Svc/BufferLogger/BufferLogger.hpp b/Svc/BufferLogger/BufferLogger.hpp index b0e3511064..d5f9d87f6a 100644 --- a/Svc/BufferLogger/BufferLogger.hpp +++ b/Svc/BufferLogger/BufferLogger.hpp @@ -211,7 +211,7 @@ namespace Svc { //! void schedIn_handler( const NATIVE_INT_TYPE portNum, /*!< The port number*/ - NATIVE_UINT_TYPE context /*!< The call order*/ + U32 context /*!< The call order*/ ); PRIVATE: diff --git a/Svc/BufferManager/BufferManagerComponentImpl.cpp b/Svc/BufferManager/BufferManagerComponentImpl.cpp index a256f8c301..71952f2078 100644 --- a/Svc/BufferManager/BufferManagerComponentImpl.cpp +++ b/Svc/BufferManager/BufferManagerComponentImpl.cpp @@ -219,7 +219,7 @@ namespace Svc { void BufferManagerComponentImpl :: schedIn_handler( const NATIVE_INT_TYPE portNum, - NATIVE_UINT_TYPE context + U32 context ) { // write telemetry values diff --git a/Svc/BufferManager/BufferManagerComponentImpl.hpp b/Svc/BufferManager/BufferManagerComponentImpl.hpp index bc3b0ba10f..9d0fdf15a0 100644 --- a/Svc/BufferManager/BufferManagerComponentImpl.hpp +++ b/Svc/BufferManager/BufferManagerComponentImpl.hpp @@ -127,7 +127,7 @@ namespace Svc //! void schedIn_handler( const NATIVE_INT_TYPE portNum, /*!< The port number*/ - NATIVE_UINT_TYPE context /*!< The call order*/ + U32 context /*!< The call order*/ ); diff --git a/Svc/ComQueue/ComQueue.cpp b/Svc/ComQueue/ComQueue.cpp index 7ddf34f3a2..9f6728e635 100644 --- a/Svc/ComQueue/ComQueue.cpp +++ b/Svc/ComQueue/ComQueue.cpp @@ -155,7 +155,7 @@ void ComQueue::comStatusIn_handler(const NATIVE_INT_TYPE portNum, Fw::Success& c } } -void ComQueue::run_handler(const NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context) { +void ComQueue::run_handler(const NATIVE_INT_TYPE portNum, U32 context) { // Downlink the high-water marks for the Fw::ComBuffer array types ComQueueDepth comQueueDepth; for (FwSizeType i = 0; i < comQueueDepth.SIZE; i++) { diff --git a/Svc/ComQueue/ComQueue.hpp b/Svc/ComQueue/ComQueue.hpp index 2888bd1e7e..550be00c98 100644 --- a/Svc/ComQueue/ComQueue.hpp +++ b/Svc/ComQueue/ComQueue.hpp @@ -148,7 +148,7 @@ class ComQueue : public ComQueueComponentBase { //! Schedules the transmission of telemetry //! void run_handler(const NATIVE_INT_TYPE portNum, /*!< The port number*/ - NATIVE_UINT_TYPE context /*!m_mode.get()) diff --git a/Svc/FileDownlink/FileDownlink.hpp b/Svc/FileDownlink/FileDownlink.hpp index 2bbca103ed..dd51dc3297 100644 --- a/Svc/FileDownlink/FileDownlink.hpp +++ b/Svc/FileDownlink/FileDownlink.hpp @@ -304,7 +304,7 @@ namespace Svc { //! void Run_handler( const NATIVE_INT_TYPE portNum, //!< The port number - NATIVE_UINT_TYPE context //!< The call order + U32 context //!< The call order ); diff --git a/Svc/GroundInterface/GroundInterface.cpp b/Svc/GroundInterface/GroundInterface.cpp index b400fc3476..0e4638eb94 100644 --- a/Svc/GroundInterface/GroundInterface.cpp +++ b/Svc/GroundInterface/GroundInterface.cpp @@ -82,7 +82,7 @@ namespace Svc { void GroundInterfaceComponentImpl :: schedIn_handler( const NATIVE_INT_TYPE portNum, /*!< The port number*/ - NATIVE_UINT_TYPE context /*!< The call order*/ + U32 context /*!< The call order*/ ) { // TODO: replace with a call to a buffer manager diff --git a/Svc/GroundInterface/GroundInterface.hpp b/Svc/GroundInterface/GroundInterface.hpp index 747bb2abb8..b227cd1133 100644 --- a/Svc/GroundInterface/GroundInterface.hpp +++ b/Svc/GroundInterface/GroundInterface.hpp @@ -74,7 +74,7 @@ namespace Svc { //! void schedIn_handler( const NATIVE_INT_TYPE portNum, /*!< The port number*/ - NATIVE_UINT_TYPE context /*!< The call order*/ + U32 context /*!< The call order*/ ); //! Frame and send some data //! diff --git a/Svc/Health/HealthComponentImpl.cpp b/Svc/Health/HealthComponentImpl.cpp index adc9934f0a..ac920e5e24 100644 --- a/Svc/Health/HealthComponentImpl.cpp +++ b/Svc/Health/HealthComponentImpl.cpp @@ -82,7 +82,7 @@ namespace Svc { } - void HealthImpl::Run_handler(const NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context) { + void HealthImpl::Run_handler(const NATIVE_INT_TYPE portNum, U32 context) { //dispatch messages for (NATIVE_UINT_TYPE i = 0; i < this->queue_depth; i++) { MsgDispatchStatus stat = this->doDispatch(); diff --git a/Svc/Health/HealthComponentImpl.hpp b/Svc/Health/HealthComponentImpl.hpp index 7ecbd20f01..abaf9aa666 100644 --- a/Svc/Health/HealthComponentImpl.hpp +++ b/Svc/Health/HealthComponentImpl.hpp @@ -100,7 +100,7 @@ namespace Svc { //! //! \param portNum Port number //! \param context Port Context - void Run_handler(const NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context); + void Run_handler(const NATIVE_INT_TYPE portNum, U32 context); //! \brief HLTH_ENABLE handler //! diff --git a/Svc/PassiveRateGroup/PassiveRateGroup.hpp b/Svc/PassiveRateGroup/PassiveRateGroup.hpp index 5849fa5760..427c4c8786 100644 --- a/Svc/PassiveRateGroup/PassiveRateGroup.hpp +++ b/Svc/PassiveRateGroup/PassiveRateGroup.hpp @@ -67,7 +67,7 @@ class PassiveRateGroup : public PassiveRateGroupComponentBase { U32 m_cycles; //!< cycles executed U32 m_maxTime; //!< maximum execution time in microseconds NATIVE_INT_TYPE m_numContexts; //!< number of contexts - NATIVE_INT_TYPE m_contexts[NUM_RATEGROUPMEMBEROUT_OUTPUT_PORTS]; //!< Must match number of output ports + U32 m_contexts[NUM_RATEGROUPMEMBEROUT_OUTPUT_PORTS]; //!< Must match number of output ports }; } // namespace Svc diff --git a/Svc/PassiveRateGroup/test/ut/PassiveRateGroupImplTester.cpp b/Svc/PassiveRateGroup/test/ut/PassiveRateGroupImplTester.cpp index a201a0f422..3afea5c476 100644 --- a/Svc/PassiveRateGroup/test/ut/PassiveRateGroupImplTester.cpp +++ b/Svc/PassiveRateGroup/test/ut/PassiveRateGroupImplTester.cpp @@ -38,7 +38,7 @@ void PassiveRateGroupTester::clearPortCalls() { PassiveRateGroupTester::~PassiveRateGroupTester() {} -void PassiveRateGroupTester::from_RateGroupMemberOut_handler(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context) { +void PassiveRateGroupTester::from_RateGroupMemberOut_handler(NATIVE_INT_TYPE portNum, U32 context) { ASSERT_TRUE(portNum < static_cast(FW_NUM_ARRAY_ELEMENTS(m_impl.m_RateGroupMemberOut_OutputPort))); this->m_callLog[portNum].portCalled = true; this->m_callLog[portNum].contextVal = context; diff --git a/Svc/PassiveRateGroup/test/ut/PassiveRateGroupImplTester.hpp b/Svc/PassiveRateGroup/test/ut/PassiveRateGroupImplTester.hpp index 3edcb4e240..1d5e04b2dc 100644 --- a/Svc/PassiveRateGroup/test/ut/PassiveRateGroupImplTester.hpp +++ b/Svc/PassiveRateGroup/test/ut/PassiveRateGroupImplTester.hpp @@ -27,11 +27,11 @@ namespace Svc { void init(NATIVE_INT_TYPE instance = 0); - void runNominal(NATIVE_UINT_TYPE contexts[], NATIVE_UINT_TYPE numContexts, NATIVE_INT_TYPE instance); + void runNominal(U32 contexts[], U32 numContexts, NATIVE_INT_TYPE instance); private: - void from_RateGroupMemberOut_handler(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context); + void from_RateGroupMemberOut_handler(NATIVE_INT_TYPE portNum, U32 context); Svc::PassiveRateGroup& m_impl; @@ -39,7 +39,7 @@ namespace Svc { struct { bool portCalled; - NATIVE_UINT_TYPE contextVal; + U32 contextVal; NATIVE_UINT_TYPE order; } m_callLog[Svc::PassiveRateGroupComponentBase::NUM_RATEGROUPMEMBEROUT_OUTPUT_PORTS]; diff --git a/Svc/PassiveRateGroup/test/ut/PassiveRateGroupTester.hpp b/Svc/PassiveRateGroup/test/ut/PassiveRateGroupTester.hpp index 9f4f4f0071..aa9c65d569 100644 --- a/Svc/PassiveRateGroup/test/ut/PassiveRateGroupTester.hpp +++ b/Svc/PassiveRateGroup/test/ut/PassiveRateGroupTester.hpp @@ -27,11 +27,11 @@ namespace Svc { void init(NATIVE_INT_TYPE instance = 0); - void runNominal(NATIVE_INT_TYPE contexts[], NATIVE_UINT_TYPE numContexts, NATIVE_INT_TYPE instance); + void runNominal(NATIVE_INT_TYPE contexts[], U32 numContexts, NATIVE_INT_TYPE instance); private: - void from_RateGroupMemberOut_handler(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context); + void from_RateGroupMemberOut_handler(NATIVE_INT_TYPE portNum, U32 context); Svc::PassiveRateGroup& m_impl; @@ -39,11 +39,11 @@ namespace Svc { struct { bool portCalled; - NATIVE_UINT_TYPE contextVal; + U32 contextVal; NATIVE_UINT_TYPE order; } m_callLog[Svc::PassiveRateGroupComponentBase::NUM_RATEGROUPMEMBEROUT_OUTPUT_PORTS]; - NATIVE_UINT_TYPE m_callOrder; //!< tracks order of port call. + U32 m_callOrder; //!< tracks order of port call. }; diff --git a/Svc/Sched/Sched.fpp b/Svc/Sched/Sched.fpp index 9911bf48bd..fdc57b8e6a 100644 --- a/Svc/Sched/Sched.fpp +++ b/Svc/Sched/Sched.fpp @@ -2,7 +2,7 @@ module Svc { @ Scheduler Port with order argument port Sched( - context: NATIVE_UINT_TYPE @< The call order + context: U32 @< The call order ) } diff --git a/Svc/SystemResources/SystemResources.cpp b/Svc/SystemResources/SystemResources.cpp index 7de8f3b36f..23c1c5701d 100644 --- a/Svc/SystemResources/SystemResources.cpp +++ b/Svc/SystemResources/SystemResources.cpp @@ -68,7 +68,7 @@ SystemResources ::~SystemResources() {} // Handler implementations for user-defined typed input ports // ---------------------------------------------------------------------- -void SystemResources ::run_handler(const NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE tick_time_hz) { +void SystemResources ::run_handler(const NATIVE_INT_TYPE portNum, U32 tick_time_hz) { if (m_enable) { Cpu(); Mem(); diff --git a/Svc/SystemResources/SystemResources.hpp b/Svc/SystemResources/SystemResources.hpp index e8c2f2dab1..7807a7e067 100644 --- a/Svc/SystemResources/SystemResources.hpp +++ b/Svc/SystemResources/SystemResources.hpp @@ -51,7 +51,7 @@ class SystemResources : public SystemResourcesComponentBase { //! void run_handler(const NATIVE_INT_TYPE portNum, /*!< The port number*/ - NATIVE_UINT_TYPE context /*!< The call order*/ + U32 context /*!< The call order*/ ); private: diff --git a/Svc/TlmChan/TlmChan.cpp b/Svc/TlmChan/TlmChan.cpp index 5de97f72dd..924dd59ba0 100644 --- a/Svc/TlmChan/TlmChan.cpp +++ b/Svc/TlmChan/TlmChan.cpp @@ -134,7 +134,7 @@ void TlmChan::TlmRecv_handler(NATIVE_INT_TYPE portNum, FwChanIdType id, Fw::Time entryToUse->buffer = val; } -void TlmChan::Run_handler(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context) { +void TlmChan::Run_handler(NATIVE_INT_TYPE portNum, U32 context) { // Only write packets if connected if (not this->isConnected_PktSend_OutputPort(0)) { return; diff --git a/Svc/TlmChan/TlmChan.hpp b/Svc/TlmChan/TlmChan.hpp index cbd30b1d67..0aca5b13a6 100644 --- a/Svc/TlmChan/TlmChan.hpp +++ b/Svc/TlmChan/TlmChan.hpp @@ -35,7 +35,7 @@ class TlmChan : public TlmChanComponentBase { // Port functions void TlmRecv_handler(NATIVE_INT_TYPE portNum, FwChanIdType id, Fw::Time& timeTag, Fw::TlmBuffer& val); void TlmGet_handler(NATIVE_INT_TYPE portNum, FwChanIdType id, Fw::Time& timeTag, Fw::TlmBuffer& val); - void Run_handler(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context); + void Run_handler(NATIVE_INT_TYPE portNum, U32 context); //! Handler implementation for pingIn //! void pingIn_handler(const NATIVE_INT_TYPE portNum, /*!< The port number*/ diff --git a/Svc/TlmPacketizer/TlmPacketizer.cpp b/Svc/TlmPacketizer/TlmPacketizer.cpp index e35990b9ea..9274d1bc4e 100644 --- a/Svc/TlmPacketizer/TlmPacketizer.cpp +++ b/Svc/TlmPacketizer/TlmPacketizer.cpp @@ -236,7 +236,7 @@ void TlmPacketizer ::TlmRecv_handler(const NATIVE_INT_TYPE portNum, } } -void TlmPacketizer ::Run_handler(const NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context) { +void TlmPacketizer ::Run_handler(const NATIVE_INT_TYPE portNum, U32 context) { FW_ASSERT(this->m_configured); // Only write packets if connected diff --git a/Svc/TlmPacketizer/TlmPacketizer.hpp b/Svc/TlmPacketizer/TlmPacketizer.hpp index 4957bb3cd9..30e765b0b1 100644 --- a/Svc/TlmPacketizer/TlmPacketizer.hpp +++ b/Svc/TlmPacketizer/TlmPacketizer.hpp @@ -60,7 +60,7 @@ class TlmPacketizer : public TlmPacketizerComponentBase { //! Handler implementation for Run //! void Run_handler(const NATIVE_INT_TYPE portNum, /*!< The port number*/ - NATIVE_UINT_TYPE context /*!< The call order*/ + U32 context /*!< The call order*/ ); //! Handler implementation for pingIn diff --git a/Svc/UdpReceiver/UdpReceiverComponentImpl.cpp b/Svc/UdpReceiver/UdpReceiverComponentImpl.cpp index 3a38ffbec9..71042dc162 100644 --- a/Svc/UdpReceiver/UdpReceiverComponentImpl.cpp +++ b/Svc/UdpReceiver/UdpReceiverComponentImpl.cpp @@ -118,7 +118,7 @@ namespace Svc { void UdpReceiverComponentImpl :: Sched_handler( const NATIVE_INT_TYPE portNum, - NATIVE_UINT_TYPE context + U32 context ) { this->tlmWrite_UR_BytesReceived(this->m_bytesReceived); diff --git a/Svc/UdpReceiver/UdpReceiverComponentImpl.hpp b/Svc/UdpReceiver/UdpReceiverComponentImpl.hpp index 7d91d24051..2d2da13bf7 100644 --- a/Svc/UdpReceiver/UdpReceiverComponentImpl.hpp +++ b/Svc/UdpReceiver/UdpReceiverComponentImpl.hpp @@ -67,7 +67,7 @@ namespace Svc { //! void Sched_handler( const NATIVE_INT_TYPE portNum, /*!< The port number*/ - NATIVE_UINT_TYPE context /*!< The call order*/ + U32 context /*!< The call order*/ ); static void workerTask(void* ptr); //!< worker task entry point diff --git a/Svc/UdpSender/UdpSenderComponentImpl.cpp b/Svc/UdpSender/UdpSenderComponentImpl.cpp index 43b2fc1ef6..e409b3d162 100644 --- a/Svc/UdpSender/UdpSenderComponentImpl.cpp +++ b/Svc/UdpSender/UdpSenderComponentImpl.cpp @@ -93,7 +93,7 @@ namespace Svc { void UdpSenderComponentImpl :: Sched_handler( const NATIVE_INT_TYPE portNum, - NATIVE_UINT_TYPE context + U32 context ) { this->tlmWrite_US_BytesSent(this->m_bytesSent); diff --git a/Svc/UdpSender/UdpSenderComponentImpl.hpp b/Svc/UdpSender/UdpSenderComponentImpl.hpp index 5ed8194a35..fa136f681e 100644 --- a/Svc/UdpSender/UdpSenderComponentImpl.hpp +++ b/Svc/UdpSender/UdpSenderComponentImpl.hpp @@ -67,7 +67,7 @@ namespace Svc { //! void Sched_handler( const NATIVE_INT_TYPE portNum, /*!< The port number*/ - NATIVE_UINT_TYPE context /*!< The call order*/ + U32 context /*!< The call order*/ ); PRIVATE: diff --git a/cmake/test/data/test-fprime-library/TestLibrary/TestComponent/TestComponent.cpp b/cmake/test/data/test-fprime-library/TestLibrary/TestComponent/TestComponent.cpp index 36b06edbab..6ad35c57ba 100644 --- a/cmake/test/data/test-fprime-library/TestLibrary/TestComponent/TestComponent.cpp +++ b/cmake/test/data/test-fprime-library/TestLibrary/TestComponent/TestComponent.cpp @@ -12,5 +12,5 @@ void TestComponent ::init(const NATIVE_INT_TYPE instance) { TestComponent ::~TestComponent() {} -void TestComponent ::schedIn_handler(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context) {} +void TestComponent ::schedIn_handler(NATIVE_INT_TYPE portNum, U32 context) {} }; diff --git a/cmake/test/data/test-fprime-library/TestLibrary/TestComponent/TestComponent.hpp b/cmake/test/data/test-fprime-library/TestLibrary/TestComponent/TestComponent.hpp index a25621d479..44852e2c2f 100644 --- a/cmake/test/data/test-fprime-library/TestLibrary/TestComponent/TestComponent.hpp +++ b/cmake/test/data/test-fprime-library/TestLibrary/TestComponent/TestComponent.hpp @@ -12,7 +12,7 @@ class TestComponent : public TestComponentComponentBase void init(const NATIVE_INT_TYPE instance); ~TestComponent(); private: - void schedIn_handler(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context); + void schedIn_handler(NATIVE_INT_TYPE portNum, U32 context); }; }; diff --git a/cmake/test/data/test-fprime-library2/TestLibrary2/TestComponent/TestComponent.cpp b/cmake/test/data/test-fprime-library2/TestLibrary2/TestComponent/TestComponent.cpp index a7019845ca..9469691d31 100644 --- a/cmake/test/data/test-fprime-library2/TestLibrary2/TestComponent/TestComponent.cpp +++ b/cmake/test/data/test-fprime-library2/TestLibrary2/TestComponent/TestComponent.cpp @@ -12,5 +12,5 @@ void TestComponent ::init(const NATIVE_INT_TYPE instance) { TestComponent ::~TestComponent() {} -void TestComponent ::schedIn_handler(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context) {} +void TestComponent ::schedIn_handler(NATIVE_INT_TYPE portNum, U32 context) {} }; diff --git a/cmake/test/data/test-fprime-library2/TestLibrary2/TestComponent/TestComponent.hpp b/cmake/test/data/test-fprime-library2/TestLibrary2/TestComponent/TestComponent.hpp index 417d19ff12..4dda8355f3 100644 --- a/cmake/test/data/test-fprime-library2/TestLibrary2/TestComponent/TestComponent.hpp +++ b/cmake/test/data/test-fprime-library2/TestLibrary2/TestComponent/TestComponent.hpp @@ -12,7 +12,7 @@ class TestComponent : public TestComponentComponentBase void init(const NATIVE_INT_TYPE instance); ~TestComponent(); private: - void schedIn_handler(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context); + void schedIn_handler(NATIVE_INT_TYPE portNum, U32 context); }; }; diff --git a/config/FpConfig.fpp b/config/FpConfig.fpp index 1769f8c459..d0ca9b28be 100644 --- a/config/FpConfig.fpp +++ b/config/FpConfig.fpp @@ -12,6 +12,3 @@ type FwSizeType type FwTimeBaseStoreType type FwTimeContextStoreType type FwTlmPacketizeIdType -type NATIVE_INT_TYPE -type NATIVE_UINT_TYPE -type POINTER_CAST diff --git a/config/FpConfig.h b/config/FpConfig.h index a1b9a95856..35e8b01248 100644 --- a/config/FpConfig.h +++ b/config/FpConfig.h @@ -12,27 +12,42 @@ #ifndef FPCONFIG_H_ #define FPCONFIG_H_ +// ---------------------------------------------------------------------- +// Type aliases +// ---------------------------------------------------------------------- + +// The type of port indices and smaller sizes internal to the software typedef PlatformIndexType FwIndexType; #define PRI_FwIndexType PRI_PlatformIndexType +// The signed type of larger sizes internal to the software, e.g., memory buffer sizes, +// file sizes typedef PlatformSignedSizeType FwSignedSizeType; #define PRI_FwSignedSizeType PRI_PlatformSignedSizeType +// The unsigned type of larger sizes internal to the software, e.g., memory buffer sizes, +// file sizes typedef PlatformSizeType FwSizeType; #define PRI_FwSizeType PRI_PlatformSizeType +// The type of an assertion argument typedef PlatformAssertArgType FwAssertArgType; #define PRI_FwAssertArgType PRI_PlatformAssertArgType +// The type of a machine integer. Ordinarily this should be int. typedef PlatformIntType FwNativeIntType; #define PRI_FwNativeIntType PRI_PlatformIntType +// The type of a machine unsigned integer. Ordinarily this should be unsigned int. typedef PlatformUIntType FwNativeUIntType; #define PRI_FwNativeUIntType PRI_PlatformUIntType +// The type used to serialize a size value typedef U16 FwSizeStoreType; #define PRI_FwSizeStoreType PRIu16 +// The type used to serialize a C++ enumeration constant +// FPP enumerations are serialized according to their representation types typedef I32 FwEnumStoreType; #define PRI_FwEnumStoreType PRId32 @@ -47,36 +62,65 @@ typedef enum { } TimeBase; #define FW_CONTEXT_DONT_CARE 0xFF //!< Don't care value for time contexts in sequences +// The type used to serialize a time base value typedef U16 FwTimeBaseStoreType; #define PRI_FwTimeBaseStoreType PRIu16 +// The type used to serialize a time context value typedef U8 FwTimeContextStoreType; #define PRI_FwTimeContextStoreType PRIu8 +// The type of a com packet descriptor typedef U32 FwPacketDescriptorType; #define PRI_FwPacketDescriptorType PRIu32 +// The type of a command opcode typedef U32 FwOpcodeType; #define PRI_FwOpcodeType PRIu32 +// The type of a telemetry channel identifier typedef U32 FwChanIdType; #define PRI_FwChanIdType PRIu32 +// The type of an event identifier typedef U32 FwEventIdType; #define PRI_FwEventIdType PRIu32 +// The type of a parameter identifier typedef U32 FwPrmIdType; #define PRI_FwPrmIdType PRIu32 +// The type of a telemetry packet identifier typedef U16 FwTlmPacketizeIdType; #define PRI_FwTlmPacketizeIdType PRIu16 +// The type of a queue priority +typedef I32 FwQueuePriorityType; +#define PRI_FwQueuePriorityType PRId32 + +// The type of a data product identifier typedef U32 FwDpIdType; #define PRI_FwDpIdType PRIu32 +// The type of a data product priority typedef U32 FwDpPriorityType; #define PRI_FwDpPriorityType PRIu32 +// ---------------------------------------------------------------------- +// Derived type aliases +// By default, these types are aliases of types defined above +// If necessary, you can change these definitions +// In most cases, the defaults should work +// ---------------------------------------------------------------------- + +// The type of a queue size +typedef FwIndexType FwQueueSizeType; +#define PRI_FwQueueSizeType PRI_FwIndexType + +// ---------------------------------------------------------------------- +// Configuration switches +// ---------------------------------------------------------------------- + // Boolean values for serialization #ifndef FW_SERIALIZE_TRUE_VALUE #define FW_SERIALIZE_TRUE_VALUE (0xFF) //!< Value encoded during serialization for boolean true