Support GD32F103.
authorNIIBE Yutaka <gniibe@fsij.org>
Thu, 26 Apr 2018 08:33:48 +0000 (17:33 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Thu, 26 Apr 2018 08:33:48 +0000 (17:33 +0900)
ChangeLog
chopstx
src/configure
src/usb-ccid.c

index c61bf21..a037ed1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2018-04-26  NIIBE Yutaka  <gniibe@fsij.org>
+
+       * src/usb-ccid.c (usb_event_handle): Ignore sprious "done".
+
+       * src/configure (MHZ, def_mhz): New.
+
 2018-04-05  NIIBE Yutaka  <gniibe@fsij.org>
 
        * VERSION: 1.2.9.
diff --git a/chopstx b/chopstx
index aa63ac7..32d0b82 160000 (submodule)
--- a/chopstx
+++ b/chopstx
@@ -1 +1 @@
-Subproject commit aa63ac79bc331b7c60943d77ec3c1f82e8c353d9
+Subproject commit 32d0b8200d2d6eadc00ddfb1e1c2113e148d325a
index e959bef..b45963a 100755 (executable)
@@ -167,6 +167,8 @@ BOARD_HEADER_FILE=board-$(echo $target | tr '_[:upper:]' '-[:lower:]').h
 echo "Header file is: $BOARD_HEADER_FILE"
 ln -sf "../chopstx/board/$BOARD_HEADER_FILE" board.h
 
+# Frequency
+MHZ=72
 # Flash page size in byte
 FLASH_PAGE_SIZE=1024
 # Flash memory size in KiB
@@ -196,6 +198,9 @@ STBEE)
   if test "$with_dfu" = "default"; then
     with_dfu=yes;
   fi  ;;
+BLUE_PILL_G)
+  MHZ=96
+  ;;
 *)
   ;;
 esac
@@ -208,6 +213,7 @@ if test "$target" = "GNU_LINUX"; then
   mcu="none"
   def_emulation="-DGNU_LINUX_EMULATION"
   def_memory_size="-DMEMORY_SIZE=1024"
+  def_mhz=""
   enable_hexoutput=""
   libs="-lpthread"
 else
@@ -218,6 +224,7 @@ else
   mcu="cortex-m3"
   def_emulation=""
   def_memory_size="-DMEMORY_SIZE=$MEMORY_SIZE"
+  def_mhz="-DMHZ=$MHZ"
   enable_hexoutput=yes
   libs=""
 fi
@@ -442,7 +449,7 @@ fi
  echo "EMULATION=$emulation";
  echo "CROSS=$cross";
  echo "MCU=$mcu";
- echo "DEFS=$use_sys3 $flash_override $def_emulation $def_memory_size";
+ echo "DEFS=$use_sys3 $flash_override $def_emulation $def_memory_size $def_mhz";
  echo "LDSCRIPT=$ldscript";
  echo "LIBS=$libs";
  echo "$DEBUG_MAKE_OPTION";
index 9875d0f..90e6959 100644 (file)
@@ -1579,6 +1579,10 @@ usb_event_handle (struct usb_dev *dev)
   /* Transfer to endpoint (not control endpoint) */
   if (ep_num != 0)
     {
+      /* Ignore sprious "Correct Transfer" */
+      if (bDeviceState != USB_DEVICE_STATE_CONFIGURED)
+       return 0;
+
       if (USB_EVENT_TXRX (e))
        usb_tx_done (ep_num, USB_EVENT_LEN (e));
       else