From 8becbd182755908e8a489ecd1fce3bc03495b1ef Mon Sep 17 00:00:00 2001 From: Michael McMaster Date: Tue, 16 Mar 2021 23:13:06 +1000 Subject: [PATCH] More v5.2 bug fixes --- software/SCSI2SD/src/disk.c | 2 +- software/SCSI2SD/src/flash.c | 2 +- software/include/scsi2sd.h | 6 ++++-- software/scsi2sd-util/Makefile | 3 ++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/software/SCSI2SD/src/disk.c b/software/SCSI2SD/src/disk.c index 540d098..48f5890 100755 --- a/software/SCSI2SD/src/disk.c +++ b/software/SCSI2SD/src/disk.c @@ -578,7 +578,7 @@ void scsiDiskPoll() // work with. int scsiBusy = 1; int sdBusy = 1; - while (scsiBusy && sdBusy) + while (scsiBusy && sdBusy && isSDDevice) { uint8_t intr = CyEnterCriticalSection(); scsiBusy = scsiDMABusy(); diff --git a/software/SCSI2SD/src/flash.c b/software/SCSI2SD/src/flash.c index ed015d3..0e6ba95 100644 --- a/software/SCSI2SD/src/flash.c +++ b/software/SCSI2SD/src/flash.c @@ -123,7 +123,7 @@ static void spiFlash_earlyInit(S2S_Device* dev) } // Don't require the host to send us a START STOP UNIT command - spiFlash->dev.mediaState = MEDIA_STARTED; + spiFlash->dev.mediaState = MEDIA_STARTED | MEDIA_WP; // DMA stuff spiFlashDMATxChan = diff --git a/software/include/scsi2sd.h b/software/include/scsi2sd.h index 8b60b3e..9c16654 100755 --- a/software/include/scsi2sd.h +++ b/software/include/scsi2sd.h @@ -345,16 +345,18 @@ typedef enum +#define TargetConfig S2S_TargetCfg +#define BoardConfig S2S_BoardConfig #ifdef __cplusplus } // extern "C" #include static_assert( - std::is_pod::value, "Misuse of TargetConfig struct" + std::is_pod::value, "Misuse of TargetConfig struct" ); static_assert( - sizeof(TargetConfig) == 4096, + sizeof(S2S_TargetCfg) == 4096, "TargetConfig struct size mismatch" ); diff --git a/software/scsi2sd-util/Makefile b/software/scsi2sd-util/Makefile index 548b07f..64bdffd 100755 --- a/software/scsi2sd-util/Makefile +++ b/software/scsi2sd-util/Makefile @@ -82,6 +82,7 @@ ifeq ($(TARGET),Darwin) CC=clang -mmacosx-version-min=10.7 CXX=clang++ -stdlib=libc++ -mmacosx-version-min=10.7 WX_CONFIG += --with-macosx-version-min=10.7 + CPPFLAGS_WXBUILD += -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=1 BUILD := $(PWD)/build/mac all: $(BUILD)/scsi2sd-util.dmg @@ -156,7 +157,7 @@ endif mkdir -p $(dir $@) ( \ cd $(dir $@) && \ - $(CURDIR)/wxWidgets/configure $(WX_CONFIG) CPPFLAGS="$(CPPFLAGS_ZLIB)" LDFLAGS="$(LDFLAGS_ZLIB)" && \ + $(CURDIR)/wxWidgets/configure $(WX_CONFIG) CPPFLAGS="$(CPPFLAGS_ZLIB) $(CPPFLAGS_WXBUILD)" LDFLAGS="$(LDFLAGS_ZLIB)" && \ $(MAKE) \ ) && \ touch $@