Compare commits

...

26 Commits

Author SHA1 Message Date
Eric Helgeson bf5823468a Add 50pin 1.1 case back, was accidentally removed in 57ff0cd3b4 2024-02-22 07:30:57 -06:00
Eric Helgeson 2baa0155e1
Merge pull request #262 from dotsam/better-logging
Reformatted Logging
2024-02-17 15:59:33 -06:00
Sam Edwards 3a9db99723 Changing indentation on log lines 2024-02-17 11:23:17 -08:00
Sam Edwards 70eda86484 Ensure log output is correct with used IDs 2024-02-17 11:23:17 -08:00
Sam Edwards 9d4207ea14 Only read INI per-device config once in "finalize" function, include filenames in output 2024-02-17 11:23:17 -08:00
Sam Edwards 1d49003fe1 Clean up logging in setup functions 2024-02-17 11:22:27 -08:00
Sam Edwards 0a30396c3b Make better use of macros, functions, and dynamic char array lengths 2024-02-17 11:21:26 -08:00
Sam Edwards ba06827814 Whitespace/Type cleanup 2024-02-17 11:21:26 -08:00
Eric Helgeson a45af3edec
Merge pull request #261 from WilliamLeara/fix_typographical_errors
fix typographical mistakes in comments
2024-02-17 12:05:27 -06:00
William Leara 0be37ccde0 fix typographical mistakes in comments
Also, fix up some white-space issues.  No functional change here.
2024-02-14 13:31:35 -06:00
Eric Helgeson e236b5b054
Merge pull request #252 from dotsam/easy-leds
Easier to change LEDs
2024-02-09 20:11:36 -06:00
Sam Edwards 47179c5fd0
Easier to change LEDs
- For building for boards with different LEDs and configurations
 - Define mode for LED
 - Update GPIO macros for port C
 - Use macros to generate bits for registers
2024-02-09 17:42:07 -08:00
Eric Helgeson 59c858332a dev 2023-11-16 21:39:00 -06:00
Eric Helgeson dddb7bfc1c v1.1-20231116 2023-11-16 21:38:41 -06:00
Eric Helgeson 8b79df00ba
Merge pull request #257 from erichelgeson/eric/toolbox
BlueSCSI Toolbox
2023-11-16 21:35:26 -06:00
Eric Helgeson 7c9428131b Update commands to match v2 2023-11-16 21:30:15 -06:00
Eric Helgeson e35bae560c constant for block size 2023-11-16 21:30:15 -06:00
Eric Helgeson 13d7b985b7 Reuse m_buf and allow for 100 files 2023-11-16 21:30:15 -06:00
Eric Helgeson 27b7427301 hide hidden files 2023-11-16 21:30:15 -06:00
Eric Helgeson 98162fcd84 Fix issue with large files MSB being overwritten 2023-11-16 21:30:10 -06:00
Eric Helgeson 2be810e2ca 68k app 2023-10-24 17:17:12 -05:00
Eric Helgeson 4f7c0fe2c2
Merge pull request #253 from dotsam/compiler-warnings
Fix some compiler warnings
2023-08-13 10:22:33 -05:00
Sam Edwards 458617a827
Fix some compiler warnings
- Fix syntax of a cast to a uint32
 - Remove defines that are already made by the base platform
2023-08-11 11:47:34 -07:00
Eric Helgeson 810eae9be3
Merge pull request #251 from dotsam/fix-debug
Ensure allocLength is defined when needed in onReadBuffer
2023-08-10 20:37:08 -05:00
Sam Edwards d67fa80cf0
Ensure allocLength is defined when needed in onReadBuffer 2023-08-10 16:57:06 -07:00
Eric Helgeson 9e746ba145 Back to snapshot 2023-07-08 12:06:50 -05:00
6 changed files with 545 additions and 281 deletions

View File

@ -11,9 +11,7 @@ upload_protocol = stlink
; Different gcc versions produce much different binaries in terms of speed.
platform_packages = platformio/toolchain-gccarmnoneeabi@1.90301.200702
build_flags =
-DARDUINO_GENERIC_STM32F103C
-DARDUINO_LIB_DISCOVERY_PHASE
-DARDUINO=10813
-DARDUINO_ARCH_STM32
-DDEBUG_LEVEL=DEBUG_NONE
-O2
@ -78,9 +76,7 @@ build_flags =
-D USB_MANUFACTURER="Unknown"
-D USB_PRODUCT="\"BLUEPILL_F103C8\""
-D HAL_PCD_MODULE_ENABLED
-DARDUINO_GENERIC_STM32F103C
-DARDUINO_LIB_DISCOVERY_PHASE
-DARDUINO=10813
-DARDUINO_ARCH_STM32
-DDEBUG_LEVEL=DEBUG_NONE
-O2

File diff suppressed because it is too large Load Diff

View File

@ -99,8 +99,6 @@ enum SCSI_DEVICE_TYPE
#define IO PB7 // SCSI:I/O
#define SD_CS PA4 // SDCARD:CS
#define LED PC13 // LED
#define LED2 PA0 // External LED
// Image Set Selector
#ifdef XCVR
@ -116,17 +114,29 @@ enum SCSI_DEVICE_TYPE
#define PBREG GPIOB->regs
#define PCREG GPIOC->regs
// LED control
#define LED_ON() PCREG->BSRR = 0b00100000000000000000000000000000; PAREG->BSRR = 0b00000000000000000000000000000001;
#define LED_OFF() PCREG->BSRR = 0b00000000000000000010000000000000; PAREG->BSRR = 0b00000000000000010000000000000000;
// Virtual pin (Arduio compatibility is slow, so make it MCU-dependent)
#define PA(BIT) (BIT)
#define PB(BIT) (BIT+16)
#define PC(BIT) (BIT+32)
// Virtual pin decoding
#define GPIOREG(VPIN) ((VPIN)>=16?PBREG:PAREG)
#define GPIOREG(VPIN) ((VPIN)>=16?((VPIN)>=32?PCREG:PBREG):PAREG)
#define BITMASK(VPIN) (1<<((VPIN)&15))
// Built-in LED
#define LED PC13
#define vLED PC(13)
#define LED_MODE GPIO_OUTPUT_OD
// External LED
#define LED2 PA0
#define vLED2 PA(0)
#define LED2_MODE GPIO_OUTPUT_PP
// LED control
#define LED_ON() GPIOREG(vLED)->BSRR = BITMASK(vLED) << (LED_MODE == GPIO_OUTPUT_PP ? 0 : 16); GPIOREG(vLED2)->BSRR = BITMASK(vLED2) << (LED2_MODE == GPIO_OUTPUT_PP ? 0 : 16);
#define LED_OFF() GPIOREG(vLED)->BSRR = BITMASK(vLED) << (LED_MODE == GPIO_OUTPUT_PP ? 16 : 0); GPIOREG(vLED2)->BSRR = BITMASK(vLED2) << (LED2_MODE == GPIO_OUTPUT_PP ? 16 : 0);
#define vATN PA(8) // SCSI:ATN
#define vBSY PA(9) // SCSI:BSY
#define vACK PA(10) // SCSI:ACK
@ -172,7 +182,7 @@ enum SCSI_DEVICE_TYPE
| 1 | 1 | 1 | MESSAGE IN | Initiator from target / | phase |
|-----------------------------------------------------------------------------|
| Key: 0 = False, 1 = True, * = Reserved for future standardization |
+=============================================================================+
+=============================================================================+
*/
// SCSI phase change as single write to port B
#define SCSIPHASEMASK(MSGACTIVE, CDACTIVE, IOACTIVE) ((BITMASK(vMSG)<<((MSGACTIVE)?16:0)) | (BITMASK(vCD)<<((CDACTIVE)?16:0)) | (BITMASK(vIO)<<((IOACTIVE)?16:0)))
@ -235,14 +245,15 @@ enum SCSI_DEVICE_TYPE
// Put DB and DP in output mode
#define SCSI_DB_OUTPUT() { PBREG->CRL=(PBREG->CRL &0xfffffff0)|DB_MODE_OUT; PBREG->CRH = 0x11111111*DB_MODE_OUT; }
// Put DB and DP in input mode
#define SCSI_DB_INPUT() { PBREG->CRL=(PBREG->CRL &0xfffffff0)|DB_MODE_IN ; PBREG->CRH = (uint32_t)(0x11111111*DB_MODE_IN); }
#define SCSI_DB_INPUT() { PBREG->CRL=(PBREG->CRL &0xfffffff0)|DB_MODE_IN ; PBREG->CRH = (uint32_t)0x11111111*DB_MODE_IN; }
// HDDiamge file
#define HDIMG_ID_POS 2 // Position to embed ID number
#define HDIMG_LUN_POS 3 // Position to embed LUN numbers
#define HDIMG_BLK_POS 5 // Position to embed block size numbers
#define MAX_FILE_PATH 64 // Maximum file name length
#define MAX_MAC_PATH 32 // Maximum file name length on vintage macs
#define MAC_BLK_SIZE 4096
/*
* Data byte to BSRR register setting value and parity table
*/
@ -329,15 +340,15 @@ typedef struct _SCSI_INQUIRY_DATA
// HDD image
typedef __attribute__((aligned(4))) struct _SCSI_DEVICE
{
FsFile m_file; // File object
uint64_t m_fileSize; // File size
uint16_t m_blocksize; // SCSI BLOCK size
FsFile m_file; // File object
uint64_t m_fileSize; // File size
uint16_t m_blocksize; // SCSI BLOCK size
uint16_t m_rawblocksize; // OPTICAL raw sector size
uint8_t m_type; // SCSI device type
uint32_t m_blockcount; // blockcount
SCSI_INQUIRY_DATA inquiry_block; // SCSI information
SCSI_INQUIRY_DATA inquiry_block; // SCSI information
uint8_t m_senseKey; // Sense key
uint16_t m_additional_sense_code; // ASC/ASCQ
uint16_t m_additional_sense_code; // ASC/ASCQ
uint8_t m_sector_offset; // optical sector offset for missing sync header
uint8_t flags; // various device flags
} SCSI_DEVICE;

View File

@ -51,6 +51,14 @@
#define SCSI_READ12 0xA8
#define SCSI_VERIFY12 0xAF
#define BLUESCSI_LIST_FILES 0xD0
#define BLUESCSI_GET_FILE 0xD1
#define BLUESCSI_COUNT_FILES 0xD2
#define BLUESCSI_SEND_PREP 0xD3
#define BLUESCSI_SEND 0xD4
#define BLUESCSI_SEND_END 0xD5
#define SCSI_TOC_LENGTH 20 // length for default CDROM TOC

View File

@ -31,6 +31,9 @@
#define SCSI_ASC_MEDIUM_NOT_PRESENT 0x3A00
#define SCSI_ASC_LUN_NOT_READY_MANUAL_INTERVENTION_REQUIRED 0x0403
// OpenRetroSCSI Vendor Sense
#define OPEN_RETRO_SCSI_TOO_MANY_FILES 0x0001
// SCSI mode page codes
#define SCSI_SENSE_MODE_VENDOR 0x00
@ -44,6 +47,8 @@
#define SCSI_SENSE_MODE_CDROM_AUDIO_CONTROL 0x0E
#define SCSI_SENSE_MODE_VENDOR_APPLE 0x30
#define SCSI_SENSE_MODE_VENDOR_BLUESCSI 0x31 // Lookup range for vndr
#define SCSI_SENSE_MODE_ALL 0x3F