improve neug_upgrade process
authorNIIBE Yutaka <gniibe@fsij.org>
Thu, 24 Oct 2013 05:01:41 +0000 (14:01 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Thu, 24 Oct 2013 05:01:41 +0000 (14:01 +0900)
ChangeLog
src/main.c
src/neug.c

index 7ccb3af..bf82d70 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-10-24  Niibe Yutaka  <gniibe@fsij.org>
+
+       * src/main.c (usb_cb_setup): Signal CND_USB, so that
+       neug_upgrade.py works better.
+
 2013-08-22  Niibe Yutaka  <gniibe@fsij.org>
 
        * Version 0.11.
index 388b8c1..7c74628 100644 (file)
@@ -437,6 +437,7 @@ usb_cb_setup (uint8_t req, uint8_t req_no,
 
              fsij_device_state = FSIJ_DEVICE_NEUG_EXIT_REQUESTED;
              chopstx_wakeup_usec_wait (main_thd);
+             chopstx_cond_signal (&cnd_usb);
              chopstx_mutex_unlock (&usb_mtx);
 
              return USB_SUCCESS;
index 4ecee99..7cfb501 100644 (file)
@@ -215,7 +215,7 @@ static int ep_process (int mode)
       CRC->DR = adc_buf[i*4 + 1];
       CRC->DR = adc_buf[i*4 + 2];
       CRC->DR = adc_buf[i*4 + 3];
-      v = CRC->DR & 0xff;
+      v = CRC->DR & 0xff;   /* First byte of CRC->DR is used here.  */
       noise_source_continuous_test (v);
       sha256_ctx_data.wbuf[i] = v;
       ep_init (NEUG_MODE_CONDITIONED); /* The rest three-byte of