diff --git a/ChangeLog b/ChangeLog index 8696757..3a61b8b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2013-11-12 Niibe Yutaka + * src/usb_desc.c (usb_initial_feature): Remove. + (USB_SELF_POWERED): Move to ... + * src/usb_conf.h (USB_SELF_POWERED): ... here. + * src/usb_ctrl.c (usb_cb_device_reset, usb_intr): Follow the + change. + +2013-11-11 Niibe Yutaka + * src/adc_stm32f103.c (adc_wait_completion): Update from NeuG 1.0. 2013-11-03 Niibe Yutaka diff --git a/src/usb_conf.h b/src/usb_conf.h index 8ce67cb..2fb0424 100644 --- a/src/usb_conf.h +++ b/src/usb_conf.h @@ -5,6 +5,12 @@ #define NUM_STRING_DESC 7 +#if defined(USB_SELF_POWERED) +#define USB_INITIAL_FEATURE 0xC0 /* bmAttributes: self powered */ +#else +#define USB_INITIAL_FEATURE 0x80 /* bmAttributes: bus powered */ +#endif + /* Control pipe */ /* EP0: 64-byte, 64-byte */ #define ENDP0_RXADDR (0x40) diff --git a/src/usb_ctrl.c b/src/usb_ctrl.c index 2bab38f..6480002 100644 --- a/src/usb_ctrl.c +++ b/src/usb_ctrl.c @@ -182,7 +182,7 @@ usb_cb_device_reset (void) usb_lld_set_configuration (0); /* Current Feature initialization */ - usb_lld_set_feature (usb_initial_feature); + usb_lld_set_feature (USB_INITIAL_FEATURE); usb_lld_reset (); @@ -434,7 +434,7 @@ usb_intr (void *arg) chopstx_intr_t interrupt; (void)arg; - usb_lld_init (usb_initial_feature); + usb_lld_init (USB_INITIAL_FEATURE); chopstx_claim_irq (&interrupt, INTR_REQ_USB); usb_interrupt_handler (); diff --git a/src/usb_desc.c b/src/usb_desc.c index f0308b8..d3f8920 100644 --- a/src/usb_desc.c +++ b/src/usb_desc.c @@ -57,14 +57,6 @@ static const uint8_t gnukDeviceDescriptor[] = { -#if defined(USB_SELF_POWERED) -#define USB_INITIAL_FEATURE 0xC0 /* bmAttributes: self powered */ -#else -#define USB_INITIAL_FEATURE 0x80 /* bmAttributes: bus powered */ -#endif - -const uint8_t usb_initial_feature = USB_INITIAL_FEATURE; - /* Configuation Descriptor */ static const uint8_t gnukConfigDescriptor[] = { 9, /* bLength: Configuation Descriptor size */