example usb stack update from Gnuk
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2013-11-21 Niibe Yutaka <gniibe@fsij.org>
|
||||
|
||||
* example-cdc/usb_stm32f103.c, example-cdc/usb_lld.h: Update from
|
||||
Gnuk.
|
||||
|
||||
2013-11-08 Niibe Yutaka <gniibe@fsij.org>
|
||||
|
||||
* Version 0.03.
|
||||
|
||||
@@ -89,7 +89,6 @@ enum DEVICE_STATE
|
||||
CONFIGURED
|
||||
};
|
||||
|
||||
extern const uint8_t usb_initial_feature;
|
||||
|
||||
extern void usb_lld_init (uint8_t feature);
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ static struct DATA_INFO *const data_p = &data_info;
|
||||
#define EPRX_DTOG1 (0x1000) /* EndPoint RX Data TOGgle bit1 */
|
||||
#define EPRX_DTOG2 (0x2000) /* EndPoint RX Data TOGgle bit1 */
|
||||
|
||||
static void usb_handle_transfer (void);
|
||||
static void usb_handle_transfer (uint16_t istr_value);
|
||||
|
||||
static void st103_set_btable (void)
|
||||
{
|
||||
@@ -390,20 +390,22 @@ usb_interrupt_handler (void)
|
||||
{
|
||||
uint16_t istr_value = st103_get_istr ();
|
||||
|
||||
if ((istr_value & ISTR_CTR))
|
||||
usb_handle_transfer ();
|
||||
|
||||
if ((istr_value & ISTR_RESET))
|
||||
{
|
||||
st103_set_istr (CLR_RESET);
|
||||
usb_cb_device_reset ();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if ((istr_value & ISTR_OVR))
|
||||
st103_set_istr (CLR_OVR);
|
||||
|
||||
if ((istr_value & ISTR_ERR))
|
||||
st103_set_istr (CLR_ERR);
|
||||
|
||||
if ((istr_value & ISTR_CTR))
|
||||
usb_handle_transfer (istr_value);
|
||||
}
|
||||
}
|
||||
|
||||
static void handle_datastage_out (void)
|
||||
@@ -931,14 +933,11 @@ void WEAK EP6_OUT_Callback (void);
|
||||
void WEAK EP7_OUT_Callback (void);
|
||||
|
||||
static void
|
||||
usb_handle_transfer (void)
|
||||
usb_handle_transfer (uint16_t istr_value)
|
||||
{
|
||||
uint16_t ep_value = 0;
|
||||
uint16_t istr_value;
|
||||
uint8_t ep_index;
|
||||
|
||||
while (((istr_value = st103_get_istr ()) & ISTR_CTR))
|
||||
{
|
||||
ep_index = (istr_value & ISTR_EP_ID);
|
||||
/* Decode and service non control endpoints interrupt */
|
||||
/* process related endpoint register */
|
||||
@@ -997,7 +996,6 @@ usb_handle_transfer (void)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void usb_lld_reset (void)
|
||||
|
||||
Reference in New Issue
Block a user