added cmake support for csp lib
This commit is contained in:
parent
aa3168b2c7
commit
d8185c0611
@ -41,20 +41,26 @@ set(LIB_FSFW_NAME fsfw)
|
||||
# Set path names
|
||||
set(FSFW_PATH fsfw)
|
||||
set(MISSION_PATH mission)
|
||||
set(CSPLIB_PATH libcsp)
|
||||
|
||||
# Analyse different OS and architecture/target options, determine BSP_PATH,
|
||||
# display information about compiler etc.
|
||||
include (${CMAKE_SCRIPT_PATH}/HardwareOsPreConfig.cmake)
|
||||
pre_source_hw_os_config()
|
||||
|
||||
if(${OS_FSFW} MATCHES linux)
|
||||
if(TGT_BSP)
|
||||
if(${TGT_BSP} MATCHES "arm/q7s" OR ${TGT_BSP} MATCHES "arm/raspberrypi")
|
||||
set(ROOT_CONFIG_FOLDER TRUE)
|
||||
set(FSFW_CONFIG_PATH "fsfwconfig")
|
||||
endif()
|
||||
|
||||
if(${TGT_BSP} MATCHES "arm/q7s")
|
||||
set(ADD_CSP_LIB TRUE)
|
||||
endif()
|
||||
else()
|
||||
set(FSFW_CONFIG_PATH "${BSP_PATH}/fsfwconfig")
|
||||
endif()
|
||||
|
||||
set(RPI_BSP_PATH "bsp_rpi")
|
||||
|
||||
################################################################################
|
||||
# Executable and Sources
|
||||
################################################################################
|
||||
@ -63,12 +69,12 @@ set(RPI_BSP_PATH "bsp_rpi")
|
||||
add_executable(${TARGET_NAME})
|
||||
|
||||
# Add subdirectories
|
||||
if(${OS_FSFW} MATCHES linux)
|
||||
if(ROOT_CONFIG_FOLDER)
|
||||
add_subdirectory(${FSFW_CONFIG_PATH})
|
||||
endif()
|
||||
|
||||
if(${TGT_BSP} MATCHES "arm/raspberrypi")
|
||||
add_subdirectory(${RPI_BSP_PATH})
|
||||
if(ADD_CSP_LIB)
|
||||
add_subdirectory(${CSPLIB_PATH})
|
||||
endif()
|
||||
|
||||
add_subdirectory(${BSP_PATH})
|
||||
|
2
Makefile
2
Makefile
@ -13,7 +13,7 @@ SHELL = /bin/sh
|
||||
|
||||
# Chip & board used for compilation
|
||||
# (can be overriden by adding CHIP=chip and BOARD=board to the command-line)
|
||||
BOARD_FILE_ROOT = bsp_linux
|
||||
BOARD_FILE_ROOT = bsp_q7s
|
||||
BOARD = linux
|
||||
OS_FSFW = linux
|
||||
CUSTOM_DEFINES += -D$(OS_FSFW)
|
||||
|
@ -1,6 +1,5 @@
|
||||
#include <bsp_linux/InitMission.h>
|
||||
#include <bsp_linux/ObjectFactory.h>
|
||||
|
||||
#include <bsp_q7s/InitMission.h>
|
||||
#include <bsp_q7s/ObjectFactory.h>
|
||||
#include <fsfw/objectmanager/ObjectManagerIF.h>
|
||||
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
||||
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include <bsp_linux/InitMission.h>
|
||||
#include <bsp_linux/ObjectFactory.h>
|
||||
#include "InitMission.h"
|
||||
#include "ObjectFactory.h"
|
||||
#include <OBSWConfig.h>
|
||||
|
||||
#include <fsfw/objectmanager/ObjectManagerIF.h>
|
||||
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
||||
@ -8,8 +9,6 @@
|
||||
#include <fsfw/tasks/FixedTimeslotTaskIF.h>
|
||||
#include <fsfw/tasks/PeriodicTaskIF.h>
|
||||
#include <fsfw/tasks/TaskFactory.h>
|
||||
#include <fsfwconfig/objects/systemObjectList.h>
|
||||
#include <fsfwconfig/OBSWConfig.h>
|
||||
#include <fsfwconfig/pollingsequence/PollingSequenceFactory.h>
|
||||
|
||||
#include <iostream>
|
||||
@ -144,7 +143,7 @@ void InitMission::initTasks(){
|
||||
}
|
||||
|
||||
|
||||
#if ADD_TEST_CODE == 1
|
||||
#if OBSW_ADD_TEST_CODE == 1
|
||||
// FixedTimeslotTaskIF* TestTimeslotTask = TaskFactory::instance()->
|
||||
// createFixedTimeslotTask("PST_TEST_TASK", 10,
|
||||
// PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, nullptr);
|
||||
@ -172,7 +171,7 @@ void InitMission::initTasks(){
|
||||
|
||||
// P60DockTask->startTask();
|
||||
|
||||
#if ADD_TEST_CODE == 1
|
||||
#if OBSW_ADD_TEST_CODE == 1
|
||||
// TestTimeslotTask->startTask();
|
||||
#endif
|
||||
sif::info << "Tasks started.." << std::endl;
|
9
bsp_q7s/InitMission.h
Normal file
9
bsp_q7s/InitMission.h
Normal file
@ -0,0 +1,9 @@
|
||||
#ifndef BSP_Q7S_INITMISSION_H_
|
||||
#define BSP_Q7S_INITMISSION_H_
|
||||
|
||||
namespace InitMission {
|
||||
void initMission();
|
||||
void initTasks();
|
||||
};
|
||||
|
||||
#endif /* BSP_Q7S_INITMISSION_H_ */
|
77
bsp_q7s/ObjectFactory.cpp
Normal file
77
bsp_q7s/ObjectFactory.cpp
Normal file
@ -0,0 +1,77 @@
|
||||
#include "ObjectFactory.h"
|
||||
#include <OBSWConfig.h>
|
||||
#include <tmtc/apid.h>
|
||||
#include <devices/addresses.h>
|
||||
#include <tmtc/pusIds.h>
|
||||
|
||||
#include <fsfw/datapoollocal/LocalDataPoolManager.h>
|
||||
#include <fsfw/tmtcservices/CommandingServiceBase.h>
|
||||
#include <fsfw/tmtcservices/PusServiceBase.h>
|
||||
#include <fsfw/osal/linux/TmTcUnixUdpBridge.h>
|
||||
#include <fsfw/tmtcpacket/pus/TmPacketStored.h>
|
||||
#include <fsfw/osal/linux/TcUnixUdpPollingTask.h>
|
||||
|
||||
#include <mission/core/GenericFactory.h>
|
||||
#include <mission/devices/GomspaceDeviceHandler.h>
|
||||
#include <mission/devices/devicedefinitions/GomSpacePackets.h>
|
||||
#include <mission/devices/devicedefinitions/GomspaceDefinitions.h>
|
||||
#include <mission/utility/TmFunnel.h>
|
||||
|
||||
#include <bsp_q7s/comIF/cookies/CspCookie.h>
|
||||
#include <bsp_q7s/comIF/CspComIF.h>
|
||||
|
||||
void Factory::setStaticFrameworkObjectIds() {
|
||||
PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR;
|
||||
PusServiceBase::packetDestination = objects::TM_FUNNEL;
|
||||
|
||||
CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR;
|
||||
CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL;
|
||||
|
||||
TmFunnel::downlinkDestination = objects::UDP_BRIDGE;
|
||||
// No storage object for now.
|
||||
TmFunnel::storageDestination = objects::NO_OBJECT;
|
||||
|
||||
LocalDataPoolManager::defaultHkDestination = objects::NO_OBJECT;
|
||||
|
||||
VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION;
|
||||
TmPacketStored::timeStamperId = objects::TIME_STAMPER;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ObjectFactory::produce(){
|
||||
Factory::setStaticFrameworkObjectIds();
|
||||
ObjectFactory::produceGenericObjects();
|
||||
|
||||
/* Cookies */
|
||||
CspCookie* p60DockCspCookie = new CspCookie(P60Dock::MAX_REPLY_LENGTH,
|
||||
addresses::P60DOCK);
|
||||
CspCookie* pdu1CspCookie = new CspCookie(PDU::MAX_REPLY_LENGTH,
|
||||
addresses::PDU1);
|
||||
CspCookie* pdu2CspCookie = new CspCookie(PDU::MAX_REPLY_LENGTH,
|
||||
addresses::PDU2);
|
||||
CspCookie* acuCspCookie = new CspCookie(ACU::MAX_REPLY_LENGTH,
|
||||
addresses::ACU);
|
||||
|
||||
/* Communication interfaces */
|
||||
new CspComIF(objects::CSP_COM_IF);
|
||||
|
||||
/* Device Handler */
|
||||
new GomspaceDeviceHandler(objects::P60DOCK_HANDLER, objects::CSP_COM_IF,
|
||||
p60DockCspCookie, P60Dock::MAX_CONFIGTABLE_ADDRESS,
|
||||
P60Dock::MAX_HKTABLE_ADDRESS);
|
||||
new GomspaceDeviceHandler(objects::PDU1_HANDLER, objects::CSP_COM_IF,
|
||||
pdu1CspCookie, PDU::MAX_CONFIGTABLE_ADDRESS,
|
||||
PDU::MAX_HKTABLE_ADDRESS);
|
||||
new GomspaceDeviceHandler(objects::PDU2_HANDLER, objects::CSP_COM_IF,
|
||||
pdu2CspCookie, PDU::MAX_CONFIGTABLE_ADDRESS,
|
||||
PDU::MAX_HKTABLE_ADDRESS);
|
||||
new GomspaceDeviceHandler(objects::ACU_HANDLER, objects::CSP_COM_IF,
|
||||
acuCspCookie, ACU::MAX_CONFIGTABLE_ADDRESS,
|
||||
ACU::MAX_HKTABLE_ADDRESS);
|
||||
|
||||
new TmTcUnixUdpBridge(objects::UDP_BRIDGE,
|
||||
objects::CCSDS_PACKET_DISTRIBUTOR,
|
||||
objects::TM_STORE, objects::TC_STORE);
|
||||
new TcUnixUdpPollingTask(objects::UDP_POLLING_TASK, objects::UDP_BRIDGE);
|
||||
}
|
10
bsp_q7s/ObjectFactory.h
Normal file
10
bsp_q7s/ObjectFactory.h
Normal file
@ -0,0 +1,10 @@
|
||||
#ifndef BSP_Q7S_OBJECTFACTORY_H_
|
||||
#define BSP_Q7S_OBJECTFACTORY_H_
|
||||
|
||||
|
||||
namespace ObjectFactory {
|
||||
void setStatics();
|
||||
void produce();
|
||||
};
|
||||
|
||||
#endif /* BSP_Q7S_OBJECTFACTORY_H_ */
|
@ -1,4 +1,4 @@
|
||||
#include "print.h"
|
||||
#include <bsp_q7s/boardconfig/print.h>
|
||||
#include <stdio.h>
|
||||
|
||||
void printChar(const char* character, bool errStream) {
|
@ -1,5 +1,6 @@
|
||||
#include "CspComIF.h"
|
||||
#include <bsp_linux/comIF/cookies/CspCookie.h>
|
||||
#include "cookies/CspCookie.h"
|
||||
|
||||
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
|
||||
#include <csp/drivers/can_socketcan.h>
|
||||
#include <fsfw/serialize/SerializeAdapter.h>
|
@ -1,8 +1,8 @@
|
||||
#ifndef BSP_LINUX_COMIF_COOKIES_CSPCOOKIE_H_
|
||||
#define BSP_LINUX_COMIF_COOKIES_CSPCOOKIE_H_
|
||||
#ifndef BSP_Q7S_COMIF_COOKIES_CSPCOOKIE_H_
|
||||
#define BSP_Q7S_COMIF_COOKIES_CSPCOOKIE_H_
|
||||
|
||||
#include <fsfw/devicehandlers/CookieIF.h>
|
||||
#include <stdint.h>
|
||||
#include <cstdint>
|
||||
|
||||
/**
|
||||
* @brief This is the cookie for devices supporting the CSP (CubeSat Space
|
||||
@ -24,4 +24,4 @@ private:
|
||||
uint8_t cspAddress;
|
||||
};
|
||||
|
||||
#endif /* BSP_LINUX_COMIF_COOKIES_CSPCOOKIE_H_ */
|
||||
#endif /* BSP_Q7S_COMIF_COOKIES_CSPCOOKIE_H_ */
|
29
bsp_q7s/main.cpp
Normal file
29
bsp_q7s/main.cpp
Normal file
@ -0,0 +1,29 @@
|
||||
#include "InitMission.h"
|
||||
#include <OBSWVersion.h>
|
||||
#include <fsfw/tasks/TaskFactory.h>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
/**
|
||||
* @brief This is the main program for the target hardware.
|
||||
* @return
|
||||
*/
|
||||
int main(void)
|
||||
{
|
||||
std::cout << "-- EIVE OBSW --" << std::endl;
|
||||
std::cout << "-- Compiled for Linux " << " --" << std::endl;
|
||||
std::cout << "-- Software version " << SW_NAME << " v" << SW_VERSION << "."
|
||||
<< SW_SUBVERSION << "." << SW_SUBSUBVERSION << " -- " << std::endl;
|
||||
std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl;
|
||||
|
||||
InitMission::initMission();
|
||||
|
||||
for(;;) {
|
||||
// suspend main thread by sleeping it.
|
||||
TaskFactory::delayTask(5000);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,11 @@
|
||||
target_sources(${TARGET_NAME} PUBLIC
|
||||
|
||||
InitMission.cpp
|
||||
main.cpp
|
||||
ObjectFactory.cpp
|
||||
)
|
||||
|
||||
add_subdirectory(boardconfig)
|
||||
|
||||
|
||||
|
||||
|
||||
|
158
bsp_rpi/InitMission.cpp
Normal file
158
bsp_rpi/InitMission.cpp
Normal file
@ -0,0 +1,158 @@
|
||||
#include "InitMission.h"
|
||||
#include "ObjectFactory.h"
|
||||
|
||||
#include <fsfw/objectmanager/ObjectManagerIF.h>
|
||||
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
||||
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
|
||||
#include <fsfw/objectmanager/ObjectManager.h>
|
||||
#include <fsfw/tasks/FixedTimeslotTaskIF.h>
|
||||
#include <fsfw/tasks/PeriodicTaskIF.h>
|
||||
#include <fsfw/tasks/TaskFactory.h>
|
||||
#include <fsfwconfig/objects/systemObjectList.h>
|
||||
#include <fsfwconfig/OBSWConfig.h>
|
||||
#include <fsfwconfig/pollingsequence/PollingSequenceFactory.h>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
// This is configured for linux without \cr
|
||||
#ifdef LINUX
|
||||
ServiceInterfaceStream sif::debug("DEBUG");
|
||||
ServiceInterfaceStream sif::info("INFO");
|
||||
ServiceInterfaceStream sif::warning("WARNING");
|
||||
ServiceInterfaceStream sif::error("ERROR", false, false, true);
|
||||
#else
|
||||
ServiceInterfaceStream sif::debug("DEBUG", true);
|
||||
ServiceInterfaceStream sif::info("INFO", true);
|
||||
ServiceInterfaceStream sif::warning("WARNING", true);
|
||||
ServiceInterfaceStream sif::error("ERROR", true, false, true);
|
||||
#endif
|
||||
|
||||
ObjectManagerIF *objectManager = nullptr;
|
||||
|
||||
void InitMission::initMission() {
|
||||
sif::info << "Building global objects.." << std::endl;
|
||||
/* Instantiate global object manager and also create all objects */
|
||||
objectManager = new ObjectManager(ObjectFactory::produce);
|
||||
sif::info << "Initializing all objects.." << std::endl;
|
||||
objectManager->initialize();
|
||||
|
||||
/* This function creates and starts all tasks */
|
||||
initTasks();
|
||||
}
|
||||
|
||||
void InitMission::initTasks(){
|
||||
/* TMTC Distribution */
|
||||
PeriodicTaskIF* TmTcDistributor = TaskFactory::instance()->
|
||||
createPeriodicTask("DIST", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE,
|
||||
0.100, nullptr);
|
||||
ReturnValue_t result = TmTcDistributor->addComponent(
|
||||
objects::CCSDS_PACKET_DISTRIBUTOR);
|
||||
if(result!=HasReturnvaluesIF::RETURN_OK){
|
||||
sif::error << "Object add component failed" << std::endl;
|
||||
}
|
||||
result = TmTcDistributor->addComponent(objects::PUS_PACKET_DISTRIBUTOR);
|
||||
if(result!=HasReturnvaluesIF::RETURN_OK){
|
||||
sif::error << "Object add component failed" << std::endl;
|
||||
}
|
||||
result = TmTcDistributor->addComponent(objects::TM_FUNNEL);
|
||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "Object add component failed" << std::endl;
|
||||
}
|
||||
|
||||
/* UDP bridge */
|
||||
PeriodicTaskIF* UdpBridgeTask = TaskFactory::instance()->createPeriodicTask(
|
||||
"UDP_UNIX_BRIDGE", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE,
|
||||
0.2, nullptr);
|
||||
result = UdpBridgeTask->addComponent(objects::UDP_BRIDGE);
|
||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "Add component UDP Unix Bridge failed" << std::endl;
|
||||
}
|
||||
PeriodicTaskIF* UdpPollingTask = TaskFactory::instance()->
|
||||
createPeriodicTask("UDP_POLLING", 80,
|
||||
PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, nullptr);
|
||||
result = UdpPollingTask->addComponent(objects::UDP_POLLING_TASK);
|
||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "Add component UDP Polling failed" << std::endl;
|
||||
}
|
||||
|
||||
/* PUS Services */
|
||||
PeriodicTaskIF* PusVerification = TaskFactory::instance()->
|
||||
createPeriodicTask("PUS_VERIF_1", 40,
|
||||
PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, nullptr);
|
||||
result = PusVerification->addComponent(objects::PUS_SERVICE_1_VERIFICATION);
|
||||
if(result != HasReturnvaluesIF::RETURN_OK){
|
||||
sif::error << "Object add component failed" << std::endl;
|
||||
}
|
||||
|
||||
PeriodicTaskIF* PusEvents = TaskFactory::instance()->
|
||||
createPeriodicTask("PUS_VERIF_1", 60,
|
||||
PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, nullptr);
|
||||
result = PusVerification->addComponent(objects::PUS_SERVICE_5_EVENT_REPORTING);
|
||||
if(result != HasReturnvaluesIF::RETURN_OK){
|
||||
sif::error << "Object add component failed" << std::endl;
|
||||
}
|
||||
|
||||
PeriodicTaskIF* PusHighPrio = TaskFactory::instance()->
|
||||
createPeriodicTask("PUS_HIGH_PRIO", 50,
|
||||
PeriodicTaskIF::MINIMUM_STACK_SIZE,
|
||||
0.200, nullptr);
|
||||
result = PusHighPrio->addComponent(objects::PUS_SERVICE_2_DEVICE_ACCESS);
|
||||
if(result!=HasReturnvaluesIF::RETURN_OK){
|
||||
sif::error << "Object add component failed" << std::endl;
|
||||
}
|
||||
result = PusHighPrio->addComponent(objects::PUS_SERVICE_9_TIME_MGMT);
|
||||
if(result!=HasReturnvaluesIF::RETURN_OK){
|
||||
sif::error << "Object add component failed" << std::endl;
|
||||
}
|
||||
|
||||
PeriodicTaskIF* PusMedPrio = TaskFactory::instance()->
|
||||
createPeriodicTask("PUS_HIGH_PRIO", 40,
|
||||
PeriodicTaskIF::MINIMUM_STACK_SIZE,
|
||||
0.8, nullptr);
|
||||
result = PusMedPrio->addComponent(objects::PUS_SERVICE_8_FUNCTION_MGMT);
|
||||
if(result!=HasReturnvaluesIF::RETURN_OK){
|
||||
sif::error << "Object add component failed" << std::endl;
|
||||
}
|
||||
result = PusMedPrio->addComponent(objects::PUS_SERVICE_200_MODE_MGMT);
|
||||
if(result!=HasReturnvaluesIF::RETURN_OK){
|
||||
sif::error << "Object add component failed" << std::endl;
|
||||
}
|
||||
|
||||
PeriodicTaskIF* PusLowPrio = TaskFactory::instance()->
|
||||
createPeriodicTask("PUSB", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE,
|
||||
1.6, nullptr);
|
||||
result = PusLowPrio->addComponent(objects::PUS_SERVICE_17_TEST);
|
||||
if(result!=HasReturnvaluesIF::RETURN_OK){
|
||||
sif::error << "Object add component failed" << std::endl;
|
||||
}
|
||||
|
||||
|
||||
#if OBSW_ADD_TEST_CODE == 1
|
||||
FixedTimeslotTaskIF* TestTimeslotTask = TaskFactory::instance()->
|
||||
createFixedTimeslotTask("PST_TEST_TASK", 10,
|
||||
PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, nullptr);
|
||||
result = pst::pollingSequenceTestFunction(TestTimeslotTask);
|
||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "InitMission::createTasks: Test PST initialization "
|
||||
<< "failed!" << std::endl;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//Main thread sleep
|
||||
sif::info << "Starting tasks.." << std::endl;
|
||||
TmTcDistributor->startTask();
|
||||
UdpBridgeTask->startTask();
|
||||
UdpPollingTask->startTask();
|
||||
|
||||
PusVerification->startTask();
|
||||
PusEvents->startTask();
|
||||
PusHighPrio->startTask();
|
||||
PusMedPrio->startTask();
|
||||
PusLowPrio->startTask();
|
||||
|
||||
#if OBSW_ADD_TEST_CODE == 1
|
||||
TestTimeslotTask->startTask();
|
||||
#endif
|
||||
sif::info << "Tasks started.." << std::endl;
|
||||
}
|
10
bsp_rpi/boardconfig/CMakeLists.txt
Normal file
10
bsp_rpi/boardconfig/CMakeLists.txt
Normal file
@ -0,0 +1,10 @@
|
||||
target_sources(${TARGET_NAME} PRIVATE
|
||||
print.c
|
||||
)
|
||||
|
||||
target_include_directories(${TARGET_NAME} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
|
||||
|
38
bsp_rpi/boardconfig/etl_profile.h
Normal file
38
bsp_rpi/boardconfig/etl_profile.h
Normal file
@ -0,0 +1,38 @@
|
||||
///\file
|
||||
|
||||
/******************************************************************************
|
||||
The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
https://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2019 jwellbelove
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files(the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions :
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
#ifndef __ETL_PROFILE_H__
|
||||
#define __ETL_PROFILE_H__
|
||||
|
||||
#define ETL_CHECK_PUSH_POP
|
||||
|
||||
#define ETL_CPP11_SUPPORTED 1
|
||||
#define ETL_NO_NULLPTR_SUPPORT 0
|
||||
|
||||
#endif
|
14
bsp_rpi/boardconfig/gcov.h
Normal file
14
bsp_rpi/boardconfig/gcov.h
Normal file
@ -0,0 +1,14 @@
|
||||
#ifndef LINUX_GCOV_H_
|
||||
#define LINUX_GCOV_H_
|
||||
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
|
||||
|
||||
#ifdef GCOV
|
||||
extern "C" void __gcov_flush();
|
||||
#else
|
||||
void __gcov_flush() {
|
||||
sif::info << "GCC GCOV: Please supply GCOV=1 in Makefile if "
|
||||
"coverage information is desired.\n" << std::flush;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LINUX_GCOV_H_ */
|
14
bsp_rpi/boardconfig/print.c
Normal file
14
bsp_rpi/boardconfig/print.c
Normal file
@ -0,0 +1,14 @@
|
||||
#include <bsp_q7s/boardconfig/print.h>
|
||||
#include <stdio.h>
|
||||
|
||||
void printChar(const char* character, bool errStream) {
|
||||
if(errStream) {
|
||||
putc(*character, stderr);
|
||||
return;
|
||||
}
|
||||
putc(*character, stdout);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
8
bsp_rpi/boardconfig/print.h
Normal file
8
bsp_rpi/boardconfig/print.h
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef HOSTED_BOARDCONFIG_PRINT_H_
|
||||
#define HOSTED_BOARDCONFIG_PRINT_H_
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
void printChar(const char* character, bool errStream);
|
||||
|
||||
#endif /* HOSTED_BOARDCONFIG_PRINT_H_ */
|
@ -10,7 +10,6 @@ elseif(${OS_FSFW} STREQUAL rtems)
|
||||
elseif(${OS_FSFW} STREQUAL linux)
|
||||
add_definitions(-DUNIX -DLINUX)
|
||||
find_package(Threads REQUIRED)
|
||||
set(BSP_PATH "bsp_linux")
|
||||
# Hosted
|
||||
else()
|
||||
set(BSP_PATH "bsp_hosted")
|
||||
@ -54,8 +53,10 @@ endif()
|
||||
|
||||
|
||||
if(TGT_BSP)
|
||||
if (${TGT_BSP} MATCHES "arm/raspberrypi" OR ${TGT_BSP} MATCHES "arm/q7s")
|
||||
# set(BSP_PATH "bsp_linux")
|
||||
if (${TGT_BSP} MATCHES "arm/raspberrypi")
|
||||
set(BSP_PATH "bsp_rpi")
|
||||
elseif(${TGT_BSP} MATCHES "arm/q7s")
|
||||
set(BSP_PATH "bsp_q7s")
|
||||
else()
|
||||
message(WARNING "CMake not configured for this target!")
|
||||
message(FATAL_ERROR "Target: ${TGT_BSP}!")
|
||||
|
12
libcsp/CMakeLists.txt
Normal file
12
libcsp/CMakeLists.txt
Normal file
@ -0,0 +1,12 @@
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
set(LIB_CSP_NAME libcsp)
|
||||
|
||||
add_library(${LIB_CSP_NAME})
|
||||
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(include)
|
||||
|
||||
target_include_directories(${LIB_CSP_NAME} PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
7
libcsp/include/CMakeLists.txt
Normal file
7
libcsp/include/CMakeLists.txt
Normal file
@ -0,0 +1,7 @@
|
||||
target_include_directories(${LIB_CSP_NAME} PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/csp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/csp/crypto
|
||||
)
|
||||
|
||||
|
25
libcsp/src/CMakeLists.txt
Normal file
25
libcsp/src/CMakeLists.txt
Normal file
@ -0,0 +1,25 @@
|
||||
target_sources(${LIB_CSP_NAME} PRIVATE
|
||||
csp_bridge.c
|
||||
csp_buffer.c
|
||||
csp_conn.c
|
||||
csp_crc32.c
|
||||
csp_debug.c
|
||||
csp_dedup.c
|
||||
csp_endian.c
|
||||
csp_hex_dump.c
|
||||
csp_pflist.c
|
||||
csp_io.c
|
||||
csp_port.c
|
||||
csp_promisc.c
|
||||
csp_qfifo.c
|
||||
csp_route.c
|
||||
csp_service_handler.c
|
||||
csp_services.c
|
||||
csp_sfp.c
|
||||
)
|
||||
|
||||
add_subdirectory(drivers)
|
||||
add_subdirectory(crypto)
|
||||
add_subdirectory(interfaces)
|
||||
add_subdirectory(rtable)
|
||||
|
9
libcsp/src/arch/posix/CMakeLists.txt
Normal file
9
libcsp/src/arch/posix/CMakeLists.txt
Normal file
@ -0,0 +1,9 @@
|
||||
target_sources(${LIB_CSP_NAME} PRIVATE
|
||||
csp_malloc.c
|
||||
csp_queue.c
|
||||
csp_sempahore.c
|
||||
csp_system.c
|
||||
csp_thread.c
|
||||
csp_time.c
|
||||
pthread_queue.c
|
||||
)
|
5
libcsp/src/crypto/CMakeLists.txt
Normal file
5
libcsp/src/crypto/CMakeLists.txt
Normal file
@ -0,0 +1,5 @@
|
||||
target_sources(${LIB_CSP_NAME} PRIVATE
|
||||
csp_hmac.c
|
||||
csp_sha1.c
|
||||
csp_xtea.c
|
||||
)
|
1
libcsp/src/drivers/CMakeLists.txt
Normal file
1
libcsp/src/drivers/CMakeLists.txt
Normal file
@ -0,0 +1 @@
|
||||
add_subdirectory(can)
|
3
libcsp/src/drivers/can/CMakeLists.txt
Normal file
3
libcsp/src/drivers/can/CMakeLists.txt
Normal file
@ -0,0 +1,3 @@
|
||||
target_sources(${LIB_CSP_NAME} PRIVATE
|
||||
can_socketcan.c
|
||||
)
|
7
libcsp/src/interfaces/CMakeLists.txt
Normal file
7
libcsp/src/interfaces/CMakeLists.txt
Normal file
@ -0,0 +1,7 @@
|
||||
target_sources(${LIB_CSP_NAME} PRIVATE
|
||||
csp_if_can_pbuf.c
|
||||
csp_if_can.c
|
||||
csp_if_i2c.c
|
||||
csp_if_kiss.c
|
||||
csp_if_lo.c
|
||||
)
|
3
libcsp/src/rtable/CMakeLists.txt
Normal file
3
libcsp/src/rtable/CMakeLists.txt
Normal file
@ -0,0 +1,3 @@
|
||||
target_sources(${LIB_CSP_NAME} PRIVATE
|
||||
csp_rtable_cidr.c
|
||||
)
|
4
libcsp/src/transport/CMakeLists.txt
Normal file
4
libcsp/src/transport/CMakeLists.txt
Normal file
@ -0,0 +1,4 @@
|
||||
target_sources(${LIB_CSP_NAME} PRIVATE
|
||||
csp_rdp.c
|
||||
csp_udp.c
|
||||
)
|
@ -1,9 +1,9 @@
|
||||
#include "GenericFactory.h"
|
||||
#include <fsfwconfig/objects/systemObjectList.h>
|
||||
#include <fsfwconfig/tmtc/apid.h>
|
||||
#include <fsfwconfig/tmtc/pusIds.h>
|
||||
|
||||
#include <fsfwconfig/OBSWconfig.h>
|
||||
#include <fsfwconfig/devices/addresses.h>
|
||||
|
||||
#include <tmtc/apid.h>
|
||||
#include <tmtc/pusIds.h>
|
||||
|
||||
#include <fsfw/events/EventManager.h>
|
||||
#include <fsfw/health/HealthTable.h>
|
||||
@ -21,13 +21,9 @@
|
||||
#include <fsfw/tcdistribution/PUSDistributor.h>
|
||||
#include <fsfw/timemanager/TimeStamper.h>
|
||||
#include <mission/utility/TmFunnel.h>
|
||||
#include <bsp_linux/comIF/cookies/CspCookie.h>
|
||||
#include <bsp_linux/comIF/CspComIF.h>
|
||||
#include "mission/devices/GomspaceDeviceHandler.h"
|
||||
#include "mission/devices/devicedefinitions/GomspaceDefinitions.h"
|
||||
|
||||
#if ADD_TEST_CODE == 1
|
||||
//#include <test/testtasks/TestTask.h>
|
||||
#if OBSW_ADD_TEST_CODE == 1
|
||||
#include <test/testtasks/TestTask.h>
|
||||
#endif
|
||||
|
||||
void ObjectFactory::produceGenericObjects() {
|
||||
@ -84,35 +80,8 @@ void ObjectFactory::produceGenericObjects() {
|
||||
new CService200ModeCommanding(objects::PUS_SERVICE_200_MODE_MGMT,
|
||||
apid::EIVE_OBSW, pus::PUS_SERVICE_200);
|
||||
|
||||
/* Cookies */
|
||||
CspCookie* p60DockCspCookie = new CspCookie(P60Dock::MAX_REPLY_LENGTH,
|
||||
addresses::P60DOCK);
|
||||
CspCookie* pdu1CspCookie = new CspCookie(PDU::MAX_REPLY_LENGTH,
|
||||
addresses::PDU1);
|
||||
CspCookie* pdu2CspCookie = new CspCookie(PDU::MAX_REPLY_LENGTH,
|
||||
addresses::PDU2);
|
||||
CspCookie* acuCspCookie = new CspCookie(ACU::MAX_REPLY_LENGTH,
|
||||
addresses::ACU);
|
||||
|
||||
/* Communication interfaces */
|
||||
new CspComIF(objects::CSP_COM_IF);
|
||||
|
||||
/* Device Handler */
|
||||
new GomspaceDeviceHandler(objects::P60DOCK_HANDLER, objects::CSP_COM_IF,
|
||||
p60DockCspCookie, P60Dock::MAX_CONFIGTABLE_ADDRESS,
|
||||
P60Dock::MAX_HKTABLE_ADDRESS);
|
||||
new GomspaceDeviceHandler(objects::PDU1_HANDLER, objects::CSP_COM_IF,
|
||||
pdu1CspCookie, PDU::MAX_CONFIGTABLE_ADDRESS,
|
||||
PDU::MAX_HKTABLE_ADDRESS);
|
||||
new GomspaceDeviceHandler(objects::PDU2_HANDLER, objects::CSP_COM_IF,
|
||||
pdu2CspCookie, PDU::MAX_CONFIGTABLE_ADDRESS,
|
||||
PDU::MAX_HKTABLE_ADDRESS);
|
||||
new GomspaceDeviceHandler(objects::ACU_HANDLER, objects::CSP_COM_IF,
|
||||
acuCspCookie, ACU::MAX_CONFIGTABLE_ADDRESS,
|
||||
ACU::MAX_HKTABLE_ADDRESS);
|
||||
|
||||
/* Test Device Handler */
|
||||
#if ADD_TEST_CODE == 1
|
||||
// new TestTask(objects::TEST_TASK);
|
||||
#if OBSW_ADD_TEST_CODE == 1
|
||||
new TestTask(objects::TEST_TASK);
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user