Compare commits
7 Commits
a45fb1bb1f
...
c1e0bcee6d
Author | SHA1 | Date | |
---|---|---|---|
c1e0bcee6d | |||
5214f8a449 | |||
2506af27ed | |||
![]() |
b98c85d33f | ||
![]() |
eb58a8d954 | ||
e5b568bc2b | |||
![]() |
9a858eb54c |
@@ -9,7 +9,7 @@ GyroHandlerL3GD20H::GyroHandlerL3GD20H(object_id_t objectId, object_id_t deviceC
|
||||
DeviceHandlerBase(objectId, deviceCommunication, comCookie),
|
||||
transitionDelayMs(transitionDelayMs), dataset(this) {
|
||||
#if FSFW_HAL_L3GD20_GYRO_DEBUG == 1
|
||||
debugDivider = new PeriodicOperationDivider(3);
|
||||
debugDivider = new PeriodicOperationDivider(10);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@@ -12,7 +12,7 @@ MgmLIS3MDLHandler::MgmLIS3MDLHandler(object_id_t objectId, object_id_t deviceCom
|
||||
DeviceHandlerBase(objectId, deviceCommunication, comCookie),
|
||||
dataset(this), transitionDelay(transitionDelay) {
|
||||
#if FSFW_HAL_LIS3MDL_MGM_DEBUG == 1
|
||||
debugDivider = new PeriodicOperationDivider(3);
|
||||
debugDivider = new PeriodicOperationDivider(10);
|
||||
#endif
|
||||
// Set to default values right away
|
||||
registers[0] = MGMLIS3MDL::CTRL_REG1_DEFAULT;
|
||||
|
@@ -12,7 +12,7 @@ MgmRM3100Handler::MgmRM3100Handler(object_id_t objectId,
|
||||
DeviceHandlerBase(objectId, deviceCommunication, comCookie),
|
||||
primaryDataset(this), transitionDelay(transitionDelay) {
|
||||
#if FSFW_HAL_RM3100_MGM_DEBUG == 1
|
||||
debugDivider = new PeriodicOperationDivider(3);
|
||||
debugDivider = new PeriodicOperationDivider(10);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
|
||||
ReturnValue_t gpio::createRpiGpioConfig(GpioCookie* cookie, gpioId_t gpioId, int bcmPin,
|
||||
std::string consumer, gpio::Direction direction, int initValue) {
|
||||
std::string consumer, gpio::Direction direction, gpio::Levels initValue) {
|
||||
if(cookie == nullptr) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
|
@@ -20,7 +20,7 @@ namespace gpio {
|
||||
* @return
|
||||
*/
|
||||
ReturnValue_t createRpiGpioConfig(GpioCookie* cookie, gpioId_t gpioId, int bcmPin,
|
||||
std::string consumer, gpio::Direction direction, int initValue);
|
||||
std::string consumer, gpio::Direction direction, gpio::Levels initValue);
|
||||
}
|
||||
|
||||
#endif /* BSP_RPI_GPIO_GPIORPI_H_ */
|
||||
|
@@ -321,3 +321,7 @@ float LocalPoolDataSetBase::getCollectionInterval() const {
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void LocalPoolDataSetBase::printSet() {
|
||||
return;
|
||||
}
|
||||
|
@@ -176,6 +176,11 @@ public:
|
||||
*/
|
||||
float getCollectionInterval() const;
|
||||
|
||||
/**
|
||||
* @brief Can be overwritten by a specific implementation of a dataset to print the set.
|
||||
*/
|
||||
virtual void printSet();
|
||||
|
||||
protected:
|
||||
sid_t sid;
|
||||
//! This mutex is used if the data is created by one object only.
|
||||
@@ -234,7 +239,6 @@ protected:
|
||||
|
||||
PeriodicHousekeepingHelper* periodicHelper = nullptr;
|
||||
LocalDataPoolManager* poolManager = nullptr;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@@ -684,6 +684,11 @@ void DeviceHandlerBase::doGetWrite() {
|
||||
void DeviceHandlerBase::doSendRead() {
|
||||
ReturnValue_t result;
|
||||
|
||||
result = doSendReadHook();
|
||||
if (result != RETURN_OK){
|
||||
return;
|
||||
}
|
||||
|
||||
size_t replyLen = 0;
|
||||
if(cookieInfo.pendingCommand != deviceCommandMap.end()) {
|
||||
replyLen = getNextReplyLength(cookieInfo.pendingCommand->first);
|
||||
@@ -950,6 +955,10 @@ void DeviceHandlerBase::commandSwitch(ReturnValue_t onOff) {
|
||||
}
|
||||
}
|
||||
|
||||
ReturnValue_t DeviceHandlerBase::doSendReadHook() {
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t DeviceHandlerBase::getSwitches(const uint8_t **switches,
|
||||
uint8_t *numberOfSwitches) {
|
||||
return DeviceHandlerBase::NO_SWITCH;
|
||||
|
@@ -1094,6 +1094,12 @@ protected:
|
||||
*/
|
||||
void commandSwitch(ReturnValue_t onOff);
|
||||
|
||||
/**
|
||||
* @brief This function can be used to insert device specific code during the do-send-read
|
||||
* step.
|
||||
*/
|
||||
virtual ReturnValue_t doSendReadHook();
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
|
@@ -108,8 +108,6 @@ ReturnValue_t Clock::getUptime(uint32_t* uptimeMs) {
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
ReturnValue_t Clock::getDateAndTime(TimeOfDay_t* time) {
|
||||
timespec timeUnix;
|
||||
int status = clock_gettime(CLOCK_REALTIME,&timeUnix);
|
||||
|
@@ -99,6 +99,14 @@ public:
|
||||
*/
|
||||
static ReturnValue_t getDateAndTime(TimeOfDay_t *time);
|
||||
|
||||
/**
|
||||
* Convert to time of day struct given the POSIX timeval struct
|
||||
* @param from
|
||||
* @param to
|
||||
* @return
|
||||
*/
|
||||
static ReturnValue_t convertTimevalToTimeOfDay(const timeval *from,
|
||||
TimeOfDay_t *to);
|
||||
/**
|
||||
* Converts a time of day struct to POSIX seconds.
|
||||
* @param time The time of day as input
|
||||
|
@@ -42,6 +42,20 @@ ReturnValue_t Clock::getLeapSeconds(uint16_t *leapSeconds_) {
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t Clock::convertTimevalToTimeOfDay(const timeval* from, TimeOfDay_t* to) {
|
||||
struct tm* timeInfo;
|
||||
timeInfo = gmtime(&from->tv_sec);
|
||||
to->year = timeInfo->tm_year + 1900;
|
||||
to->month = timeInfo->tm_mon+1;
|
||||
to->day = timeInfo->tm_mday;
|
||||
to->hour = timeInfo->tm_hour;
|
||||
to->minute = timeInfo->tm_min;
|
||||
to->second = timeInfo->tm_sec;
|
||||
to->usecond = from->tv_usec;
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
|
||||
ReturnValue_t Clock::checkOrCreateClockMutex() {
|
||||
if (timeMutex == nullptr) {
|
||||
MutexFactory *mutexFactory = MutexFactory::instance();
|
||||
|
Reference in New Issue
Block a user