EoWo Datasource running

Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
This commit is contained in:
2024-04-19 15:45:37 +01:00
parent 9b01d22ea4
commit 70ae1b862c
3 changed files with 14 additions and 2 deletions

View File

@@ -40,7 +40,7 @@
#include "AtcaIopADC.h" #include "AtcaIopADC.h"
#include "atca-v6-iop-ioctl.h" #include "atca-v6-iop-ioctl.h"
#define DEBUG_POLL 1 #define DEBUG_POLL 32768
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* Static definitions */ /* Static definitions */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
@@ -660,7 +660,7 @@ ErrorManagement::ErrorType AtcaIopADC::Execute(ExecutionInfo& info) {
oldestBufferIdx = GetOldestBufferIdx(); oldestBufferIdx = GetOldestBufferIdx();
float32 totalSleepTime = static_cast<float32>(static_cast<float64>(deltaTicks) * HighResolutionTimer::Period()); float32 totalSleepTime = static_cast<float32>(static_cast<float64>(deltaTicks) * HighResolutionTimer::Period());
#ifdef DEBUG_POLL #ifdef DEBUG_POLL
if((execCounter++)%4096 == 0) { if((execCounter++)%DEBUG_POLL == 0) {
REPORT_ERROR(ErrorManagement::Information, "Executor sleepTime: %f pollTimout: %d", totalSleepTime, pollTimout); REPORT_ERROR(ErrorManagement::Information, "Executor sleepTime: %f pollTimout: %d", totalSleepTime, pollTimout);
} }
#endif #endif

View File

@@ -64,6 +64,7 @@ namespace MARTe {
//channelsMemory = NULL_PTR(float32 *); //channelsMemory = NULL_PTR(float32 *);
eoValues = NULL_PTR(int32 *); eoValues = NULL_PTR(int32 *);
woValues = NULL_PTR(float32 *); woValues = NULL_PTR(float32 *);
eoWriteFlag = false;
filter = ReferenceT<RegisteredMethodsMessageFilter>(GlobalObjectsDatabase::Instance()->GetStandardHeap()); filter = ReferenceT<RegisteredMethodsMessageFilter>(GlobalObjectsDatabase::Instance()->GetStandardHeap());
filter->SetDestination(this); filter->SetDestination(this);
@@ -205,6 +206,11 @@ namespace MARTe {
/*lint -e{715} [MISRA C++ Rule 0-1-11], [MISRA C++ Rule 0-1-12]. Justification: the counter and the timer are always reset irrespectively of the states being changed.*/ /*lint -e{715} [MISRA C++ Rule 0-1-11], [MISRA C++ Rule 0-1-12]. Justification: the counter and the timer are always reset irrespectively of the states being changed.*/
bool AtcaIopConfigEoWo::PrepareNextState(const char8* const currentStateName, const char8* const nextStateName) { bool AtcaIopConfigEoWo::PrepareNextState(const char8* const currentStateName, const char8* const nextStateName) {
REPORT_ERROR(ErrorManagement::Information, " EoWo currentStateName %s, nextStateName %s", currentStateName, nextStateName); REPORT_ERROR(ErrorManagement::Information, " EoWo currentStateName %s, nextStateName %s", currentStateName, nextStateName);
StreamString nSName = nextStateName;
if (nSName == "Run") {
eoWriteFlag = true;
}
//if (currentStateName == "Idle") { //if (currentStateName == "Idle") {
// REPORT_ERROR(ErrorManagement::Information, "OffState"); // REPORT_ERROR(ErrorManagement::Information, "OffState");
//} //}
@@ -371,6 +377,10 @@ namespace MARTe {
REPORT_ERROR(ErrorManagement::Information, "Synchronise eo0:%d wo0%0.3f", eoValues[0], woValues[0]); REPORT_ERROR(ErrorManagement::Information, "Synchronise eo0:%d wo0%0.3f", eoValues[0], woValues[0]);
} }
#endif #endif
if (eoWriteFlag) {
eoWriteFlag = false;
REPORT_ERROR(ErrorManagement::Information, "Write eo0:%d wo0%0.3f", eoValues[0], woValues[0]);
}
//write(boardFileDescriptor, &w, 4); //write(boardFileDescriptor, &w, 4);
/* /*
if (channelsMemory != NULL_PTR(float32 *)) { if (channelsMemory != NULL_PTR(float32 *)) {

View File

@@ -213,6 +213,8 @@ namespace MARTe {
*/ */
float32 *woValues; float32 *woValues;
bool eoWriteFlag;
/** /**
* The signal memory * The signal memory
*/ */