Merge pull request 'RAD sensor delay after pulling pin high' (#751) from rad-sensor-delay-after-gpio into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

Reviewed-on: #751
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
This commit is contained in:
Robin Müller 2023-07-21 11:50:48 +02:00
commit f989af51f2
2 changed files with 7 additions and 0 deletions

View File

@ -26,6 +26,8 @@ will consitute of a breaking change warranting a new major release:
## Added
- 5 ms delay after pulling RADFET enable pin high before starting
the ADC conversion.
- Set STR time in configuration sequence to firmware mode.
- The STR `AutoThreshold` parameters are now set from the configuration JSON file at STR
startup.

View File

@ -1,6 +1,7 @@
#include <OBSWConfig.h>
#include <devices/gpioIds.h>
#include <fsfw/datapool/PoolReadGuard.h>
#include <fsfw/tasks/TaskFactory.h>
#include <mission/payload/RadiationSensorHandler.h>
#include <mission/power/gsDefs.h>
#include <mission/tcs/max1227.h>
@ -98,6 +99,10 @@ ReturnValue_t RadiationSensorHandler::buildCommandFromCommand(DeviceCommandId_t
}
case (radSens::START_CONVERSION): {
ReturnValue_t result = gpioIF->pullHigh(gpioIds::ENABLE_RADFET);
// Test a small delay between pulling the RADFET high and reading the sensor. As long as this
// delay remains small enough, this should not cause scheduling issues. Do not make this
// delay large, this device might be scheduled inside the ACS PST!
TaskFactory::delayTask(5);
if (result != returnvalue::OK) {
#if OBSW_VERBOSE_LEVEL >= 1
sif::warning