meier/ImtqHandler #44

Merged
muellerr merged 25 commits from meier/ImtqHandler into develop 2021-06-21 17:47:22 +02:00
2 changed files with 6 additions and 5 deletions
Showing only changes of commit 9d6c511f91 - Show all commits

View File

@ -26,7 +26,7 @@ ReturnValue_t CCSDSIPCoreBridge::initialize() {
* Map uio device in virtual address space * Map uio device in virtual address space
* PROT_WRITE: Map uio device in writable only mode * PROT_WRITE: Map uio device in writable only mode
*/ */
ptmeBaseAddress = static_cast<uint32_t*>(mmap(NULL, MAP_SIZE, PROT_WRITE, MAP_SHARED, fd, 0)); ptmeBaseAddress = mmap(NULL, MAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if (ptmeBaseAddress == MAP_FAILED) { if (ptmeBaseAddress == MAP_FAILED) {
sif::error << "CCSDSIPCoreBridge::initialize: Failed to map uio address" << std::endl; sif::error << "CCSDSIPCoreBridge::initialize: Failed to map uio address" << std::endl;
@ -61,7 +61,8 @@ ReturnValue_t CCSDSIPCoreBridge::sendTm(const uint8_t * data, size_t dataLen) {
for(size_t idx = 0; idx < dataLen; idx++) { for(size_t idx = 0; idx < dataLen; idx++) {
if(pollPapbSignal() == RETURN_OK) { if(pollPapbSignal() == RETURN_OK) {
*(ptmeBaseAddress + PTME_DATA_REG_OFFSET) = static_cast<uint32_t>(*(data + idx)); *(static_cast<uint32_t*>(ptmeBaseAddress) + PTME_DATA_REG_OFFSET) =
static_cast<uint32_t>(*(data + idx));
} }
else { else {
sif::debug << "CCSDSIPCoreBridge::sendTm: Only written " << idx - 1 << " of " << dataLen sif::debug << "CCSDSIPCoreBridge::sendTm: Only written " << idx - 1 << " of " << dataLen
@ -77,11 +78,11 @@ ReturnValue_t CCSDSIPCoreBridge::sendTm(const uint8_t * data, size_t dataLen) {
} }
void CCSDSIPCoreBridge::startPacketTransfer() { void CCSDSIPCoreBridge::startPacketTransfer() {
*(ptmeBaseAddress) = PTME_CONFIG_START; *(static_cast<uint32_t*>(ptmeBaseAddress)) = PTME_CONFIG_START;
} }
void CCSDSIPCoreBridge::endPacketTransfer() { void CCSDSIPCoreBridge::endPacketTransfer() {
*(ptmeBaseAddress) = PTME_CONFIG_END; *(static_cast<uint32_t*>(ptmeBaseAddress)) = PTME_CONFIG_END;
} }
ReturnValue_t CCSDSIPCoreBridge::pollPapbSignal() { ReturnValue_t CCSDSIPCoreBridge::pollPapbSignal() {

View File

@ -90,7 +90,7 @@ private:
int fd; int fd;
/** PTME base address */ /** PTME base address */
uint32_t* ptmeBaseAddress = nullptr; void* ptmeBaseAddress = nullptr;
/** /**
* @brief This function sends the config byte to the PTME IP Core to initiate a packet * @brief This function sends the config byte to the PTME IP Core to initiate a packet