link state now detected by bit and carrier lock flags

This commit is contained in:
Jakob Meier 2021-11-24 15:55:25 +01:00
parent 345ccf5392
commit 542aa994b7
7 changed files with 20 additions and 19 deletions

View File

@ -110,7 +110,7 @@ void initmission::initTasks() {
// If a command has not been read before the next one arrives, the old command will be
// overwritten by the PDEC.
PeriodicTaskIF* pdecHandlerTask = factory->createPeriodicTask(
"PDEC_HANDLER", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1, missedDeadlineFunc);
"PDEC_HANDLER", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, missedDeadlineFunc);
result = pdecHandlerTask->addComponent(objects::PDEC_HANDLER);
if(result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("PDEC Handler", objects::PDEC_HANDLER);

View File

@ -981,10 +981,10 @@ void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF *gpioComIF) {
#if BOARD_TE0720 == 0
GpioCookie* gpioRS485Chip = new GpioCookie;
gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_TX_CLOCK, "RS485 Transceiver",
gpio::Direction::OUT, gpio::HIGH);
gpio::Direction::OUT, gpio::LOW);
gpioRS485Chip->addGpio(gpioIds::RS485_EN_TX_CLOCK, gpio);
gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_TX_DATA, "RS485 Transceiver",
gpio::Direction::OUT, gpio::HIGH);
gpio::Direction::OUT, gpio::LOW);
gpioRS485Chip->addGpio(gpioIds::RS485_EN_TX_DATA, gpio);
// Default configuration enables RX channels (RXEN = LOW)

View File

@ -39,6 +39,8 @@ debugging. */
// Set to 1 if telecommands are received via the PDEC IP Core
#define OBSW_TC_FROM_PDEC 1
#define TMTC_TEST_SETUP 1
#define OBSW_ENABLE_TIMERS 1
#define OBSW_ADD_STAR_TRACKER 0
#define OBSW_ADD_PLOC_SUPERVISOR 0
@ -92,7 +94,6 @@ debugging. */
#define OBSW_TEST_TE7020_HEATER 0
#define OBSW_TEST_GPIO_OPEN_BY_LABEL 0
#define OBSW_TEST_GPIO_OPEN_BY_LINE_NAME 0
#define OBSW_LINK_IS_UP 1
#define OBSW_DEBUG_P60DOCK 0
#define OBSW_DEBUG_PDU1 0
@ -109,7 +110,7 @@ debugging. */
#define OBSW_DEBUG_STARTRACKER 0
#define OBSW_DEBUG_PLOC_MPSOC 0
#define OBSW_DEBUG_PLOC_SUPERVISOR 0
#define OBSW_DEBUG_PDEC_HANDLER 0
#define OBSW_DEBUG_PDEC_HANDLER 1
/*******************************************************************/
/** Hardcoded */

View File

@ -1,4 +1,3 @@
#include "OBSWConfig.h"
#include "fsfw/serviceinterface/ServiceInterface.h"
#include "fsfw/serviceinterface/serviceInterfaceDefintions.h"
#include "fsfw/objectmanager/ObjectManager.h"
@ -271,8 +270,8 @@ void CCSDSHandler::enableTransmit() {
}
transmitterCountdown.setTimeout(TRANSMITTER_TIMEOUT);
#if BOARD_TE0720 == 0
gpioIF->pullLow(enTxClock);
gpioIF->pullLow(enTxData);
gpioIF->pullHigh(enTxClock);
gpioIF->pullHigh(enTxData);
#endif /* BOARD_TE0720 == 0 */
linkState = UP;
// Set link state of all virtual channels to link up
@ -290,9 +289,10 @@ void CCSDSHandler::checkTxTimer() {
void CCSDSHandler::disableTransmit() {
#if BOARD_TE0720 == 0
gpioIF->pullHigh(enTxClock);
gpioIF->pullHigh(enTxData);
gpioIF->pullLow(enTxClock);
gpioIF->pullLow(enTxData);
#endif /* BOARD_TE0720 == 0 */
linkState = DOWN;
forwardLinkstate();
transmitterCountdown.setTimeout(0);
}

View File

@ -89,9 +89,13 @@ private:
//! [EXPORT] : [COMMENT] Received action message with unknown action id
static const ReturnValue_t COMMAND_NOT_IMPLEMENTED = MAKE_RETURN_CODE(0xA0);
#if TMTC_TEST_SETUP == 0
// syrlinks must not be transmitting more than 15 minutes (according to datasheet)
// static const uint32_t TRANSMITTER_TIMEOUT = 900000; //900000 ms = 15 min
static const uint32_t TRANSMITTER_TIMEOUT = 10000; //900000 ms = 15 min
static const uint32_t TRANSMITTER_TIMEOUT = 900000; //900000 ms = 15 min
#else
// Set to high value when not sending via syrlinks
static const uint32_t TRANSMITTER_TIMEOUT = 86400000; // 1 day
#endif /* TMTC_TEST_SETUP == 0 */
static const bool UP = true;
static const bool DOWN = false;

View File

@ -64,6 +64,6 @@ void VirtualChannel::setPtmeObject(PtmeIF* ptme_) {
ptme = ptme_;
}
void VirtualChannel::setLinkState(bool linkIsUp) {
linkIsUp = linkIsUp;
void VirtualChannel::setLinkState(bool linkIsUp_) {
linkIsUp = linkIsUp_;
}

View File

@ -38,7 +38,7 @@ class VirtualChannel: public AcceptsTelemetryIF, public HasReturnvaluesIF {
* @brief Can be used by the owner to set the link state. Packets will be discarded if link
* to ground station is down.
*/
void setLinkState(bool linkIsUp);
void setLinkState(bool linkIsUp_);
private:
@ -46,11 +46,7 @@ private:
MessageQueueIF* tmQueue = nullptr;
uint8_t vcId;
#if OBSW_LINK_IS_UP == 1
bool linkIsUp = true;
#else
bool linkIsUp = false;
#endif /* OBSW_LINK_IS_UP == 1 */
StorageManagerIF* tmStore = nullptr;
};