Update for STM32
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
#include <stdlib.h>
|
||||
#include "board.h"
|
||||
|
||||
#include "clk_gpio_init.c"
|
||||
#include "clk_gpio_init-stm32.c"
|
||||
|
||||
#define CORTEX_PRIORITY_BITS 4
|
||||
#define CORTEX_PRIORITY_MASK(n) ((n) << (8 - CORTEX_PRIORITY_BITS))
|
||||
|
||||
@@ -163,13 +163,7 @@ uint32_t bDeviceState = UNCONNECTED; /* USB device status */
|
||||
void
|
||||
usb_cb_device_reset (void)
|
||||
{
|
||||
/* Set DEVICE as not configured */
|
||||
usb_lld_set_configuration (0);
|
||||
|
||||
/* Current Feature initialization */
|
||||
usb_lld_set_feature (vcom_config_desc[7]);
|
||||
|
||||
usb_lld_reset ();
|
||||
usb_lld_reset (vcom_config_desc[7]);
|
||||
|
||||
/* Initialize Endpoint 0 */
|
||||
usb_lld_setup_endpoint (ENDP0, EP_CONTROL, 0, ENDP0_RXADDR, ENDP0_TXADDR, 64);
|
||||
|
||||
@@ -104,13 +104,12 @@ int usb_lld_reply_request (const void *buf, size_t buflen,
|
||||
void usb_lld_rx_enable (int ep_num);
|
||||
int usb_lld_rx_data_len (int ep_num);
|
||||
void usb_lld_rxcpy (uint8_t *dst, int ep_num, int offset, size_t len);
|
||||
void usb_lld_reset (void);
|
||||
void usb_lld_reset (uint8_t feature);
|
||||
void usb_lld_setup_endpoint (int ep_num, int ep_type, int ep_kind,
|
||||
int ep_rx_addr, int ep_tx_addr,
|
||||
int ep_rx_memory_size);
|
||||
void usb_lld_set_configuration (uint8_t config);
|
||||
uint8_t usb_lld_current_configuration (void);
|
||||
void usb_lld_set_feature (uint8_t feature);
|
||||
void usb_lld_set_data_to_recv (void *p, size_t len);
|
||||
|
||||
void usb_lld_prepare_shutdown (void);
|
||||
|
||||
@@ -355,7 +355,7 @@ void usb_lld_init (uint8_t feature)
|
||||
dev_p->state = IN_DATA;
|
||||
|
||||
usb_lld_set_configuration (0);
|
||||
usb_lld_set_feature (feature);
|
||||
dev_p->current_feature = feature;
|
||||
|
||||
/* Reset USB */
|
||||
st103_set_cntr (CNTR_FRES);
|
||||
@@ -891,8 +891,10 @@ usb_handle_transfer (uint16_t istr_value)
|
||||
}
|
||||
}
|
||||
|
||||
void usb_lld_reset (void)
|
||||
void usb_lld_reset (uint8_t feature)
|
||||
{
|
||||
usb_lld_set_configuration (0);
|
||||
dev_p->current_feature = feature;
|
||||
st103_set_btable ();
|
||||
st103_set_daddr (0);
|
||||
}
|
||||
@@ -999,11 +1001,6 @@ uint8_t usb_lld_current_configuration (void)
|
||||
return dev_p->current_configuration;
|
||||
}
|
||||
|
||||
void usb_lld_set_feature (uint8_t feature)
|
||||
{
|
||||
dev_p->current_feature = feature;
|
||||
}
|
||||
|
||||
void usb_lld_set_data_to_recv (void *p, size_t len)
|
||||
{
|
||||
data_p->addr = p;
|
||||
|
||||
Reference in New Issue
Block a user