mirror of
https://github.com/nasa/fprime.git
synced 2026-04-13 02:27:38 -05:00
* Add a state machine unit test under FppTest * Updated the base class and unit tests work * Remove the sendEvent function as it did not allow for data to be passed * Add state machine in SmTest.fpp * Add dependency in SmTest.fpp * state machine unit test passes with new fpp phase 1 * Makefile for state machines don't use special switch * Rebase DeviceSm.hpp * Update on SMEvents inclusion * Use latest phase1 fpp and STARS which uses _Interface * Change SMEvents to SMSignals * Use SMSignals instead of SMEvents * Update test for state machine instance priority and full queue behavior * Update requirements to use new fpp version * Removed unneeded files * update FppTest for new autocoder changes * Get unit tests updated and working for fpp state machines phase 1 delivery * Rename Fw/SMTest to Fw/Sm * Update STARS to use FW_ASSERT * Rename SMSignalBuffer to SmSignalBuffer * Fix spelling issues with CI * Update requirements to the FPP alpha release v2.2.0a3 * Fix requirements.txt * Fix requirements.txt * Initialize data in the constructor of SmSignalBuffer * Add constructor list to all the constructors in SmSignalBuffer * Fixes for reserved word state and address review comments * Fix other review issues pertaining to unit tests and argument checks in the SmSignalBuffer constructors * Add a cast to NATIVE_UINT_TYPE in SmSignalBuffer * Fixing type * Fixing size type in cpp --------- Co-authored-by: watney <garth.j.watney@jpl.nasa.gov> Co-authored-by: Rob Bocchino <bocchino@jpl.nasa.gov> Co-authored-by: M Starch <LeStarch@googlemail.com>
99 lines
2.3 KiB
C++
99 lines
2.3 KiB
C++
|
|
// ======================================================================
|
|
// \title HackSm.cpp
|
|
// \author Auto-generated
|
|
// \brief cpp file for state machine HackSm
|
|
//
|
|
// ======================================================================
|
|
|
|
#include <Fw/Types/Assert.hpp>
|
|
#include "HackSm.hpp"
|
|
|
|
|
|
void FppTest::HackSm::init(const FwEnumStoreType stateMachineId)
|
|
{
|
|
parent->HackSm_turnOff(stateMachineId);
|
|
this->state = OFF;
|
|
|
|
}
|
|
|
|
|
|
void FppTest::HackSm::update(
|
|
const FwEnumStoreType stateMachineId,
|
|
const HackSm_Interface::HackSm_Signals signal,
|
|
const Fw::SmSignalBuffer &data
|
|
)
|
|
{
|
|
switch (this->state) {
|
|
|
|
/**
|
|
* state OFF
|
|
*/
|
|
case OFF:
|
|
|
|
switch (signal) {
|
|
|
|
case HackSm_Interface::HackSm_Signals::RTI_SIG:
|
|
parent->HackSm_turnOn(stateMachineId);
|
|
this->state = ON;
|
|
|
|
break;
|
|
|
|
case HackSm_Interface::HackSm_Signals::CHECK_SIG:
|
|
parent->HackSm_doDiag(stateMachineId);
|
|
this->state = DIAG;
|
|
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
break;
|
|
|
|
/**
|
|
* state ON
|
|
*/
|
|
case ON:
|
|
|
|
switch (signal) {
|
|
|
|
case HackSm_Interface::HackSm_Signals::RTI_SIG:
|
|
parent->HackSm_turnOff(stateMachineId);
|
|
this->state = OFF;
|
|
|
|
break;
|
|
|
|
case HackSm_Interface::HackSm_Signals::CHECK_SIG:
|
|
parent->HackSm_doDiag(stateMachineId);
|
|
this->state = DIAG;
|
|
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
break;
|
|
|
|
/**
|
|
* state DIAG
|
|
*/
|
|
case DIAG:
|
|
|
|
switch (signal) {
|
|
|
|
case HackSm_Interface::HackSm_Signals::RTI_SIG:
|
|
parent->HackSm_turnOff(stateMachineId);
|
|
this->state = OFF;
|
|
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
break;
|
|
|
|
default:
|
|
FW_ASSERT(0);
|
|
}
|
|
}
|