Merge pull request #241 from fishman/NUC123-change-USBEndpointConfig

NUC123 change USBEndpointConfig
This commit is contained in:
Fabien Poussin 2020-12-15 18:12:54 +01:00 committed by GitHub
commit 7cdb0bc997
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 3 deletions

View File

@ -99,6 +99,11 @@ static union {
USBOutEndpointState out;
} ep0_state;
/**
* @brief Buffer for the EP0 setup packets.
*/
static uint8_t ep0setup_buffer[8];
/**
* @brief EP0 initialization structure.
*/
@ -109,7 +114,9 @@ static const USBEndpointConfig ep0config = {USB_EP_MODE_TYPE_CTRL,
0x40,
0x40,
&ep0_state.in,
&ep0_state.out};
&ep0_state.out,
1,
ep0setup_buffer};
/**
* @brief Tracks the first unallocated word in the SRAM buffer

View File

@ -211,6 +211,17 @@ typedef struct {
USBOutEndpointState *out_state;
/* End of the mandatory fields.*/
/**
* @brief Reserved field, not currently used.
* @note Initialize this field to 1 in order to be forward compatible.
*/
uint16_t ep_buffers;
/**
* @brief Pointer to a buffer for setup packets, not currently used.
* @details Setup packets require a dedicated 8-bytes buffer, set this
* field to @p NULL for non-control endpoints.
*/
uint8_t *setup_buf;
} USBEndpointConfig;
/**

View File

@ -88,7 +88,7 @@ PROJECT = ch
MCU = cortex-m0
# Imported source files and paths.
BASE_PATH := /Users/lewontin/Documents/development/Projects
BASE_PATH := ../../../../../../..
CHIBIOS := $(BASE_PATH)/ChibiOS/ChibiOS
CHIBIOS_CONTRIB := $(BASE_PATH)/ChibiOS/ChibiOS-Contrib
CONFDIR := ./cfg

View File

@ -276,7 +276,9 @@ static const USBEndpointConfig ep1config = {
0x0040,
0x0040,
&ep1instate,
&ep1outstate
&ep1outstate,
0,
NULL
};
/*