Quellcode durchsuchen

Tweaks for Windows

Keir Fraser vor 5 Jahren
Ursprung
Commit
895a60686b
3 geänderte Dateien mit 11 neuen und 9 gelöschten Zeilen
  1. 2 6
      README.md
  2. 3 1
      scripts/gw.py
  3. 6 2
      src/usb/cdc_acm.c

+ 2 - 6
README.md

@@ -4,9 +4,5 @@ Tools and USB interface for accessing a floppy drive at the raw flux level.
 
 ## Redistribution
 
-Most code is public domain; the rest is MIT/BSD or Open Source friendly
-(see the [COPYING](COPYING) file).
-
-The source code, and all binary releases, are freely redistributable
-in any form. Because Greaseweazle includes third-party code, you should
-include or link to the [COPYING](COPYING) file in any redistribution.
+Greaseweazle source code, and all binary releases, are freely redistributable
+in any form. Please see the [license](COPYING).

+ 3 - 1
scripts/gw.py

@@ -320,10 +320,11 @@ def main(argv):
 #  parser.add_argument("--total", type=float, default=8.0,
 #                      help="total length, seconds")
   parser.add_argument("file", help="in/out filename")
+  parser.add_argument("device", help="serial device")
   args = parser.parse_args(argv[1:])
 
   global ser
-  ser = serial.Serial("/dev/ttyACM0")
+  ser = serial.Serial(args.device)
   ser.send_break()
   ser.reset_input_buffer()
 
@@ -344,3 +345,4 @@ if __name__ == "__main__":
     main(sys.argv)
   except CmdError as error:
     print("Command Failed: %s" % error)
+    motor(False)

+ 6 - 2
src/usb/cdc_acm.c

@@ -22,7 +22,11 @@ static struct __packed line_coding {
     uint8_t nr_stop;
     uint8_t parity;
     uint8_t nr_data;
-} line_coding;
+} line_coding = { 
+    .baud = 9600,
+    .nr_stop = 0,
+    .parity = 0,
+    .nr_data = 8 };
 
 #if TRACE
 #define TRC printk
@@ -59,7 +63,7 @@ bool_t cdc_acm_handle_class_request(void)
     case CDC_GET_LINE_CODING: {
         struct line_coding *lc = (struct line_coding *)ep0.data;
         TRC("GET_LINE_CODING: ");
-        line_coding = *lc;
+        *lc = line_coding;
         dump_line_coding(lc);
         ep0.data_len = sizeof(*lc);
         break;