v1.10.0 #220

Merged
meierj merged 592 commits from develop into main 2022-04-22 07:42:20 +02:00
2 changed files with 10 additions and 15 deletions
Showing only changes of commit 6326ac71ca - Show all commits

View File

@ -310,8 +310,8 @@ void SpiTestClass::performPeriodicMax1227Test() {
susExtConversion = false;
susIntConversion = false;
plPcduAdcExtConv = false;
plPcduAdcIntConv = true;
plPcduAdcExtConv = true;
plPcduAdcIntConv = false;
performMax1227Test();
}
@ -487,7 +487,7 @@ void SpiTestClass::max1227SusTest(int fd) {
void SpiTestClass::max1227PlPcduTest(int fd) {
using namespace max1227;
if (plPcduAdcExtConv) {
if ((plPcduAdcExtConv or plPcduAdcIntConv) and vbatSwitch) {
// This enables the ADC
ReturnValue_t result = gpioIF->pullHigh(gpioIds::PLPCDU_ENB_VBAT0);
if (result != HasReturnvaluesIF::RETURN_OK) {
@ -497,7 +497,11 @@ void SpiTestClass::max1227PlPcduTest(int fd) {
if (result != HasReturnvaluesIF::RETURN_OK) {
return;
}
usleep(1000);
vbatSwitch = false;
// Takes a bit of time until the ADC is usable
TaskFactory::delayTask(50);
}
if (plPcduAdcExtConv) {
sendBuffer[0] = max1227::buildResetByte(false);
spiTransferStruct[0].len = 1;
transfer(fd, gpioIds::PLPCDU_ADC_CS);
@ -524,17 +528,7 @@ void SpiTestClass::max1227PlPcduTest(int fd) {
sif::info << "Temperature: " << temp << std::endl;
}
if (plPcduAdcIntConv) {
// This enables the ADC
ReturnValue_t result = gpioIF->pullHigh(gpioIds::PLPCDU_ENB_VBAT0);
if (result != HasReturnvaluesIF::RETURN_OK) {
return;
}
result = gpioIF->pullHigh(gpioIds::PLPCDU_ENB_VBAT1);
if (result != HasReturnvaluesIF::RETURN_OK) {
return;
}
usleep(1000);
sendBuffer[0] = max1227::buildResetByte(false);
sendBuffer[0] = max1227::buildResetByte(true);
spiTransferStruct[0].len = 1;
transfer(fd, gpioIds::PLPCDU_ADC_CS);
// Now use internal conversion

View File

@ -61,6 +61,7 @@ class SpiTestClass : public TestTask {
bool plPcduAdcExtConv = false;
bool plPcduAdcIntConv = false;
bool vbatSwitch = true;
uint8_t mgm0Lis3mdlChipSelect = 0;
uint8_t mgm1Rm3100ChipSelect = 0;