RASCSI/cpp/hal/gpiobus_factory.cpp
Uwe Seimet 1c0179e7e3
rasdump and monitor updates, made rasdump work, improved bus abstraction (#973)
* Moved rasdump and monitor to sub-folders, cleaned up code

* Fixes rasdump issues and added additional features like device type check, LUN support and configurable buffer size
2022-11-09 08:40:26 +01:00

28 lines
697 B
C++

//---------------------------------------------------------------------------
//
// SCSI Target Emulator RaSCSI Reloaded
// for Raspberry Pi
//
// Copyright (C) 2022 akuker
//
//---------------------------------------------------------------------------
#include "hal/gpiobus_factory.h"
#include "hal/gpiobus.h"
using namespace std;
unique_ptr<BUS> GPIOBUS_Factory::Create(BUS::mode_e mode)
{
// TODO Make the factory a friend of GPIOBUS and make the GPIOBUS constructor private
// so that clients cannot use it anymore but have to use the factory.
// Also make Init() private.
if (auto bus = make_unique<GPIOBUS>(); bus->Init(mode)) {
bus->Reset();
return bus;
}
return nullptr;
}