Skip to content

Commit

Permalink
Fix nasa#443, Correct minor bugs + typos in the VxWorks layer
Browse files Browse the repository at this point in the history
  • Loading branch information
thnkslprpt committed Dec 11, 2024
1 parent ab82f6a commit e3ef871
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
18 changes: 8 additions & 10 deletions fsw/mcp750-vxworks/src/cfe_psp_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ int32 CFE_PSP_ReadFromCDS(void *PtrToDataToRead, uint32 CDSOffset, uint32 NumByt
return_code = CFE_PSP_ERROR;
}

} /* end if PtrToDataToWrite == NULL */
} /* end if PtrToDataToRead == NULL */

return return_code;
}
Expand Down Expand Up @@ -319,9 +319,7 @@ int32 CFE_PSP_GetVolatileDiskMem(cpuaddr *PtrToVolDisk, uint32 *SizeOfVolDisk)
*/
int32 CFE_PSP_InitProcessorReservedMemory(uint32 RestartType)
{
int32 return_code;

if (RestartType != CFE_PSP_RST_TYPE_PROCESSOR)
if (RestartType == CFE_PSP_RST_TYPE_POWERON)
{
OS_printf("CFE_PSP: Clearing Processor Reserved Memory.\n");
memset(MCP750_ReservedMemBlock.BlockPtr, 0, MCP750_ReservedMemBlock.BlockSize);
Expand All @@ -331,8 +329,8 @@ int32 CFE_PSP_InitProcessorReservedMemory(uint32 RestartType)
*/
CFE_PSP_ReservedMemoryMap.BootPtr->bsp_reset_type = CFE_PSP_RST_TYPE_PROCESSOR;
}
return_code = CFE_PSP_SUCCESS;
return return_code;

return CFE_PSP_SUCCESS;
}

/******************************************************************************
Expand Down Expand Up @@ -478,7 +476,7 @@ int32 CFE_PSP_GetCFETextSegmentInfo(cpuaddr *PtrToCFESegment, uint32 *SizeOfCFES
MODULE_ID cFEModuleId;
MODULE_INFO cFEModuleInfo;
cpuaddr GetModuleIdAddr;
MODULE_ID (*GetModuldIdFunc)(void);
MODULE_ID (*GetModuleIdFunc)(void);

if (PtrToCFESegment == NULL || SizeOfCFESegment == NULL)
{
Expand All @@ -503,8 +501,8 @@ int32 CFE_PSP_GetCFETextSegmentInfo(cpuaddr *PtrToCFESegment, uint32 *SizeOfCFES
return_code = OS_SymbolLookup(&GetModuleIdAddr, "GetCfeCoreModuleID");
if (return_code == OS_SUCCESS && GetModuleIdAddr != 0)
{
GetModuldIdFunc = (MODULE_ID(*)(void))GetModuleIdAddr;
cFEModuleId = GetModuldIdFunc();
GetModuleIdFunc = (MODULE_ID(*)(void))GetModuleIdAddr;
cFEModuleId = GetModuleIdFunc();
}

/*
Expand Down Expand Up @@ -538,4 +536,4 @@ int32 CFE_PSP_GetCFETextSegmentInfo(cpuaddr *PtrToCFESegment, uint32 *SizeOfCFES
}

return return_code;
}
}
4 changes: 2 additions & 2 deletions fsw/mcp750-vxworks/src/cfe_psp_start.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ void OS_Application_Startup(void)
else if (reset_register & SYS_REG_BLRR_FBTN)
{
OS_printf("CFE_PSP: POWERON Reset: Front Panel Push Button Reset.\n");
reset_type = CFE_PSP_RST_SUBTYPE_PUSH_BUTTON;
reset_subtype = 3;
reset_type = CFE_PSP_RST_TYPE_POWERON;
reset_subtype = CFE_PSP_RST_SUBTYPE_PUSH_BUTTON;
}
else if (reset_register & SYS_REG_BLRR_WDT2)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ void Test_OS_Application_Startup(void)
*PCS_SYS_REG_BLRR = PCS_SYS_REG_BLRR_FBTN;
UT_OS_Application_Startup();
UtAssert_INT32_EQ(UT_GetStubCount(UT_KEY(PCS_SystemMain)), 5);
UtAssert_INT32_EQ(StartType.StartType, CFE_PSP_RST_SUBTYPE_PUSH_BUTTON);
UtAssert_INT32_EQ(StartType.StartSubtype, 3);
UtAssert_INT32_EQ(StartType.StartType, CFE_PSP_RST_TYPE_POWERON);
UtAssert_INT32_EQ(StartType.StartSubtype, CFE_PSP_RST_SUBTYPE_PUSH_BUTTON);

*PCS_SYS_REG_BLRR = PCS_SYS_REG_BLRR_WDT2;
UT_OS_Application_Startup();
Expand Down

0 comments on commit e3ef871

Please sign in to comment.