Skip to content

Commit 85b5966

Browse files
committed
Moved BlockDrv to Ref
1 parent f440784 commit 85b5966

22 files changed

+79
-156
lines changed

Drv/BlockDriver/BlockDriver.hpp

Lines changed: 0 additions & 17 deletions
This file was deleted.

Drv/BlockDriver/BlockDriverImpl.cpp

Lines changed: 0 additions & 57 deletions
This file was deleted.

Drv/BlockDriver/CMakeLists.txt

Lines changed: 0 additions & 29 deletions
This file was deleted.

Drv/BlockDriver/Tlm.xml

Lines changed: 0 additions & 7 deletions
This file was deleted.

Drv/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Ports/")
55

66
# Components
7-
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/BlockDriver/")
87
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/ByteStreamDriverModel/")
98
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/LinuxGpioDriver/")
109
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/LinuxUartDriver/")

Ref/BlockDriver/BlockDriver.cpp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#include <Ref/BlockDriver/BlockDriver.hpp>
2+
#include <Fw/FPrimeBasicTypes.hpp>
3+
#include <Fw/Types/Assert.hpp>
4+
5+
namespace Ref {
6+
7+
BlockDriver::BlockDriver(const char* compName) :
8+
BlockDriverComponentBase(compName), m_cycles(0)
9+
{}
10+
11+
BlockDriver::~BlockDriver() {}
12+
13+
void BlockDriver::BufferIn_handler(FwIndexType portNum, Drv::DataBuffer& buffer) {
14+
// just a pass-through
15+
this->BufferOut_out(0,buffer);
16+
}
17+
18+
void BlockDriver::Sched_handler(FwIndexType portNum, U32 context) {
19+
this->m_cycles++;
20+
}
21+
22+
void BlockDriver::PingIn_handler(
23+
const FwIndexType portNum,
24+
U32 key
25+
)
26+
{
27+
// call ping output port
28+
this->PingOut_out(0,key);
29+
}
30+
31+
}

Drv/BlockDriver/BlockDriver.fpp renamed to Ref/BlockDriver/BlockDriver.fpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Drv {
1+
module Ref {
22

33
@ An example block driver component with data buffers and interrupts
44
active component BlockDriver {
@@ -7,7 +7,7 @@ module Drv {
77
# General ports
88
# ----------------------------------------------------------------------
99

10-
include "../Interfaces/TickInterface.fppi"
10+
include "../../Drv/Interfaces/TickInterface.fppi"
1111

1212
@ The rate group scheduler input
1313
async input port Sched: Svc.Sched
@@ -34,16 +34,6 @@ module Drv {
3434
@ Telemetry port
3535
telemetry port Tlm
3636

37-
# ----------------------------------------------------------------------
38-
# Internal ports
39-
# ----------------------------------------------------------------------
40-
41-
@ Internal interrupt reporting interface
42-
internal port InterruptReport(
43-
interrupt: U32 @< The interrupt register value
44-
) \
45-
priority 1
46-
4737
# ----------------------------------------------------------------------
4838
# Telemetry
4939
# ----------------------------------------------------------------------

Drv/BlockDriver/BlockDriverImpl.hpp renamed to Ref/BlockDriver/BlockDriver.hpp

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
1-
#ifndef DRV_BLOCK_DRIVER_IMPL_HPP
2-
#define DRV_BLOCK_DRIVER_IMPL_HPP
1+
#ifndef REF_BLOCK_DRIVER_IMPL_HPP
2+
#define REF_BLOCK_DRIVER_IMPL_HPP
33

4-
#include <Drv/BlockDriver/BlockDriverComponentAc.hpp>
4+
#include <Ref/BlockDriver/BlockDriverComponentAc.hpp>
55

6-
namespace Drv {
6+
namespace Ref {
77

8-
class BlockDriverImpl final : public BlockDriverComponentBase {
8+
class BlockDriver final : public BlockDriverComponentBase {
99

1010
public:
1111

1212
// Only called by derived class
13-
BlockDriverImpl(const char* compName);
13+
BlockDriver(const char* compName);
1414

15-
~BlockDriverImpl();
16-
// a little hack to get the reference running
17-
void callIsr();
15+
~BlockDriver();
1816

1917
private:
2018

2119
// downcalls for input ports
22-
void InterruptReport_internalInterfaceHandler(U32 ip);
2320
void BufferIn_handler(FwIndexType portNum, Drv::DataBuffer& buffer);
2421
void Sched_handler(FwIndexType portNum, U32 context);
2522
//! Handler implementation for PingIn
@@ -29,9 +26,6 @@ namespace Drv {
2926
U32 key /*!< Value to return to pinger*/
3027
);
3128

32-
// static ISR callback
33-
static void s_driverISR(void* arg);
34-
3529
// cycle count
3630
U32 m_cycles;
3731

Ref/BlockDriver/CMakeLists.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
####
2+
# F prime CMakeLists.txt:
3+
#
4+
# SOURCE_FILES: combined list of source and autocoding files
5+
# MOD_DEPS: (optional) module dependencies
6+
#
7+
####
8+
set(SOURCE_FILES
9+
"${CMAKE_CURRENT_LIST_DIR}/BlockDriver.fpp"
10+
"${CMAKE_CURRENT_LIST_DIR}/BlockDriver.cpp"
11+
)
12+
13+
register_fprime_module()
14+
15+
### Unit Tests ###
16+
# set(UT_SOURCE_FILES
17+
# "${CMAKE_CURRENT_LIST_DIR}/BlockDriver.fpp"
18+
# "${CMAKE_CURRENT_LIST_DIR}/test/ut/BlockDriverTestMain.cpp"
19+
# "${CMAKE_CURRENT_LIST_DIR}/test/ut/BlockDriverTester.cpp"
20+
# )
21+
# set(UT_MOD_DEPS
22+
# STest
23+
# )
24+
# set(UT_AUTO_HELPERS ON)
25+
# register_fprime_ut()
26+
# set (UT_TARGET_NAME "${FPRIME_CURRENT_MODULE}_ut_exe")
27+
# if (TARGET "${UT_TARGET_NAME}")
28+
# target_compile_options("${UT_TARGET_NAME}" PRIVATE -Wno-conversion)
29+
# endif()
File renamed without changes.

0 commit comments

Comments
 (0)