Skip to content

Commit

Permalink
Remove unused header in state machine code gen
Browse files Browse the repository at this point in the history
Fix related bug in code gen
Update unit tests
  • Loading branch information
bocchino committed Sep 2, 2024
1 parent ecb8b6a commit 6efa37a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ case class ComponentCppWriter (
guardedList (hasEvents) (List("Fw/Log/LogString.hpp"))
val internalStrHeaders =
guardedList (hasInternalPorts) (List("Fw/Types/InternalInterfaceString.hpp"))
val stateMachineEventHeaders =
guardedList (hasStateMachineInstances) (List("Fw/Types/SMSignalsSerializableAc.hpp"))

val standardHeaders = List.concat(
List(
Expand All @@ -111,8 +109,7 @@ case class ComponentCppWriter (
tlmStrHeaders,
prmStrHeaders,
logStrHeaders,
internalStrHeaders,
stateMachineEventHeaders
internalStrHeaders
).map(CppWriter.headerString)
val symbolHeaders = writeIncludeDirectives
val headers = standardHeaders ++ symbolHeaders
Expand Down Expand Up @@ -341,7 +338,7 @@ case class ComponentCppWriter (
lines(
s"""|// Size of statemachine sendSignals
|BYTE sendSignalsStatemachineSize[
| Fw::SMSignals::SERIALIZED_SIZE
| 2 * sizeof(FwEnumStoreType) + Fw::SMSignalBuffer::SERIALIZED_SIZE
|];
|"""
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace M {
union BuffUnion {
// Size of statemachine sendSignals
BYTE sendSignalsStatemachineSize[
Fw::SMSignals::SERIALIZED_SIZE
2 * sizeof(FwEnumStoreType) + Fw::SMSignalBuffer::SERIALIZED_SIZE
];
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "Fw/Comp/ActiveComponentBase.hpp"
#include "Fw/Port/InputSerializePort.hpp"
#include "Fw/Port/OutputSerializePort.hpp"
#include "Fw/Types/SMSignalsSerializableAc.hpp"

namespace M {

Expand Down
6 changes: 0 additions & 6 deletions compiler/tools/fpp-to-cpp/test/fprime/Fw/Types/Types.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ module Fw {
NO_ROOM_LEFT @< No room left in the buffer to serialize data
}

struct SMSignals {
smId : U32
eventSignal: U32
payload: [128] U8
}

@ Deserialization status
enum DeserialStatus {
OK = 0
Expand Down

0 comments on commit 6efa37a

Please sign in to comment.