nasa / fpp

F Prime Prime: A modeling language for F Prime
https://fprime.jpl.nasa.gov
Apache License 2.0
49 stars 31 forks source link

`fpp-to-cpp` Generates Broken C++ #315

Closed LeStarch closed 1 year ago

LeStarch commented 1 year ago

In a component with a guarded command, the C++ will not compile. See: https://github.com/fprime-community/fprime-baremetal-reference/issues/12

LeStarch commented 1 year ago

Minimal reproduction test case:

Component FPP

module Ref {
    @ Component for F Prime FSW framework.
    passive component MyComponent {
        @ Broken port
        guarded command COMMAND_NAME(param_name: U32)

        ###############################################################################
        # Standard AC Ports: Required for Channels, Events, Commands, and Parameters  #
        ###############################################################################

        @ Port for requesting the current time
        time get port timeCaller

        @ Port for sending command registrations
        command reg port cmdRegOut

        @ Port for receiving commands
        command recv port cmdIn

        @ Port for sending command responses
        command resp port cmdResponseOut

    }
}

Error

[100%] Building CXX object Ref/MyComponent/CMakeFiles/Ref_MyComponent.dir/MyComponentComponentAc.cpp.o
/Users/mstarch/code/fprime-infrastructure/fprime/Ref/build-fprime-automatic-native/Ref/MyComponent/MyComponentComponentAc.cpp:432:11: error: no member named 'lock' in 'Ref::MyComponentComponentBase'
    this->lock();
    ~~~~  ^
/Users/mstarch/code/fprime-infrastructure/fprime/Ref/build-fprime-automatic-native/Ref/MyComponent/MyComponentComponentAc.cpp:439:11: error: no member named 'unLock' in 'Ref::MyComponentComponentBase'
    this->unLock();
    ~~~~  ^
2 errors generated.
LeStarch commented 1 year ago

Fixed!!!!