Pre-update de Qt

This commit is contained in:
2024-04-05 18:47:51 -04:00
parent ff6ae02ed5
commit 71215e98b7
22 changed files with 1816 additions and 129 deletions
+28 -2
View File
@@ -29,11 +29,22 @@ int CComputerBoardInterface::Init()
int CComputerBoardInterface::LoadLibrary()
{
int result;
int result, Direction;
Direction = 1;
char libname[] = CPU_LIBRARY_NAME;
result = AxBoardLoadLibrary(libname);
if(result)
{
AxSetDIODirection(0,&Direction);
AxSetDIODirection(1,&Direction);
AxSetDIODirection(2,&Direction);
AxSetDIODirection(3,&Direction);
AxSetDIODirection(4,&Direction);
AxSetDIODirection(5,&Direction);
AxSetDIODirection(6,&Direction);
AxSetDIODirection(7,&Direction);
return RET_OK;
}
return RET_GENERAL_ERROR;
}
@@ -144,7 +155,7 @@ CComputerBoardState CComputerBoardInterface::GetComputerBoardState()
// qDebug("CPUState.mSystem3V3 %f",CPUState.mSystem3V3);
AxGet5V(&CPUState.mSystem5V);
// qDebug("CPUState.mSystem5V %f",CPUState.mSystem5V);
// AxGet12V(&tmp);
AxGet12V(&CPUState.mSystem12V);
// qDebug("AxGet12V %f",tmp);
// AxGetNeg5V(&tmp);
// qDebug("AxGetNeg5V %f",tmp);
@@ -153,6 +164,21 @@ CComputerBoardState CComputerBoardInterface::GetComputerBoardState()
// AxGetVbat(&tmp);
// qDebug("AxGetVbat %f",tmp);
unsigned char IOPortState = 0;
int temp;
for(int i = 0; i < 7; i++)
{
unsigned char mask = 1;
AxGetDI(i,&temp);
if(temp != 0)
{
mask <<= i+1;
}
IOPortState |= mask;
}
CPUState.mIOPortState = IOPortState;
return CPUState;
}