summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2018-11-21 15:00:36 +0700
committerhathach <[email protected]>2018-11-21 15:00:36 +0700
commit3cad1d11341bb70612ce94559bd93c21bc43b498 (patch)
treed93c4d5f288ec743d1ae1cb4f1ca994c2b4f195d
parenta30dfa33244c3db1a3987dc9f75e4aae9b192d63 (diff)
samd21 work well with cdc
-rw-r--r--examples/device/device_composite/ses/device_composite.emProject2
-rw-r--r--hw/bsp/metro_m0_express/board_metro_m0_express.c2
-rw-r--r--src/portable/microchip/samd21/dcd_samd21.c6
3 files changed, 2 insertions, 8 deletions
diff --git a/examples/device/device_composite/ses/device_composite.emProject b/examples/device/device_composite/ses/device_composite.emProject
index 7011fb979..f8168b7d3 100644
--- a/examples/device/device_composite/ses/device_composite.emProject
+++ b/examples/device/device_composite/ses/device_composite.emProject
@@ -214,7 +214,7 @@
arm_target_device_name="ATSAMD21G18A"
arm_target_interface_type="SWD"
build_treat_warnings_as_errors="Yes"
- c_preprocessor_definitions="__SAMD21G18A__;__SAMD21_FAMILY;__SAM_D21_SUBFAMILY;ARM_MATH_CM0PLUS;FLASH_PLACEMENT=1;USE_SIMPLE_ASSERT;CONF_XOSC32K_CONFIG=1;BOARD_METRO_M0_EXPRESS;CFG_TUSB_MCU=OPT_MCU_SAMD21"
+ c_preprocessor_definitions="__SAMD21G18A__;__SAMD21_FAMILY;__SAM_D21_SUBFAMILY;ARM_MATH_CM0PLUS;FLASH_PLACEMENT=1;USE_SIMPLE_ASSERT;CONF_XOSC32K_CONFIG=1;CONF_OSC32K_ENABLE=1;CONF_OSC32K_EN32K=1;CONF_XOSC32K_STARTUP=CONF_XOSC32K_STARTUP_TIME_2000092MCS;CONF_DFLL_ONDEMAND=0;CONF_DFLL_OVERWRITE_CALIBRATION=0;BOARD_METRO_M0_EXPRESS;CFG_TUSB_MCU=OPT_MCU_SAMD21"
c_user_include_directories="../src;$(rootDir)/hw/cmsis/Include;$(rootDir)/hw;$(rootDir)/src;$(asf4Dir);$(asf4Dir)/include;$(asf4Dir)/config;$(asf4Dir)/hri;$(asf4Dir)/hal/include;$(asf4Dir)/hal/utils/include;$(asf4Dir)/hpl/port;$(asf4Dir)/hpl/gclk;$(asf4Dir)/hpl/pm"
debug_register_definition_file="ses_samd21/ATSAMD21G18A_Registers.xml"
debug_target_connection="J-Link"
diff --git a/hw/bsp/metro_m0_express/board_metro_m0_express.c b/hw/bsp/metro_m0_express/board_metro_m0_express.c
index 9f1ed4fe4..6b4f185ac 100644
--- a/hw/bsp/metro_m0_express/board_metro_m0_express.c
+++ b/hw/bsp/metro_m0_express/board_metro_m0_express.c
@@ -46,8 +46,6 @@
#include "hpl/gclk/hpl_gclk_base.h"
#include "hpl_pm_config.h"
#include "hpl/pm/hpl_pm_base.h"
-#include "peripheral_clk_config.h"
-
//--------------------------------------------------------------------+
// MACRO TYPEDEF CONSTANT ENUM DECLARATION
diff --git a/src/portable/microchip/samd21/dcd_samd21.c b/src/portable/microchip/samd21/dcd_samd21.c
index 81e37abcc..0102685d2 100644
--- a/src/portable/microchip/samd21/dcd_samd21.c
+++ b/src/portable/microchip/samd21/dcd_samd21.c
@@ -56,11 +56,9 @@ enum
MAX_PACKET_SIZE = 64,
};
-static UsbDeviceDescBank sram_registers[8][2];
+static ATTR_ALIGNED(4) UsbDeviceDescBank sram_registers[8][2];
static ATTR_ALIGNED(4) uint8_t _setup_packet[8];
-volatile uint32_t setup_count = 0;
-
// Setup the control endpoint 0.
static void bus_reset(void) {
// Max size of packets is 64 bytes.
@@ -75,7 +73,6 @@ static void bus_reset(void) {
// Prepare for setup packet
dcd_edpt_xfer(0, 0, _setup_packet, sizeof(_setup_packet));
- setup_count = 0;
}
@@ -255,7 +252,6 @@ static bool maybe_handle_setup_packet(void) {
// This copies the data elsewhere so we can reuse the buffer.
dcd_event_setup_received(0, (uint8_t*) sram_registers[0][0].ADDR.reg, true);
- setup_count += 1;
return true;
}
return false;