From ff5b64daffef7f2b45b83e0fd8ac623ca9e9be38 Mon Sep 17 00:00:00 2001 From: Cel Skeggs Date: Thu, 27 Feb 2025 11:12:14 -0800 Subject: [PATCH] Add new Fw.Ready port for coordinating startup (#3261) --- Fw/CMakeLists.txt | 1 + Fw/Ports/Ready/CMakeLists.txt | 9 +++++++++ Fw/Ports/Ready/Ready.fpp | 23 +++++++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 Fw/Ports/Ready/CMakeLists.txt create mode 100644 Fw/Ports/Ready/Ready.fpp diff --git a/Fw/CMakeLists.txt b/Fw/CMakeLists.txt index af9913d16e..65b97cac69 100644 --- a/Fw/CMakeLists.txt +++ b/Fw/CMakeLists.txt @@ -19,6 +19,7 @@ add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/FilePacket/") add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Obj/") add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Port/") add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Ports/CompletionStatus") +add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Ports/Ready") add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Ports/Signal") add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Ports/SuccessCondition") add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/SerializableFile/") diff --git a/Fw/Ports/Ready/CMakeLists.txt b/Fw/Ports/Ready/CMakeLists.txt new file mode 100644 index 0000000000..ab6c3749cc --- /dev/null +++ b/Fw/Ports/Ready/CMakeLists.txt @@ -0,0 +1,9 @@ +#### +# CMakeLists.txt: +# +# Sets up the fprime module build within CMake. +#### +set(SOURCE_FILES + "${CMAKE_CURRENT_LIST_DIR}/Ready.fpp" +) +register_fprime_module() diff --git a/Fw/Ports/Ready/Ready.fpp b/Fw/Ports/Ready/Ready.fpp new file mode 100644 index 0000000000..1f2de57398 --- /dev/null +++ b/Fw/Ports/Ready/Ready.fpp @@ -0,0 +1,23 @@ +##### +# Ready: +# +# A port without arguments for coordinating startup. +##### + +module Fw { + @ As an input: Request that a component start operating or indicate that + @ the prerequisites for the component are satisfied. + @ As an output: Indicate that a component is now operating normally and is + @ ready to service requests. + @ + @ Each Ready port shall be invoked once. + @ - Invoking a Ready port more than once is a coding defect worthy of an + @ assertion. + @ - Failing to invoke a Ready port is a coding defect that may result in a + @ component remaining inoperative or not becoming fully operative. + @ - It may be a coding defect worthy of an assertion, depending on the + @ specification for each component, to attempt to operate a component + @ that is not ready: that is, a component that has not received all + @ Ready inputs or has not yet invoked all Ready outputs. + port Ready() +}