Merge branch 'mueller/scex-em-tests' into scex-additions
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
This commit is contained in:
commit
6d9999292c
@ -15,7 +15,7 @@ static constexpr char UART_PLOC_MPSOC_DEV[] = "/dev/ul-plmpsoc";
|
|||||||
static constexpr char UART_PLOC_SUPERVSIOR_DEV[] = "/dev/ul-plsv";
|
static constexpr char UART_PLOC_SUPERVSIOR_DEV[] = "/dev/ul-plsv";
|
||||||
static constexpr char UART_SYRLINKS_DEV[] = "/dev/ul-syrlinks";
|
static constexpr char UART_SYRLINKS_DEV[] = "/dev/ul-syrlinks";
|
||||||
static constexpr char UART_STAR_TRACKER_DEV[] = "/dev/ul-str";
|
static constexpr char UART_STAR_TRACKER_DEV[] = "/dev/ul-str";
|
||||||
static constexpr char UART_SCEX_DEV[] = "/dev/ul-scex";
|
static constexpr char UART_SCEX_DEV[] = "/dev/ttyS-SCEX";
|
||||||
|
|
||||||
static constexpr char UIO_PDEC_REGISTERS[] = "/dev/uio0";
|
static constexpr char UIO_PDEC_REGISTERS[] = "/dev/uio0";
|
||||||
static constexpr char UIO_PTME[] = "/dev/uio1";
|
static constexpr char UIO_PTME[] = "/dev/uio1";
|
||||||
|
2
fsfw
2
fsfw
@ -1 +1 @@
|
|||||||
Subproject commit 1c53b60442f5b858b00938169ef1daba41ba272d
|
Subproject commit 8195587604c5f14f04bf25b16a514cf3c771284b
|
@ -326,9 +326,8 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF,
|
|||||||
void ObjectFactory::createScexComponents(std::string uartDev, PowerSwitchIF* pwrSwitcher,
|
void ObjectFactory::createScexComponents(std::string uartDev, PowerSwitchIF* pwrSwitcher,
|
||||||
SdCardMountedIF& mountedIF, bool onImmediately,
|
SdCardMountedIF& mountedIF, bool onImmediately,
|
||||||
std::optional<power::Switch_t> switchId) {
|
std::optional<power::Switch_t> switchId) {
|
||||||
// objekte anlegen
|
|
||||||
auto* cookie = new UartCookie(objects::SCEX, uartDev, uart::SCEX_BAUD, 4096);
|
auto* cookie = new UartCookie(objects::SCEX, uartDev, uart::SCEX_BAUD, 4096);
|
||||||
|
cookie->setTwoStopBits();
|
||||||
auto scexUartReader = new ScexUartReader(objects::SCEX_UART_READER);
|
auto scexUartReader = new ScexUartReader(objects::SCEX_UART_READER);
|
||||||
auto scexHandler = new ScexDeviceHandler(objects::SCEX, *scexUartReader, cookie, mountedIF);
|
auto scexHandler = new ScexDeviceHandler(objects::SCEX, *scexUartReader, cookie, mountedIF);
|
||||||
if (onImmediately) {
|
if (onImmediately) {
|
||||||
|
@ -51,6 +51,9 @@ ReturnValue_t ScexUartReader::performOperation(uint8_t operationCode) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ReturnValue_t result = returnvalue::OK;
|
ReturnValue_t result = returnvalue::OK;
|
||||||
|
// Can be used to read frame, parity and overrun errors
|
||||||
|
// serial_icounter_struct icounter{};
|
||||||
|
// uart::readCountersAndErrors(serialPort, icounter);
|
||||||
while (result != DleParser::NO_PACKET_FOUND) {
|
while (result != DleParser::NO_PACKET_FOUND) {
|
||||||
result = tryDleParsing();
|
result = tryDleParsing();
|
||||||
}
|
}
|
||||||
@ -95,7 +98,14 @@ ReturnValue_t ScexUartReader::initializeInterface(CookieIF *cookie) {
|
|||||||
}
|
}
|
||||||
// Setting up UART parameters
|
// Setting up UART parameters
|
||||||
tty.c_cflag &= ~PARENB; // Clear parity bit
|
tty.c_cflag &= ~PARENB; // Clear parity bit
|
||||||
tty.c_cflag &= ~CSTOPB; // Clear stop field, only one stop bit used in communication
|
if (uartCookie->getStopBits() == StopBits::TWO_STOP_BITS) {
|
||||||
|
// Use two stop bits
|
||||||
|
tty.c_cflag |= CSTOPB;
|
||||||
|
} else {
|
||||||
|
// Clear stop field, only one stop bit used in communication
|
||||||
|
tty.c_cflag &= ~CSTOPB;
|
||||||
|
}
|
||||||
|
|
||||||
tty.c_cflag &= ~CSIZE; // Clear all the size bits
|
tty.c_cflag &= ~CSIZE; // Clear all the size bits
|
||||||
tty.c_cflag |= CS8; // 8 bits per byte
|
tty.c_cflag |= CS8; // 8 bits per byte
|
||||||
tty.c_cflag &= ~CRTSCTS; // Disable RTS/CTS hardware flow control
|
tty.c_cflag &= ~CRTSCTS; // Disable RTS/CTS hardware flow control
|
||||||
@ -108,13 +118,10 @@ ReturnValue_t ScexUartReader::initializeInterface(CookieIF *cookie) {
|
|||||||
tty.c_cc[VTIME] = 0;
|
tty.c_cc[VTIME] = 0;
|
||||||
tty.c_cc[VMIN] = 0;
|
tty.c_cc[VMIN] = 0;
|
||||||
|
|
||||||
// Q7S UART Lite has fixed baud rate. For other linux systems, set baud rate here.
|
// The SCEX experiment has a fixed baud rate.
|
||||||
#if !defined(XIPHOS_Q7S)
|
if (cfsetispeed(&tty, B38400) != 0) {
|
||||||
if (cfsetispeed(&tty, B57600) != 0) {
|
|
||||||
sif::warning << "ScexUartReader::initializeInterface: Setting baud rate failed" << std::endl;
|
sif::warning << "ScexUartReader::initializeInterface: Setting baud rate failed" << std::endl;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (tcsetattr(serialPort, TCSANOW, &tty) != 0) {
|
if (tcsetattr(serialPort, TCSANOW, &tty) != 0) {
|
||||||
sif::warning << "ScexUartReader::initializeInterface: tcsetattr call failed with error ["
|
sif::warning << "ScexUartReader::initializeInterface: tcsetattr call failed with error ["
|
||||||
<< errno << ", " << strerror(errno) << std::endl;
|
<< errno << ", " << strerror(errno) << std::endl;
|
||||||
|
Loading…
Reference in New Issue
Block a user