* src/main.c (main): Call chopstx_conf_idle.
* src/usb-ccid.c (usb_event_handle): Use 2 for call of
- chopstx_conf_idle on suspend.
+ chopstx_conf_idle on suspend. Call random_fini on suspend
+ to stop ADC module. Call random_init on wakeup.
2017-11-16 NIIBE Yutaka <gniibe@fsij.org>
-Subproject commit e684e853c8770d8e4273926be1fbfd3315cb13a2
+Subproject commit 3071929c621f468938129bc2ba26a7663b04edbd
#define main emulated_main
#else
#include "mcu/cortex-m.h"
+#include "mcu/stm32.h"
#include "mcu/stm32f103.h"
#endif
*/
#include <stdint.h>
+#include "mcu/stm32.h"
#include "mcu/stm32f103.h"
uint8_t *
extern int usb_get_descriptor (struct usb_dev *dev);
+extern void random_init (void);
+extern void random_fini (void);
+
+
/*
* Return 0 for normal USB event
* -1 for USB reset
case USB_EVENT_DEVICE_SUSPEND:
led_blink (LED_OFF);
+ random_fini ();
chopstx_conf_idle (2);
bDeviceState |= USB_DEVICE_STATE_SUSPEND;
break;
case USB_EVENT_DEVICE_WAKEUP:
chopstx_conf_idle (1);
+ random_init ();
bDeviceState &= ~USB_DEVICE_STATE_SUSPEND;
break;