From 200bc7251f2395842df7c7be9b90f2b44940a9d4 Mon Sep 17 00:00:00 2001 From: Daniel Markstedt Date: Mon, 20 Dec 2021 06:20:22 -0800 Subject: [PATCH 1/2] More helpful error message when IP does not resolve for OLED screen (#541) * More helpful error message * Remove confusing fallback IP * Tweak message --- src/oled_monitor/pi_cmds.py | 2 +- src/oled_monitor/rascsi_oled_monitor.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/oled_monitor/pi_cmds.py b/src/oled_monitor/pi_cmds.py index 9d8a58df..440d75c1 100644 --- a/src/oled_monitor/pi_cmds.py +++ b/src/oled_monitor/pi_cmds.py @@ -14,7 +14,7 @@ def get_ip_and_host(): sock.connect(('10.255.255.255', 1)) ip_addr = sock.getsockname()[0] except Exception: - ip_addr = '127.0.0.1' + ip_addr = False finally: sock.close() return ip_addr, host diff --git a/src/oled_monitor/rascsi_oled_monitor.py b/src/oled_monitor/rascsi_oled_monitor.py index b67bb261..a7b0f95e 100755 --- a/src/oled_monitor/rascsi_oled_monitor.py +++ b/src/oled_monitor/rascsi_oled_monitor.py @@ -161,7 +161,11 @@ def formatted_output(): else: output.append("No image mounted!") - output.append(f"IP {IP_ADDR} - {HOSTNAME}") + if IP_ADDR: + output.append(f"IP {IP_ADDR} - {HOSTNAME}") + else: + output.append("RaSCSI has no IP address") + output.append("Check network connection") return output From 958fb95908f2d8cdf13c02d827f2d14f6011170e Mon Sep 17 00:00:00 2001 From: akuker <34318535+akuker@users.noreply.github.com> Date: Mon, 20 Dec 2021 12:50:14 -0600 Subject: [PATCH 2/2] Adjust bus settle delay to match SCSI standard (#544) * Move the GCC v10 compiler flags into makefile instead of easyinstall.sh * #504 - Update the bus settle time to match the SCSI standard Co-authored-by: RaSCSI User --- easyinstall.sh | 9 +-------- src/raspberrypi/Makefile | 10 ++++++++++ src/raspberrypi/gpiobus.cpp | 8 ++++---- src/raspberrypi/gpiobus.h | 1 - 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/easyinstall.sh b/easyinstall.sh index f12ad150..4a363222 100755 --- a/easyinstall.sh +++ b/easyinstall.sh @@ -83,15 +83,8 @@ function installPackages() { function compileRaScsi() { cd "$BASE/src/raspberrypi" || exit 1 - # Compiler flags needed for gcc v10 and up - if [[ `gcc --version | awk '/gcc/' | awk -F ' ' '{print $3}' | awk -F '.' '{print $1}'` -ge 10 ]]; then - echo -n "gcc 10 or later detected. Will compile with the following flags: " - COMPILER_FLAGS="-DFMT_HEADER_ONLY" - echo $COMPILER_FLAGS - fi - echo "Compiling with ${CORES:-1} simultaneous cores..." - ( make clean && EXTRA_FLAGS="$COMPILER_FLAGS" make -j "${CORES:-1}" all CONNECT_TYPE="${CONNECT_TYPE:-FULLSPEC}" ) = 10) + +ifeq "$(GCCVERSION10)" "1" + CFLAGS += -DFMT_HEADER_ONLY + CXXFLAGS += -DFMT_HEADER_ONLY +endif + + + ## CONNECT_TYPE=FULLSPEC : Specify the type of RaSCSI board type ## that you are using. The typical options are ## STANDARD or FULLSPEC. The default is FULLSPEC diff --git a/src/raspberrypi/gpiobus.cpp b/src/raspberrypi/gpiobus.cpp index d78c66b1..a931f102 100644 --- a/src/raspberrypi/gpiobus.cpp +++ b/src/raspberrypi/gpiobus.cpp @@ -840,7 +840,7 @@ int GPIOBUS::CommandHandShake(BYTE *buf) BOOL ret = WaitSignal(PIN_ACK, TRUE); // Wait until the signal line stabilizes - SysTimer::SleepNsec(GPIO_DATA_SETTLING); + SysTimer::SleepNsec(SCSI_DELAY_BUS_SETTLE_DELAY_NS); // Get data *buf = GetDAT(); @@ -874,7 +874,7 @@ int GPIOBUS::CommandHandShake(BYTE *buf) ret = WaitSignal(PIN_ACK, TRUE); // Wait until the signal line stabilizes - SysTimer::SleepNsec(GPIO_DATA_SETTLING); + SysTimer::SleepNsec(SCSI_DELAY_BUS_SETTLE_DELAY_NS); // Get data *buf = GetDAT(); @@ -930,7 +930,7 @@ int GPIOBUS::ReceiveHandShake(BYTE *buf, int count) ret = WaitSignal(PIN_ACK, TRUE); // Wait until the signal line stabilizes - SysTimer::SleepNsec(GPIO_DATA_SETTLING); + SysTimer::SleepNsec(SCSI_DELAY_BUS_SETTLE_DELAY_NS); // Get data *buf = GetDAT(); @@ -973,7 +973,7 @@ int GPIOBUS::ReceiveHandShake(BYTE *buf, int count) } // Wait until the signal line stabilizes - SysTimer::SleepNsec(GPIO_DATA_SETTLING); + SysTimer::SleepNsec(SCSI_DELAY_BUS_SETTLE_DELAY_NS); // Get data *buf = GetDAT(); diff --git a/src/raspberrypi/gpiobus.h b/src/raspberrypi/gpiobus.h index cc1dcfee..46babdce 100644 --- a/src/raspberrypi/gpiobus.h +++ b/src/raspberrypi/gpiobus.h @@ -433,7 +433,6 @@ // Constant declarations (bus control timing) // //--------------------------------------------------------------------------- -#define GPIO_DATA_SETTLING 100 // Data bus stabilization time (ns) // SCSI Bus timings taken from: // https://www.staff.uni-mainz.de/tacke/scsi/SCSI2-05.html #define SCSI_DELAY_ARBITRATION_DELAY_NS 2400