mirror of
https://github.com/nasa/fpp.git
synced 2025-12-10 17:29:15 -06:00
Revise code gen for port invocations
This commit is contained in:
parent
6a85b4799e
commit
2db9e58f1b
@ -123,11 +123,12 @@ case class TopComponentCppWriter (
|
||||
)
|
||||
}
|
||||
|
||||
private def writeOutFnCase(portNum: Int, connection: Connection) = {
|
||||
private def writeOutFnCase(fromPortNum: Int, connection: Connection) = {
|
||||
val fromPort = connection.from.port
|
||||
val fromPortInstance = connection.from.port.portInstance
|
||||
val toPort = connection.to.port
|
||||
val toPortInstance = connection.to.port.portInstance
|
||||
val toPortNum = topology.toPortNumberMap(connection)
|
||||
val componentInstanceName = CppWriter.writeQualifiedName(toPort.componentInstance.qualifiedName)
|
||||
val portName = toPortInstance.getUnqualifiedName
|
||||
val handlerBaseName = inputPortHandlerBaseName(portName)
|
||||
@ -138,7 +139,7 @@ case class TopComponentCppWriter (
|
||||
case (_: PortInstance.Type.DefPort, _: PortInstance.Type.DefPort) =>
|
||||
writeFunctionCall(
|
||||
addResultPrefix(fnName),
|
||||
List("portNum"),
|
||||
List(toPortNum.toString),
|
||||
getPortParams(toPort.portInstance).map(_._1)
|
||||
)
|
||||
case (_: PortInstance.Type.DefPort, _) =>
|
||||
|
||||
@ -213,7 +213,7 @@ namespace M {
|
||||
case ::M::InstanceIds::M_passive1:
|
||||
switch (portNum) {
|
||||
case 0:
|
||||
active1.p_handlerBase(portNum);
|
||||
active1.p_handlerBase(0);
|
||||
break;
|
||||
default:
|
||||
FW_ASSERT(0, static_cast<FwAssertArgType>(portNum));
|
||||
@ -223,7 +223,7 @@ namespace M {
|
||||
case ::M::InstanceIds::M_passive2:
|
||||
switch (portNum) {
|
||||
case 0:
|
||||
M::active2.p_handlerBase(portNum);
|
||||
M::active2.p_handlerBase(0);
|
||||
break;
|
||||
default:
|
||||
FW_ASSERT(0, static_cast<FwAssertArgType>(portNum));
|
||||
|
||||
@ -207,7 +207,7 @@ namespace M {
|
||||
switch (portNum) {
|
||||
case 0:
|
||||
M::health.pingIn_handlerBase(
|
||||
portNum,
|
||||
0,
|
||||
key
|
||||
);
|
||||
break;
|
||||
@ -220,7 +220,7 @@ namespace M {
|
||||
switch (portNum) {
|
||||
case 0:
|
||||
M::health.pingIn_handlerBase(
|
||||
portNum,
|
||||
1,
|
||||
key
|
||||
);
|
||||
break;
|
||||
@ -282,13 +282,13 @@ namespace Svc {
|
||||
switch (portNum) {
|
||||
case 0:
|
||||
M::c1.pingIn_handlerBase(
|
||||
portNum,
|
||||
0,
|
||||
key
|
||||
);
|
||||
break;
|
||||
case 1:
|
||||
M::c2.pingIn_handlerBase(
|
||||
portNum,
|
||||
0,
|
||||
key
|
||||
);
|
||||
break;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user