summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-11-27 11:02:24 +0700
committerhathach <[email protected]>2019-11-27 11:02:24 +0700
commit745f0b4521a43c8f764b0bcac2d000b17f9aa1ac (patch)
tree0f57f4ad2f7daa087dc3f9a87c2625790d935f42
parent4c9c13c767bb41b3cb3cb36810f5898fb966caae (diff)
clean up
-rw-r--r--hw/bsp/samg55xplained/samg55xplained.c12
-rw-r--r--src/portable/microchip/samg/dcd_samg.c24
2 files changed, 34 insertions, 2 deletions
diff --git a/hw/bsp/samg55xplained/samg55xplained.c b/hw/bsp/samg55xplained/samg55xplained.c
index b66b906a0..67e7f9255 100644
--- a/hw/bsp/samg55xplained/samg55xplained.c
+++ b/hw/bsp/samg55xplained/samg55xplained.c
@@ -75,7 +75,7 @@ void board_init(void)
_pmc_enable_periph_clock(ID_FLEXCOM7);
gpio_set_pin_function(UART_RX_PIN, MUX_PA27B_FLEXCOM7_RXD);
gpio_set_pin_function(UART_TX_PIN, MUX_PA28B_FLEXCOM7_TXD);
-// _usart_sync_init(&_edbg_com, FLEXCOM7, _edbg_com_buf, sizeof(_edbg_com_buf), _usart_get_usart_async());
+
_usart_sync_init(&_edbg_com, FLEXCOM7);
_usart_sync_set_baud_rate(&_edbg_com, CFG_BOARD_UART_BAUDRATE);
_usart_sync_set_mode(&_edbg_com, USART_MODE_ASYNCHRONOUS);
@@ -100,6 +100,16 @@ void board_init(void)
}
//--------------------------------------------------------------------+
+// USB Interrupt Handler
+//--------------------------------------------------------------------+
+void UDP_Handler(void)
+{
+ #if CFG_TUSB_RHPORT0_MODE & OPT_MODE_DEVICE
+ tud_isr(0);
+ #endif
+}
+
+//--------------------------------------------------------------------+
// Board porting API
//--------------------------------------------------------------------+
diff --git a/src/portable/microchip/samg/dcd_samg.c b/src/portable/microchip/samg/dcd_samg.c
index d3028e605..9b9ebad7b 100644
--- a/src/portable/microchip/samg/dcd_samg.c
+++ b/src/portable/microchip/samg/dcd_samg.c
@@ -28,8 +28,8 @@
#if CFG_TUSB_MCU == OPT_MCU_SAMG
-#include "device/dcd.h"
#include "sam.h"
+#include "device/dcd.h"
//--------------------------------------------------------------------+
// MACRO TYPEDEF CONSTANT ENUM DECLARATION
@@ -40,10 +40,22 @@
/* Device API
*------------------------------------------------------------------*/
+// Set up endpoint 0, clear all other endpoints
+//static void bus_reset(void)
+//{
+//
+//}
+
// Initialize controller to device mode
void dcd_init (uint8_t rhport)
{
(void) rhport;
+
+
+
+
+ // Pull-up & Transceiver enable
+ UDP->UDP_TXVC = UDP_TXVC_PUON;
}
// Enable device interrupt
@@ -116,4 +128,14 @@ void dcd_edpt_clear_stall (uint8_t rhport, uint8_t ep_addr)
(void) ep_addr;
}
+//--------------------------------------------------------------------+
+// ISR
+//--------------------------------------------------------------------+
+void dcd_isr(uint8_t rhport)
+{
+ (void) rhport;
+
+
+}
+
#endif