More fixes for new Chopstx and Fraucheky
authorNiibe Yutaka <gniibe@fsij.org>
Tue, 14 Jun 2016 02:48:28 +0000 (11:48 +0900)
committerNiibe Yutaka <gniibe@fsij.org>
Tue, 14 Jun 2016 02:48:28 +0000 (11:48 +0900)
ChangeLog
fraucheky
src/configure
src/main.c
tool/neug_check.py

index 724d465..8663b9d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2016-06-14  Niibe Yutaka  <gniibe@fsij.org>
+
+       * fraucheky: Update to 0.4.
+
+       * src/main.c (usb_ctrl_write_finish): Support
+       MSC_MASS_STORAGE_RESET_COMMAND.
+
+       * tool/neug_check.py (main): "Board" is optional.
+       Reported by Kenji Rikitake.
+
+       * src/configure: Fix use_sys3 variable substitution.
+
 2016-06-13  Niibe Yutaka  <gniibe@fsij.org>
 
        * src/main.c: Update with new USB API.
index c16927b..c37df03 160000 (submodule)
--- a/fraucheky
+++ b/fraucheky
@@ -1 +1 @@
-Subproject commit c16927b47c0c00f64ae842c095eee3ca92659189
+Subproject commit c37df03b7de1f43ea7d9dd1c4e54f1a4e3c39b5d
index 1c0e4b9..a0e4c48 100755 (executable)
@@ -304,7 +304,7 @@ else
 fi
 
 
-sed -e "s%@USE_SYS3@%$use_sys_3%" \
+sed -e "s%@USE_SYS3@%$use_sys3%" \
     -e "s%@ENABLE_FRAUCHEKY@%$ENABLE_FRAUCHEKY%" \
     -e "s%@HEXOUTPUT_MAKE_OPTION@%$HEXOUTPUT_MAKE_OPTION%" \
        < Makefile.in > Makefile
index a1d6e67..9fa885b 100644 (file)
@@ -184,6 +184,7 @@ static const uint8_t vcom_string0[4] = {
 
 static void neug_setup_endpoints_for_interface (uint16_t interface, int stop);
 #ifdef FRAUCHEKY_SUPPORT
+#define MSC_MASS_STORAGE_RESET_COMMAND 0xFF
 extern int fraucheky_enabled (void);
 extern void fraucheky_main (void);
 
@@ -343,7 +344,7 @@ usb_ctrl_write_finish (struct usb_dev *dev)
          chopstx_mutex_unlock (&usb_mtx);
        }
 #ifdef FRAUCHEKY_SUPPORT
-      else if (arg->request == USB_CDC_REQ_SET_LINE_CODING)
+      else if (running_neug && arg->request == USB_CDC_REQ_SET_LINE_CODING)
        {
          chopstx_mutex_lock (&usb_mtx);
          if (line_coding.bitrate == NEUG_SPECIAL_BITRATE)
@@ -355,6 +356,8 @@ usb_ctrl_write_finish (struct usb_dev *dev)
            fsij_device_state = FSIJ_DEVICE_RUNNING;
          chopstx_mutex_unlock (&usb_mtx);
        }
+      else if (!running_neug && arg->request == MSC_MASS_STORAGE_RESET_COMMAND)
+       fraucheky_setup_endpoints_for_interface (0);
 #endif
     }
 }
@@ -839,8 +842,6 @@ static void fill_serial_no_by_unique_id (void)
 static void
 usb_tx_done (uint8_t ep_num, uint16_t len)
 {
-  (void)len;
-
   if (ep_num == ENDP1)
     {
       chopstx_mutex_lock (&usb_mtx);
@@ -854,6 +855,8 @@ usb_tx_done (uint8_t ep_num, uint16_t len)
 #ifdef FRAUCHEKY_SUPPORT
   else if (ep_num == ENDP6)
     EP6_IN_Callback (len);
+#else
+  (void)len;
 #endif
 }
 
@@ -865,6 +868,8 @@ usb_rx_ready (uint8_t ep_num, uint16_t len)
 #ifdef FRAUCHEKY_SUPPORT
   else if (ep_num == ENDP6)
     EP6_OUT_Callback (len);
+#else
+  (void)len;
 #endif
 }
 \f
index a9d4ad5..7d418b3 100755 (executable)
@@ -106,9 +106,14 @@ def main():
     if not com:
         raise ValueError("No NeuG Device Present")
     print("")
-    for i in range(1,8):
+    for i in range(1,7):
         s = com.get_string(i, 512)
         print("%9s: %s" % (field[i], s.decode('UTF-8')))
+    try:
+        s = com.get_string(7, 512)
+        print("%9s: %s" % (field[7], s.decode('UTF-8')))
+    except:
+        pass
     print("")
     print("mode: %s" % com.get_mode())
     print("Repeat errors: %d" % com.get_info(2))