From 267e3e001d88faf7d5636e994d215b4666c142f8 Mon Sep 17 00:00:00 2001 From: ladyada Date: Sat, 2 Mar 2024 14:41:03 -0500 Subject: [PATCH] add floppsy support - working! ``` greaseweazle>python3 gw read --device COM15 --format ibm.1440 ouuut.img *** WARNING: Optimised data routines not found: Run scripts/setup.sh Reading c=0-79:h=0-1 revs=2 Format ibm.1440 T0.0: IBM MFM (18/18 sectors) from Raw Flux (179537 flux in 402.62ms) T0.1: IBM MFM (18/18 sectors) from Raw Flux (185345 flux in 402.67ms) T1.0: IBM MFM (18/18 sectors) from Raw Flux (160448 flux in 402.30ms) T1.1: IBM MFM (18/18 sectors) from Raw Flux (149618 flux in 402.15ms) T2.0: IBM MFM (18/18 sectors) from Raw Flux (150098 flux in 402.17ms) T2.1: IBM MFM (18/18 sectors) from Raw Flux (149949 flux in 402.14ms) T3.0: IBM MFM (18/18 sectors) from Raw Flux (150636 flux in 402.15ms) ``` --- examples/greaseweazle/greaseweazle.ino | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/examples/greaseweazle/greaseweazle.ino b/examples/greaseweazle/greaseweazle.ino index 0b6b697..9960fb5 100644 --- a/examples/greaseweazle/greaseweazle.ino +++ b/examples/greaseweazle/greaseweazle.ino @@ -28,9 +28,6 @@ #define READ_PIN 9 // IDC 30 #define SIDE_PIN 8 // IDC 32 #define READY_PIN 7 // IDC 34 -#ifndef USE_TINYUSB -#error "Please set Adafruit TinyUSB under Tools > USB Stack" -#endif #elif defined(ARDUINO_RASPBERRY_PI_PICO) #define DENSITY_PIN 2 // IDC 2 #define INDEX_PIN 3 // IDC 8 @@ -45,13 +42,15 @@ #define READ_PIN 12 // IDC 30 #define SIDE_PIN 13 // IDC 32 #define READY_PIN 14 // IDC 34 -#ifndef USE_TINYUSB -#error "Please set Adafruit TinyUSB under Tools > USB Stack" -#endif +#elif defined(ARDUINO_ADAFRUIT_FLOPPSY_RP2040) +// Yay built in pin definitions! #else #error "Please set up pin definitions!" #endif +#ifndef USE_TINYUSB +#error "Please set Adafruit TinyUSB under Tools > USB Stack" +#endif #if defined (ARDUINO_ADAFRUIT_FEATHER_RP2040) // jepler's prototype board, subject to change @@ -165,6 +164,14 @@ bool setbustype(int bustype) { void setup() { Serial.begin(115200); Serial1.begin(115200); + +#if defined(FLOPPY_DIRECTION_PIN) + pinMode(FLOPPY_DIRECTION_PIN, OUTPUT); + digitalWrite(FLOPPY_DIRECTION_PIN, HIGH); +#endif + + delay(100); + //while (!Serial) delay(100); Serial1.println("GrizzlyWizzly"); @@ -675,4 +682,4 @@ needfloppy: Serial.write(reply_buffer, 2); //Serial1.println("cmd complete!"); -} +} \ No newline at end of file