added rest of necessary logic
This commit is contained in:
@ -146,6 +146,7 @@ ReturnValue_t PdecHandler::polledOperation() {
|
||||
break;
|
||||
}
|
||||
case State::PDEC_RESET: {
|
||||
triggerEvent(pdec::PDEC_TRYING_RESET_WITH_INIT);
|
||||
ReturnValue_t result = pdecToReset();
|
||||
if (result != returnvalue::OK) {
|
||||
triggerEvent(PDEC_RESET_FAILED);
|
||||
@ -194,11 +195,12 @@ ReturnValue_t PdecHandler::irqOperation() {
|
||||
break;
|
||||
}
|
||||
case State::PDEC_RESET: {
|
||||
triggerEvent(pdec::PDEC_TRYING_RESET_WITH_INIT);
|
||||
result = pdecToReset();
|
||||
if (result != returnvalue::OK) {
|
||||
triggerEvent(PDEC_RESET_FAILED);
|
||||
}
|
||||
usleep(10);
|
||||
usleep(20);
|
||||
state = State::INIT;
|
||||
break;
|
||||
}
|
||||
@ -352,9 +354,7 @@ ReturnValue_t PdecHandler::executeAction(ActionId_t actionId, MessageQueueId_t c
|
||||
printPdecMon();
|
||||
return EXECUTION_FINISHED;
|
||||
case RESET_PDEC_NO_REINIITALIZATION: {
|
||||
pdecToReset();
|
||||
usleep(20);
|
||||
releasePdec();
|
||||
pdecResetNoInit();
|
||||
return EXECUTION_FINISHED;
|
||||
}
|
||||
case RESET_PDEC_WITH_REINIITALIZATION: {
|
||||
@ -780,6 +780,13 @@ void PdecHandler::initFailedHandler(ReturnValue_t reason) {
|
||||
state = State::WAIT_FOR_RECOVERY;
|
||||
}
|
||||
|
||||
void PdecHandler::pdecResetNoInit() {
|
||||
triggerEvent(pdec::PDEC_TRYING_RESET_NO_INIT);
|
||||
pdecToReset();
|
||||
usleep(20);
|
||||
releasePdec();
|
||||
}
|
||||
|
||||
std::string PdecHandler::getMonStatusString(uint32_t status) {
|
||||
switch (status) {
|
||||
case TC_CHANNEL_INACTIVE:
|
||||
|
@ -363,6 +363,8 @@ class PdecHandler : public SystemObject,
|
||||
*/
|
||||
void printPdecMon();
|
||||
|
||||
void pdecResetNoInit();
|
||||
|
||||
void initFailedHandler(ReturnValue_t reason);
|
||||
|
||||
std::string getMonStatusString(uint32_t status);
|
||||
|
@ -29,13 +29,19 @@ static constexpr Event TOO_MANY_IRQS = MAKE_EVENT(7, severity::MEDIUM);
|
||||
static constexpr Event POLL_SYSCALL_ERROR_PDEC =
|
||||
event::makeEvent(SUBSYSTEM_ID, 8, severity::MEDIUM);
|
||||
static constexpr Event WRITE_SYSCALL_ERROR_PDEC = event::makeEvent(SUBSYSTEM_ID, 9, severity::HIGH);
|
||||
//! [EXPORT] : [COMMENT] Trying a PDEC reset with complete re-initialization
|
||||
static constexpr Event PDEC_TRYING_RESET_WITH_INIT =
|
||||
event::makeEvent(SUBSYSTEM_ID, 10, severity::LOW);
|
||||
//! [EXPORT] : [COMMENT] Trying a PDEC reset without re-initialization.
|
||||
static constexpr Event PDEC_TRYING_RESET_NO_INIT =
|
||||
event::makeEvent(SUBSYSTEM_ID, 11, severity::LOW);
|
||||
//! [EXPORT] : [COMMENT] Failed to pull PDEC reset to low
|
||||
static constexpr Event PDEC_RESET_FAILED = event::makeEvent(SUBSYSTEM_ID, 10, severity::HIGH);
|
||||
static constexpr Event PDEC_RESET_FAILED = event::makeEvent(SUBSYSTEM_ID, 12, severity::HIGH);
|
||||
//! [EXPORT] : [COMMENT] Failed to open the IRQ uio file
|
||||
static constexpr Event OPEN_IRQ_FILE_FAILED = event::makeEvent(SUBSYSTEM_ID, 11, severity::HIGH);
|
||||
static constexpr Event OPEN_IRQ_FILE_FAILED = event::makeEvent(SUBSYSTEM_ID, 13, severity::HIGH);
|
||||
//! [EXPORT] : [COMMENT] PDEC initialization failed. This might also be due to the persistent
|
||||
//! confiuration never becoming available, for example due to SD card issues.
|
||||
static constexpr Event PDEC_INIT_FAILED = event::makeEvent(SUBSYSTEM_ID, 12, severity::HIGH);
|
||||
static constexpr Event PDEC_INIT_FAILED = event::makeEvent(SUBSYSTEM_ID, 14, severity::HIGH);
|
||||
|
||||
// Action IDs
|
||||
static constexpr ActionId_t PRINT_CLCW = 0;
|
||||
|
Reference in New Issue
Block a user