Fix NeuG for CRC module clock setting.

This commit is contained in:
NIIBE Yutaka
2017-11-17 15:47:22 +09:00
parent e417846408
commit bb9b31166f
2 changed files with 11 additions and 0 deletions

View File

@@ -1,5 +1,8 @@
2017-11-17 NIIBE Yutaka <gniibe@fsij.org> 2017-11-17 NIIBE Yutaka <gniibe@fsij.org>
* src/neug.c (crc32_rv_stop): New.
(neug_fini): Call crc32_rv_stop.
* src/main.c (main): Call chopstx_conf_idle. * src/main.c (main): Call chopstx_conf_idle.
* src/usb-ccid.c (usb_event_handle): Use 2 for call of * src/usb-ccid.c (usb_event_handle): Use 2 for call of

View File

@@ -30,6 +30,7 @@
#include "sys.h" #include "sys.h"
#include "neug.h" #include "neug.h"
#ifndef GNU_LINUX_EMULATION #ifndef GNU_LINUX_EMULATION
#include "mcu/stm32.h"
#include "mcu/stm32f103.h" #include "mcu/stm32f103.h"
#endif #endif
#include "adc.h" #include "adc.h"
@@ -143,6 +144,12 @@ rbit (uint32_t v)
asm ("rbit %0, %1" : "=r" (r) : "r" (v)); asm ("rbit %0, %1" : "=r" (r) : "r" (v));
return r; return r;
} }
void
crc32_rv_stop (void)
{
RCC->AHBENR &= ~RCC_AHBENR_CRCEN;
}
#endif #endif
static chopstx_mutex_t mode_mtx; static chopstx_mutex_t mode_mtx;
@@ -894,6 +901,7 @@ neug_fini (void)
rng_should_terminate = 1; rng_should_terminate = 1;
neug_get (1); neug_get (1);
chopstx_join (rng_thread, NULL); chopstx_join (rng_thread, NULL);
crc32_rv_stop ();
} }
void void