Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <async/IRunnable.h>
#include <async/util/Call.h>
#include <lifecycle/AsyncLifecycleComponent.h>
#include <systems/IEthernetDriverSystem.h>
#include <systems/IEthernetSystem.h>

namespace systems
{
Expand Down Expand Up @@ -45,7 +45,7 @@ class EthernetSystem
{
public:
explicit EthernetSystem(
::async::ContextType context, ::ethernet::IEthernetDriverSystem& ethernetSystem);
::async::ContextType context, ::ethernet::IEthernetSystem& ethernetSystem);

EthernetSystem(EthernetSystem const&) = delete;
EthernetSystem& operator=(EthernetSystem const&) = delete;
Expand All @@ -56,7 +56,7 @@ class EthernetSystem

void execute() override;

::ethernet::IEthernetDriverSystem& ethernetDriverSystem;
::ethernet::IEthernetSystem& ethernetDriverSystem;
Netifs<::ethX::NUM_NETIFS> netifs;

private:
Expand Down
16 changes: 11 additions & 5 deletions executables/referenceApp/application/src/app/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,25 @@
#ifdef PLATFORM_SUPPORT_CAN
#include <systems/ICanSystem.h>

namespace platform
{
namespace systems
{
extern ::can::ICanSystem& getCanSystem();
} // namespace systems
} // namespace platform
#endif

#ifdef PLATFORM_SUPPORT_ETHERNET
#include <systems/IEthernetDriverSystem.h>
#include <systems/IEthernetSystem.h>

namespace platform
{
namespace systems
{
extern ::ethernet::IEthernetDriverSystem& getEthernetSystem();
extern ::ethernet::IEthernetSystem& getEthernetSystem();
} // namespace systems
} // namespace platform
#endif

#include <platform/estdint.h>
Expand Down Expand Up @@ -212,12 +218,12 @@ void startApp()
/* runlevel 5 */
#ifdef PLATFORM_SUPPORT_CAN
lifecycleManager.addComponent(
"docan", doCanSystem.create(*transportSystem, ::systems::getCanSystem(), TASK_CAN), 5U);
"docan", doCanSystem.create(*transportSystem, ::platform::systems::getCanSystem(), TASK_CAN), 5U);
#endif

#ifdef PLATFORM_SUPPORT_ETHERNET
lifecycleManager.addComponent(
"ethernet", ethernetSystem.create(TASK_ETHERNET, ::systems::getEthernetSystem()), 5U);
"ethernet", ethernetSystem.create(TASK_ETHERNET, ::platform::systems::getEthernetSystem()), 5U);
#endif

#ifdef PLATFORM_SUPPORT_STORAGE
Expand Down Expand Up @@ -246,7 +252,7 @@ void startApp()
TASK_DEMO,
lifecycleManager
#ifdef PLATFORM_SUPPORT_CAN
, ::systems::getCanSystem()
, ::platform::systems::getCanSystem()
#endif
#ifdef PLATFORM_SUPPORT_STORAGE
, (*storageSystem).getStorage()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ namespace systems
{

EthernetSystem::EthernetSystem(
::async::ContextType const context, ::ethernet::IEthernetDriverSystem& ethernetSystem)
::async::ContextType const context, ::ethernet::IEthernetSystem& ethernetSystem)
: ethernetDriverSystem(ethernetSystem), _context(context), _executeCounter(0)
{
#if LWIP_NETIF_SPECIFIC_TTL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
namespace ethernet
{

class IEthernetDriverSystem
class IEthernetSystem
{
protected:
~IEthernetDriverSystem() = default;
~IEthernetSystem() = default;

public:
virtual void setGroupcastAddressRecognition(::etl::array<uint8_t, 6> const mac) const = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

#include <ethernet/EthernetLogger.h>
#include <lifecycle/AsyncLifecycleComponent.h>
#include <systems/IEthernetDriverSystem.h>
#include <systems/IEthernetSystem.h>

namespace systems
{

class TapEthernetSystem final
: public ::ethernet::IEthernetDriverSystem
: public ::ethernet::IEthernetSystem
, public ::lifecycle::AsyncLifecycleComponent
, public ::async::IRunnable
{
Expand Down
16 changes: 7 additions & 9 deletions executables/referenceApp/platforms/posix/main/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,20 @@ void platformLifecycleAdd(::lifecycle::LifecycleManager& lifecycleManager, uint8
}
}

} // namespace platform

#ifdef PLATFORM_SUPPORT_CAN
namespace systems
{

#ifdef PLATFORM_SUPPORT_CAN
::can::ICanSystem& getCanSystem() { return *::platform::canSystem; }
} // namespace systems
#endif // PLATFORM_SUPPORT_CAN

#ifdef PLATFORM_SUPPORT_ETHERNET
namespace systems
{
::ethernet::IEthernetDriverSystem& getEthernetSystem() { return *::platform::tapEthernetSystem; }
} // namespace systems
::ethernet::IEthernetSystem& getEthernetSystem() { return *::platform::tapEthernetSystem; }
#endif // PLATFORM_SUPPORT_ETHERNET

} // namespace systems

} // namespace platform

extern "C"
{
void putchar_(char character) { putchar(character); }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
#include "lifecycle/ILifecycleManager.h"
#include "phy/Tja1101.h"
#include "phy/Tja1101Tester.h"
#include "systems/IEthernetDriverSystem.h"
#include "systems/IEthernetSystem.h"

namespace systems
{

class S32K148EvbEthernetSystem final
: public ::ethernet::IEthernetDriverSystem
: public ::ethernet::IEthernetSystem
, private ::async::IRunnable
, public ::lifecycle::AsyncLifecycleComponent
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "commonDebug.h"
#include "interrupt_manager.h"
#include "lifecycle/StaticBsp.h"
#include "systems/IEthernetDriverSystem.h"
#include "systems/IEthernetSystem.h"
#include "watchdog/Watchdog.h"

#include <lifecycle/LifecycleManager.h>
Expand Down Expand Up @@ -121,7 +121,7 @@ ::can::ICanSystem& getCanSystem() { return *::platform::canSystem; }
#ifdef PLATFORM_SUPPORT_ETHERNET
namespace systems
{
::ethernet::IEthernetDriverSystem& getEthernetSystem() { return *::platform::s32kEthernetSystem; }
::ethernet::IEthernetSystem& getEthernetSystem() { return *::platform::s32kEthernetSystem; }
} // namespace systems
#endif // PLATFORM_SUPPORT_ETHERNET

Expand Down
Loading