diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml
index 8573010c..f4735594 100644
--- a/.github/workflows/analyze.yml
+++ b/.github/workflows/analyze.yml
@@ -23,7 +23,7 @@ jobs:
SCAN_HOST: ${{ secrets.SCAN_HOST }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- SONAR_SCANNER_VERSION: 6.0.0.4432
+ SONAR_SCANNER_VERSION: 6.1.0.4477
BUILD_WRAPPER_OUT_DIR: "$HOME/.build_wrapper_out"
APT_PACKAGES: protobuf-compiler libspdlog-dev libpcap-dev libgmock-dev
@@ -41,7 +41,7 @@ jobs:
mkdir -p $HOME/.sonar
curl -sSLo /tmp/wrapper.zip $SONAR_SERVER_URL/static/cpp/build-wrapper-linux-x86.zip
unzip -o /tmp/wrapper.zip -d $HOME/.sonar/
- curl -sSLo /tmp/scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip
+ curl -sSLo /tmp/scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux-x64.zip
unzip -o /tmp/scanner.zip -d $HOME/.sonar/
- name: Compile with coverage data
@@ -56,7 +56,7 @@ jobs:
- name: Run sonar-scanner
run: |
- $HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux/bin/sonar-scanner \
+ $HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux-x64/bin/sonar-scanner \
--define sonar.host.url=$SONAR_SERVER_URL \
--define sonar.projectKey=$SONAR_PROJECT_KEY \
--define sonar.organization=$SONAR_ORGANIZATION \
diff --git a/README.md b/README.md
index 3ef70495..6fb18a09 100644
--- a/README.md
+++ b/README.md
@@ -1,21 +1,17 @@
# What is SCSI2Pi?
-SCSI2Pi is the advanced and more performant alternative to the PiSCSI software for the PiSCSI/RaSCSI board. SCSI2Pi provides an improved device emulation, higher transfer rates, new tools for the board's initiator mode and numerous new features. SCSI2Pi is compatible with the PiSCSI web UI and the SCSI Control app.
-You can switch from PiSCSI to SCSI2Pi in seconds, simply by installing a package with the SCSI2Pi binaries. No time-consuming compilation is required.
+SCSI2Pi is the advanced and more performant alternative to the PiSCSI software for the PiSCSI/RaSCSI board. SCSI2Pi provides an improved device emulation, higher transfer rates, new SCSI initiator mode tools and numerous new features. SCSI2Pi is compatible with the PiSCSI web UI and the SCSI Control app for Android. With SCSI2Pi the app offers an extended set of features.
SCSI2Pi emulates several SCSI or SASI devices like hard drives, CD-ROM drives, printers or network adapters at the same time. You can easily add a range of devices to computers like 68k Macs, Atari ST/TT/Falcon030, Amiga, Unix workstations, samplers or other computers with SCSI port.
-The SCSI2Pi website addresses regular users and developers, whereas the information on GitHub is rather developer-centric. The website also provides binary development and release packages and information on the SCSI Control app for Android.
+You can run SCSI2Pi stand-alone or eswitch from PiSCSI to SCSI2Pi in seconds, simply by installing a package with highly optimized SCSI2Pi binaries. No time-consuming compilation is required.
+The SCSI2Pi website addresses regular users and developers, whereas the information on GitHub is rather developer-centric.
# Who am I?
-Until release 24.04.01 I was the main contributor to the PiSCSI SCSI emulation. I revised the backend architecture, added a remote interface and re-engineered most of the legacy C++ code so that it uses modern C++. This resulted in more modular code and drastically improved SonarQube code metrics. Besides adding numerous new features and improving the compatibility with many platforms, I also fixed a range of bugs and added an extensive set of unit tests.
+Until release 24.04.01 I was the main contributor to the PiSCSI SCSI emulation. I revised the backend architecture, added a remote interface and re-engineered most of the legacy code so that it uses modern C++. This resulted in more modular code and drastically improved SonarQube code metrics. Besides adding numerous new features and improving the compatibility with many platforms, I also fixed a range of bugs and added an extensive set of unit tests.
I am also the author of the HDDRIVER driver software for Atari computers and the SCSI Control app for Android, which is the remote control for your PiSCSI/RaSCSI boards. SCSI Control supports both SCSI2Pi and PiSCSI. The full range of app features requires SCSI2Pi, though.
# How is SCSI2Pi related to PiSCSI?
-In the PiSCSI project there was not much interest in replacing old, often buggy or unnecessary code, or to improve the data transfer rates. Long promised features on the roadmap and user requests in tickets were not addressed, and it took long for features or bug fixes to make it into a release. This is why I started to work on the emulation in a separate project, while staying compatible with the PiSCSI web interface. The major part of the PiSCSI C++ codebase has been contributed by me anyway.
-With PiSCSI there was also not much interest in further developing the SCSI emulation and exploiting the initiator mode feature of the FULLSPEC board. This mode, together with new SCSI2Pi command line tools, offers solutions for use cases that have never been addressed before. These tools also help with advanced testing, making the emulation more robust and reliable.
-
-# SCSI2Pi goals
-
-SCSI2Pi is not meant to completely replace the PiSCSI software, but only the device emulation and the tools. For the PiSCSI project great work is still being done on the web interface, and on supporting users in social media.
-There is no SCSI2Pi support for the X68000 platform, in particular not for the host bridge (SCBR) device. In PiSCSI the respective code has always been in a bad shape, and nobody has been interested in testing it. The other PiSCSI features (and many more) are supported by SCSI2Pi - most of these I implemented anyway ;-).
+In the PiSCSI project there was not much interest in replacing old, often buggy or unnecessary code, or to improve the data transfer rates. Long promised features on the roadmap and user requests in tickets were not addressed, and it took long for features or bug fixes to make it into a release. This is why I started to work on the emulation in a separate project, while staying compatible with the PiSCSI web interface. The major part of the PiSCSI C++ codebase has been contributed by me anyway. SCSI2Pi is not meant to completely replace the PiSCSI software, but only the device emulation and the tools.
+With PiSCSI there was also not much interest in further developing the SCSI emulation and exploiting the initiator mode feature of the FULLSPEC board. This mode, together with new SCSI2Pi command line tools, offers solutions for use cases that have never been addressed before. These tools also help with advanced testing, making the emulation more robust and reliable.
+There is no SCSI2Pi support for the X68000 platform, in particular not for the host bridge (SCBR) device. In PiSCSI the respective code has always been in a bad shape, and nobody has been interested in testing it. The other PiSCSI features (and many more) are supported and improved by SCSI2Pi.
diff --git a/cpp/base/device_factory.h b/cpp/base/device_factory.h
index cb2f7181..941108bf 100644
--- a/cpp/base/device_factory.h
+++ b/cpp/base/device_factory.h
@@ -42,8 +42,6 @@ class DeviceFactory
private:
DeviceFactory();
- DeviceFactory(const DeviceFactory&) = delete;
- DeviceFactory operator&(const DeviceFactory&) = delete;
static string GetExtensionLowerCase(string_view);
diff --git a/cpp/base/property_handler.h b/cpp/base/property_handler.h
index ff2563f7..50315f11 100644
--- a/cpp/base/property_handler.h
+++ b/cpp/base/property_handler.h
@@ -65,8 +65,6 @@ class PropertyHandler
private:
PropertyHandler() = default;
- PropertyHandler(const PropertyHandler&) = delete;
- PropertyHandler operator&(const PropertyHandler&) = delete;
static void ParsePropertyFile(property_map&, const string&, bool);
diff --git a/cpp/buses/connection_type/connection_standard.h b/cpp/buses/board.h
similarity index 82%
rename from cpp/buses/connection_type/connection_standard.h
rename to cpp/buses/board.h
index 88cc81fe..8c9a61cf 100644
--- a/cpp/buses/connection_type/connection_standard.h
+++ b/cpp/buses/board.h
@@ -11,18 +11,23 @@
#pragma once
//
-// PiSCSI/SCSI2Pi standard (SCSI logic, standard pin assignment)
+// SCSI2Pi/PiSCSI standard (SCSI logic, standard pin assignment)
//
-// Select signal control mode
-constexpr static int SIGNAL_CONTROL_MODE = 0; // SCSI logical specification
-
// Control signal pin assignment (-1 means no control)
constexpr static int PIN_ACT = 4; // ACTIVE
constexpr static int PIN_ENB = 5; // ENABLE
+#if defined BOARD_FULLSPEC
+constexpr static int PIN_IND = 6; // INITIATOR CTRL DIRECTION
+constexpr static int PIN_TAD = 7; // TARGET CTRL DIRECTION
+constexpr static int PIN_DTD = 8; // DATA DIRECTION
+#elif defined BOARD_STANDARD
constexpr static int PIN_IND = -1; // INITIATOR CTRL DIRECTION
constexpr static int PIN_TAD = -1; // TARGET CTRL DIRECTION
constexpr static int PIN_DTD = -1; // DATA DIRECTION
+#else
+#error Invalid connection type or none specified
+#endif
// Control signal output logic
#define ACT_ON ON // ACTIVE SIGNAL ON
diff --git a/cpp/buses/bus.cpp b/cpp/buses/bus.cpp
index 0191ec7b..2cd0a524 100644
--- a/cpp/buses/bus.cpp
+++ b/cpp/buses/bus.cpp
@@ -15,8 +15,6 @@
bool Bus::Init(bool mode)
{
- static_assert(SIGNAL_CONTROL_MODE == 0 || SIGNAL_CONTROL_MODE == 2);
-
target_mode = mode;
return true;
diff --git a/cpp/buses/bus.h b/cpp/buses/bus.h
index 86b1dee5..0f044999 100644
--- a/cpp/buses/bus.h
+++ b/cpp/buses/bus.h
@@ -16,41 +16,7 @@
#include
#include "shared/scsi.h"
#include "base/s2p_defs.h"
-
-#if defined BOARD_STANDARD
-#include "buses/connection_type/connection_standard.h"
-#elif defined BOARD_FULLSPEC
-#include "buses/connection_type/connection_fullspec.h"
-#elif defined BOARD_AIBOM
-#include "buses/connection_type/connection_aibom.h"
-#elif defined BOARD_GAMERNIUM
-#include "buses/connection_type/connection_gamernium.h"
-#else
-#error Invalid connection type or none specified
-#endif
-
-//---------------------------------------------------------------------------
-//
-// SIGNAL_CONTROL_MODE: Signal control mode selection
-// You can customize the signal control logic from Version 1.22
-//
-// 0: SCSI logical specification
-// Conversion board using 74LS641-1 etc. directly connected or published on HP
-// True : 0V
-// False : Open collector output (disconnect from bus)
-//
-// 1: Negative logic specification (when using conversion board for negative logic -> SCSI logic)
-// There is no conversion board with this specification at this time
-// True : 0V -> (CONVERT) -> 0V
-// False : 3.3V -> (CONVERT) -> Open collector output
-//
-// 2: Positive logic specification (when using the conversion board for positive logic -> SCSI logic)
-// PiSCSI Adapter Rev.C @132sync etc.
-//
-// True : 3.3V -> (CONVERT) -> 0V
-// False : 0V -> (CONVERT) -> Open collector output
-//
-//---------------------------------------------------------------------------
+#include "board.h"
//---------------------------------------------------------------------------
//
diff --git a/cpp/buses/bus_factory.h b/cpp/buses/bus_factory.h
index 7c5f311c..15918c39 100644
--- a/cpp/buses/bus_factory.h
+++ b/cpp/buses/bus_factory.h
@@ -39,8 +39,6 @@ class BusFactory
private:
BusFactory();
- BusFactory(const BusFactory&) = delete;
- BusFactory operator&(const BusFactory&) = delete;
void AddCommand(scsi_command, int, const char*);
diff --git a/cpp/buses/connection_type/connection_aibom.h b/cpp/buses/connection_type/connection_aibom.h
deleted file mode 100644
index 54e90edc..00000000
--- a/cpp/buses/connection_type/connection_aibom.h
+++ /dev/null
@@ -1,52 +0,0 @@
-//---------------------------------------------------------------------------
-//
-// SCSI device emulator and SCSI tools for the Raspberry Pi
-//
-// Powered by XM6 TypeG Technology.
-// Copyright (C) 2016-2020 GIMONS
-// Copyright (C) 2023-2024 Uwe Seimet
-//
-//---------------------------------------------------------------------------
-
-#pragma once
-
-//
-// RaSCSI Adapter Aibom version
-//
-
-// Select signal control mode
-constexpr static int SIGNAL_CONTROL_MODE = 2; // SCSI positive logic specification
-
-// Control signal output logic
-#define ACT_ON ON // ACTIVE SIGNAL ON
-#define ENB_ON ON // ENABLE SIGNAL ON
-#define IND_IN OFF // INITIATOR SIGNAL INPUT
-#define TAD_IN OFF // TARGET SIGNAL INPUT
-#define DTD_IN OFF // DATA SIGNAL INPUT
-
-// Control signal pin assignment (-1 means no control)
-constexpr static int PIN_ACT = 4; // ACTIVE
-constexpr static int PIN_ENB = 17; // ENABLE
-constexpr static int PIN_IND = 27; // INITIATOR CTRL DIRECTION
-constexpr static int PIN_TAD = -1; // TARGET CTRL DIRECTION
-constexpr static int PIN_DTD = 18; // DATA DIRECTION
-
-// SCSI signal pin assignment
-constexpr static int PIN_DT0 = 6; // Data 0
-constexpr static int PIN_DT1 = 12; // Data 1
-constexpr static int PIN_DT2 = 13; // Data 2
-constexpr static int PIN_DT3 = 16; // Data 3
-constexpr static int PIN_DT4 = 19; // Data 4
-constexpr static int PIN_DT5 = 20; // Data 5
-constexpr static int PIN_DT6 = 26; // Data 6
-constexpr static int PIN_DT7 = 21; // Data 7
-constexpr static int PIN_DP = 5; // Data parity
-constexpr static int PIN_ATN = 22; // ATN
-constexpr static int PIN_RST = 25; // RST
-constexpr static int PIN_ACK = 10; // ACK
-constexpr static int PIN_REQ = 7; // REQ
-constexpr static int PIN_MSG = 9; // MSG
-constexpr static int PIN_CD = 11; // CD
-constexpr static int PIN_IO = 23; // IO
-constexpr static int PIN_BSY = 24; // BSY
-constexpr static int PIN_SEL = 8; // SEL
diff --git a/cpp/buses/connection_type/connection_fullspec.h b/cpp/buses/connection_type/connection_fullspec.h
deleted file mode 100644
index 4446b6e5..00000000
--- a/cpp/buses/connection_type/connection_fullspec.h
+++ /dev/null
@@ -1,52 +0,0 @@
-//---------------------------------------------------------------------------
-//
-// SCSI device emulator and SCSI tools for the Raspberry Pi
-//
-// Powered by XM6 TypeG Technology.
-// Copyright (C) 2016-2020 GIMONS
-// Copyright (C) 2023-2024 Uwe Seimet
-//
-//---------------------------------------------------------------------------
-
-#pragma once
-
-//
-// PiSCSI/SCSI2Pi standard (SCSI logic, standard pin assignment)
-//
-
-// Select signal control mode
-constexpr static int SIGNAL_CONTROL_MODE = 0; // SCSI logical specification
-
-// Control signal pin assignment (-1 means no control)
-constexpr static int PIN_ACT = 4; // ACTIVE
-constexpr static int PIN_ENB = 5; // ENABLE
-constexpr static int PIN_IND = 6; // INITIATOR CTRL DIRECTION
-constexpr static int PIN_TAD = 7; // TARGET CTRL DIRECTION
-constexpr static int PIN_DTD = 8; // DATA DIRECTION
-
-// Control signal output logic
-#define ACT_ON ON // ACTIVE SIGNAL ON
-#define ENB_ON ON // ENABLE SIGNAL ON
-#define IND_IN OFF // INITIATOR SIGNAL INPUT
-#define TAD_IN OFF // TARGET SIGNAL INPUT
-#define DTD_IN ON // DATA SIGNAL INPUT
-
-// SCSI signal pin assignment
-constexpr static int PIN_DT0 = 10; // Data 0
-constexpr static int PIN_DT1 = 11; // Data 1
-constexpr static int PIN_DT2 = 12; // Data 2
-constexpr static int PIN_DT3 = 13; // Data 3
-constexpr static int PIN_DT4 = 14; // Data 4
-constexpr static int PIN_DT5 = 15; // Data 5
-constexpr static int PIN_DT6 = 16; // Data 6
-constexpr static int PIN_DT7 = 17; // Data 7
-constexpr static int PIN_DP = 18; // Data parity
-constexpr static int PIN_ATN = 19; // ATN
-constexpr static int PIN_RST = 20; // RST
-constexpr static int PIN_ACK = 21; // ACK
-constexpr static int PIN_REQ = 22; // REQ
-constexpr static int PIN_MSG = 23; // MSG
-constexpr static int PIN_CD = 24; // CD
-constexpr static int PIN_IO = 25; // IO
-constexpr static int PIN_BSY = 26; // BSY
-constexpr static int PIN_SEL = 27; // SEL
diff --git a/cpp/buses/connection_type/connection_gamernium.h b/cpp/buses/connection_type/connection_gamernium.h
deleted file mode 100644
index 082c6e80..00000000
--- a/cpp/buses/connection_type/connection_gamernium.h
+++ /dev/null
@@ -1,52 +0,0 @@
-//---------------------------------------------------------------------------
-//
-// SCSI device emulator and SCSI tools for the Raspberry Pi
-//
-// Powered by XM6 TypeG Technology.
-// Copyright (C) 2016-2020 GIMONS
-// Copyright (C) 2023-2024 Uwe Seimet
-//
-//---------------------------------------------------------------------------
-
-#pragma once
-
-//
-// RaSCSI Adapter GAMERnium.com version
-//
-
-// Select signal control mode
-constexpr static int SIGNAL_CONTROL_MODE = 0; // SCSI logical specification
-
-// Control signal output logic
-#define ACT_ON ON // ACTIVE SIGNAL ON
-#define ENB_ON ON // ENABLE SIGNAL ON
-#define IND_IN OFF // INITIATOR SIGNAL INPUT
-#define TAD_IN OFF // TARGET SIGNAL INPUT
-#define DTD_IN ON // DATA SIGNAL INPUT
-
-// Control signal pin assignment (-1 means no control)
-constexpr static int PIN_ACT = 14; // ACTIVE
-constexpr static int PIN_ENB = 6; // ENABLE
-constexpr static int PIN_IND = 7; // INITIATOR CTRL DIRECTION
-constexpr static int PIN_TAD = 8; // TARGET CTRL DIRECTION
-constexpr static int PIN_DTD = 5; // DATA DIRECTION
-
-// SCSI signal pin assignment
-constexpr static int PIN_DT0 = 21; // Data 0
-constexpr static int PIN_DT1 = 26; // Data 1
-constexpr static int PIN_DT2 = 20; // Data 2
-constexpr static int PIN_DT3 = 19; // Data 3
-constexpr static int PIN_DT4 = 16; // Data 4
-constexpr static int PIN_DT5 = 13; // Data 5
-constexpr static int PIN_DT6 = 12; // Data 6
-constexpr static int PIN_DT7 = 11; // Data 7
-constexpr static int PIN_DP = 25; // Data parity
-constexpr static int PIN_ATN = 10; // ATN
-constexpr static int PIN_RST = 22; // RST
-constexpr static int PIN_ACK = 24; // ACK
-constexpr static int PIN_REQ = 15; // REQ
-constexpr static int PIN_MSG = 17; // MSG
-constexpr static int PIN_CD = 18; // CD
-constexpr static int PIN_IO = 4; // IO
-constexpr static int PIN_BSY = 27; // BSY
-constexpr static int PIN_SEL = 23; // SEL
diff --git a/cpp/buses/in_process_bus.h b/cpp/buses/in_process_bus.h
index fc94e665..cd2df3f7 100644
--- a/cpp/buses/in_process_bus.h
+++ b/cpp/buses/in_process_bus.h
@@ -81,8 +81,6 @@ class InProcessBus : public Bus
protected:
InProcessBus() = default;
- InProcessBus(const InProcessBus&) = delete;
- InProcessBus operator&(const InProcessBus&) = delete;
private:
diff --git a/cpp/buses/rpi_bus.cpp b/cpp/buses/rpi_bus.cpp
index f50faad3..5da43a82 100644
--- a/cpp/buses/rpi_bus.cpp
+++ b/cpp/buses/rpi_bus.cpp
@@ -121,11 +121,7 @@ bool RpiBus::Init(bool target)
SetSignalDriveStrength(7);
// Set pull up/pull down
-#if SIGNAL_CONTROL_MODE == 0
InitializeSignals(GPIO_PULLNONE);
-#else
- InitializeSignals(GPIO_PULLDOWN);
-#endif
// Set control signals
PinSetSignal(PIN_ACT, false);
@@ -157,11 +153,7 @@ bool RpiBus::Init(bool target)
strcpy(selevreq.consumer_label, "SCSI2Pi"); // NOSONAR Using strcpy is safe
selevreq.lineoffset = PIN_SEL;
selevreq.handleflags = GPIOHANDLE_REQUEST_INPUT;
-#if SIGNAL_CONTROL_MODE == 0
selevreq.eventflags = GPIOEVENT_REQUEST_FALLING_EDGE;
-#else
- selevreq.eventflags = GPIOEVENT_REQUEST_RISING_EDGE;
-#endif
if (ioctl(fd, GPIO_GET_LINEEVENT_IOCTL, &selevreq) == -1) {
critical("Can't register event request. If s2p is running (e.g. as a service), shut it down first.");
@@ -345,37 +337,12 @@ inline uint8_t RpiBus::GetDAT()
inline void RpiBus::SetDAT(uint8_t dat)
{
-#if SIGNAL_CONTROL_MODE == 0
-#if defined BOARD_STANDARD || defined BOARD_FULLSPEC
uint32_t fsel = gpfsel[1];
// Mask for the DT0-DT7 and DP pins
fsel &= 0b11111000000000000000000000000000;
fsel |= tblDatSet[1][dat];
gpfsel[1] = fsel;
gpio[GPIO_FSEL_1] = fsel;
-#else
- uint32_t fsel = gpfsel[0];
- fsel &= tblDatMsk[0][dat];
- fsel |= tblDatSet[0][dat];
- gpfsel[0] = fsel;
- gpio[GPIO_FSEL_0] = fsel;
-
- fsel = gpfsel[1];
- fsel &= tblDatMsk[1][dat];
- fsel |= tblDatSet[1][dat];
- gpfsel[1] = fsel;
- gpio[GPIO_FSEL_1] = fsel;
-
- fsel = gpfsel[2];
- fsel &= tblDatMsk[2][dat];
- fsel |= tblDatSet[2][dat];
- gpfsel[2] = fsel;
- gpio[GPIO_FSEL_2] = fsel;
-#endif
-#else
- gpio[GPIO_CLR_0] = tblDatMsk[dat];
- gpio[GPIO_SET_0] = tblDatSet[dat];
-#endif
}
void RpiBus::CreateWorkTable(void)
@@ -394,7 +361,6 @@ void RpiBus::CreateWorkTable(void)
tblParity[i] = parity & 1;
}
-#if SIGNAL_CONTROL_MODE == 0
// Mask data defaults
for (auto &tbl : tblDatMsk) {
tbl.fill(-1);
@@ -426,32 +392,6 @@ void RpiBus::CreateWorkTable(void)
bits >>= 1;
}
}
-#else
- for (uint32_t i = 0; i < static_cast(tblParity.size()); i++) {
- // Bit string for inspection
- uint32_t bits = i;
-
- // Get parity
- if (tblParity[i]) {
- bits |= (1 << 8);
- }
-
- // Create GPIO register information
- uint32_t gpclr = 0;
- uint32_t gpset = 0;
- for (int j = 0; j < static_cast(DATA_PINS.size()); j++) {
- if (bits & 1) {
- gpset |= (1 << pins[j]);
- } else {
- gpclr |= (1 << pins[j]);
- }
- bits >>= 1;
- }
-
- tblDatMsk[i] = gpclr;
- tblDatSet[i] = gpset;
- }
-#endif
}
void RpiBus::SetControl(int pin, bool state)
@@ -469,12 +409,10 @@ void RpiBus::SetControl(int pin, bool state)
//---------------------------------------------------------------------------
void RpiBus::SetMode(int pin, int mode)
{
-#if SIGNAL_CONTROL_MODE == 0
// Pins are implicitly set to OUT when applying the mask
if (mode == OUT) {
return;
}
-#endif
const int index = pin / 10;
const int shift = (pin % 10) * 3;
@@ -504,7 +442,6 @@ inline bool RpiBus::GetSignal(int pin) const
//---------------------------------------------------------------------------
void RpiBus::SetSignal(int pin, bool state)
{
-#if SIGNAL_CONTROL_MODE == 0
const int index = pin / 10;
assert(index <= 2);
const int shift = (pin % 10) * 3;
@@ -516,13 +453,6 @@ void RpiBus::SetSignal(int pin, bool state)
}
gpio[index] = data;
gpfsel[index] = data;
-#else
- if (state) {
- gpio[GPIO_SET_0] = 1 << pin;
- } else {
- gpio[GPIO_CLR_0] = 1 << pin;
- }
-#endif
}
void RpiBus::DisableIRQ()
@@ -592,10 +522,11 @@ void RpiBus::EnableIRQ()
//---------------------------------------------------------------------------
void RpiBus::PinConfig(int pin, int mode)
{
- // Check for invalid pin
+#ifdef BOARD_STANDARD
if (pin < 0) {
return;
}
+#endif
const int index = pin / 10;
uint32_t mask = ~(7 << ((pin % 10) * 3));
@@ -605,10 +536,11 @@ void RpiBus::PinConfig(int pin, int mode)
// Pin pull-up/pull-down setting
void RpiBus::PullConfig(int pin, int mode)
{
- // Check for invalid pin
+#ifdef BOARD_STANDARD
if (pin < 0) {
return;
}
+#endif
if (pi_type >= PiType::pi_4) {
uint32_t pull;
@@ -649,10 +581,13 @@ void RpiBus::PullConfig(int pin, int mode)
// Set output pin
void RpiBus::PinSetSignal(int pin, bool state)
{
- // Check for invalid pin
- if (pin >= 0) {
- gpio[state ? GPIO_SET_0 : GPIO_CLR_0] = 1 << pin;
+#ifdef BOARD_STANDARD
+ if (pin < 0) {
+ return;
}
+#endif
+
+ gpio[state ? GPIO_SET_0 : GPIO_CLR_0] = 1 << pin;
}
void RpiBus::SetSignalDriveStrength(uint32_t drive)
@@ -666,10 +601,8 @@ inline uint32_t RpiBus::Acquire()
{
signals = *level;
-#if SIGNAL_CONTROL_MODE == 0
- // Invert if negative logic (internal processing is unified to positive logic)
+ // Invert because of negative logic (internal processing is unified to positive logic)
signals = ~signals;
-#endif
return signals;
}
diff --git a/cpp/buses/rpi_bus.h b/cpp/buses/rpi_bus.h
index 8550625b..a47fa24c 100644
--- a/cpp/buses/rpi_bus.h
+++ b/cpp/buses/rpi_bus.h
@@ -139,17 +139,10 @@ class RpiBus final : public Bus
// GPIO input level
volatile uint32_t *level = nullptr;
-#if SIGNAL_CONTROL_MODE == 0
// Data mask table
array, 3> tblDatMsk;
// Data setting table
array, 3> tblDatSet = { };
-#else
- // Data mask table
- array tblDatMsk = {};
- // Table setting table
- array tblDatSet = {};
-#endif
constexpr static array SIGNAL_TABLE = { PIN_DT0, PIN_DT1, PIN_DT2, PIN_DT3, PIN_DT4, PIN_DT5, PIN_DT6,
PIN_DT7, PIN_DP, PIN_SEL, PIN_ATN, PIN_RST, PIN_ACK, PIN_BSY, PIN_MSG, PIN_CD, PIN_IO, PIN_REQ };
diff --git a/cpp/command/command_image_support.h b/cpp/command/command_image_support.h
index 00f6c0e4..17ee4d67 100644
--- a/cpp/command/command_image_support.h
+++ b/cpp/command/command_image_support.h
@@ -49,8 +49,6 @@ class CommandImageSupport
private:
CommandImageSupport();
- CommandImageSupport(const CommandImageSupport&) = delete;
- CommandImageSupport operator&(const CommandImageSupport&) = delete;
bool CheckDepth(string_view) const;
string GetFullName(const string&) const;
diff --git a/cpp/devices/daynaport.cpp b/cpp/devices/daynaport.cpp
index 3faa53ec..dbea674f 100644
--- a/cpp/devices/daynaport.cpp
+++ b/cpp/devices/daynaport.cpp
@@ -224,7 +224,7 @@ int DaynaPort::WriteData(span buf, scsi_command command)
if (buf.size() && get_level() == level::trace) {
vector data;
- ranges::copy(buf.begin(), buf.end(), back_inserter(data));
+ ranges::copy(buf, back_inserter(data));
LogTrace(fmt::format("Sent {0} byte(s) of network data:\n{1}", data_length, FormatBytes(data, data_length)));
}
diff --git a/cpp/devices/disk_cache.cpp b/cpp/devices/disk_cache.cpp
index 1d93b5fa..14856c18 100644
--- a/cpp/devices/disk_cache.cpp
+++ b/cpp/devices/disk_cache.cpp
@@ -34,7 +34,7 @@ bool DiskCache::Init()
bool DiskCache::Flush()
{
// Save valid tracks
- return ranges::none_of(cache.cbegin(), cache.cend(), [this](const cache_t &c)
+ return ranges::none_of(cache, [this](const cache_t &c)
{ return c.disktrk && !c.disktrk->Save(sec_path, cache_miss_write_count);});
}
diff --git a/cpp/shared/s2p_version.cpp b/cpp/shared/s2p_version.cpp
index 4aac0e7d..22bf5c15 100644
--- a/cpp/shared/s2p_version.cpp
+++ b/cpp/shared/s2p_version.cpp
@@ -9,6 +9,6 @@
#include "s2p_version.h"
const int s2p_major_version = 3;
-const int s2p_minor_version = 3;
+const int s2p_minor_version = 4;
const int s2p_revision = 0;
const std::string s2p_suffix = "";