diff --git a/ChangeLog b/ChangeLog index 3909402..145f0f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2017-11-17 NIIBE Yutaka + * src/neug.c (crc32_rv_stop): New. + (neug_fini): Call crc32_rv_stop. + * src/main.c (main): Call chopstx_conf_idle. * src/usb-ccid.c (usb_event_handle): Use 2 for call of diff --git a/src/neug.c b/src/neug.c index 805911c..f630d2a 100644 --- a/src/neug.c +++ b/src/neug.c @@ -30,6 +30,7 @@ #include "sys.h" #include "neug.h" #ifndef GNU_LINUX_EMULATION +#include "mcu/stm32.h" #include "mcu/stm32f103.h" #endif #include "adc.h" @@ -143,6 +144,12 @@ rbit (uint32_t v) asm ("rbit %0, %1" : "=r" (r) : "r" (v)); return r; } + +void +crc32_rv_stop (void) +{ + RCC->AHBENR &= ~RCC_AHBENR_CRCEN; +} #endif static chopstx_mutex_t mode_mtx; @@ -894,6 +901,7 @@ neug_fini (void) rng_should_terminate = 1; neug_get (1); chopstx_join (rng_thread, NULL); + crc32_rv_stop (); } void