diff --git a/.vs/TE_Controller/v14/.atsuo b/.vs/TE_Controller/v14/.atsuo
index f83766b..39c22c0 100644
Binary files a/.vs/TE_Controller/v14/.atsuo and b/.vs/TE_Controller/v14/.atsuo differ
diff --git a/TE_Controller/TE_Controller.cproj b/TE_Controller/TE_Controller.cproj
index 336dd1d..7dfb363 100644
--- a/TE_Controller/TE_Controller.cproj
+++ b/TE_Controller/TE_Controller.cproj
@@ -30,302 +30,302 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
com.atmel.avrdbg.tool.atmelice
J41800067100
@@ -577,7 +577,6 @@
../src/ASF/thirdparty/freertos/freertos-10.0.0/Source/portable/GCC/ARM_CM0
- Optimize (-O1)
-fdata-sections
True
Maximum (-g3)
@@ -641,7 +640,7 @@
Default (-g)
- -DARM_MATH_CM0PLUS=true -DBOARD=SAMD21_XPLAINED_PRO -DEXTINT_CALLBACK_MODE=true -DUDD_ENABLE -DUSART_CALLBACK_MODE=true -DUSB_DEVICE_LPM_SUPPORT -D__SAMD21J18A__ -D__FREERTOS__
+ -DARM_MATH_CM0PLUS=true -DBOARD=USER_BOARD -DEXTINT_CALLBACK_MODE=true -DUDD_ENABLE -DUSART_CALLBACK_MODE=true -DUSB_DEVICE_LPM_SUPPORT -D__SAMD21E16B__ -D__FREERTOS__
../src
diff --git a/TE_Controller/src/ASF/common/services/usb/class/cdc/device/example/samd21j18a_samd21_xplained_pro/ui.c b/TE_Controller/src/ASF/common/services/usb/class/cdc/device/example/samd21j18a_samd21_xplained_pro/ui.c
index 4270713..f5b306a 100644
--- a/TE_Controller/src/ASF/common/services/usb/class/cdc/device/example/samd21j18a_samd21_xplained_pro/ui.c
+++ b/TE_Controller/src/ASF/common/services/usb/class/cdc/device/example/samd21j18a_samd21_xplained_pro/ui.c
@@ -145,12 +145,12 @@ void ui_com_overflow(void)
void ui_process(uint16_t framenumber)
{
- if ((framenumber % 1000) == 0) {
+ /*if ((framenumber % 1000) == 0) {
LED_On(LED_0_PIN);
}
if ((framenumber % 1000) == 500) {
LED_Off(LED_0_PIN);
- }
+ }*/
}
/**
diff --git a/TE_Controller/src/ASF/sam0/drivers/sercom/usart/usart.h b/TE_Controller/src/ASF/sam0/drivers/sercom/usart/usart.h
index 156e2c7..e21ed2c 100644
--- a/TE_Controller/src/ASF/sam0/drivers/sercom/usart/usart.h
+++ b/TE_Controller/src/ASF/sam0/drivers/sercom/usart/usart.h
@@ -997,19 +997,20 @@ static inline void usart_unlock(struct usart_module *const module)
* \retval false Peripheral is not busy syncing and can be read/written without
* stalling the bus
*/
+//__attribute__((optimize("O0")))
static inline bool usart_is_syncing(
- const struct usart_module *const module)
+ const struct usart_module *const module)
{
/* Sanity check arguments */
Assert(module);
Assert(module->hw);
- SercomUsart *const usart_hw = &(module->hw->USART);
-
+ SercomUsart usart_hw = module->hw->USART;//SercomUsart *const usart_hw = &(module->hw->USART);
+ uint32_t reg = usart_hw.SYNCBUSY.reg;
#ifdef FEATURE_USART_SYNC_SCHEME_V2
- return (usart_hw->SYNCBUSY.reg);
+ return (reg);
#else
- return (usart_hw->STATUS.reg & SERCOM_USART_STATUS_SYNCBUSY);
+ return (reg & SERCOM_USART_STATUS_SYNCBUSY);
#endif
}
diff --git a/TE_Controller/src/ASF/sam0/utils/cmsis/samd21/include/samd21e16b.h b/TE_Controller/src/ASF/sam0/utils/cmsis/samd21/include/samd21e16b.h
index e5c7031..58eb1f4 100644
--- a/TE_Controller/src/ASF/sam0/utils/cmsis/samd21/include/samd21e16b.h
+++ b/TE_Controller/src/ASF/sam0/utils/cmsis/samd21/include/samd21e16b.h
@@ -174,10 +174,10 @@ typedef struct _DeviceVectors
/* Cortex-M0+ processor handlers */
void Reset_Handler ( void );
void NMI_Handler ( void );
-void HardFault_Handler ( void );
-void SVC_Handler ( void );
-void PendSV_Handler ( void );
-void SysTick_Handler ( void );
+//void HardFault_Handler ( void );
+//void SVC_Handler ( void );
+//void PendSV_Handler ( void );
+//void SysTick_Handler ( void );
/* Peripherals handlers */
void PM_Handler ( void );
diff --git a/TE_Controller/src/ASF/sam0/utils/cmsis/samd21/source/gcc/startup_samd21.c b/TE_Controller/src/ASF/sam0/utils/cmsis/samd21/source/gcc/startup_samd21.c
index d8401c4..58346ef 100644
--- a/TE_Controller/src/ASF/sam0/utils/cmsis/samd21/source/gcc/startup_samd21.c
+++ b/TE_Controller/src/ASF/sam0/utils/cmsis/samd21/source/gcc/startup_samd21.c
@@ -55,10 +55,10 @@ void Dummy_Handler(void);
/* Cortex-M0+ core handlers */
void NMI_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
-//void HardFault_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
-//void SVC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
-//void PendSV_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
-//void SysTick_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+void HardFault_Handler ( void ) __attribute__ ((weak));
+void SVC_Handler ( void ) __attribute__ ((weak));
+void PendSV_Handler ( void ) __attribute__ ((weak));
+void SysTick_Handler ( void ) __attribute__ ((weak));
/* Peripherals handlers */
void PM_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
diff --git a/TE_Controller/src/ASF/thirdparty/freertos/freertos-10.0.0/Source/portable/GCC/ARM_CM0/port.c b/TE_Controller/src/ASF/thirdparty/freertos/freertos-10.0.0/Source/portable/GCC/ARM_CM0/port.c
index 326c390..cb83fd3 100644
--- a/TE_Controller/src/ASF/thirdparty/freertos/freertos-10.0.0/Source/portable/GCC/ARM_CM0/port.c
+++ b/TE_Controller/src/ASF/thirdparty/freertos/freertos-10.0.0/Source/portable/GCC/ARM_CM0/port.c
@@ -253,7 +253,7 @@ uint32_t ulSetInterruptMaskFromISR( void )
::: "memory"
);
-#if !defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
+#if !defined (__ARMCC_VERSION) || (defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050))
/* To avoid compiler warnings. The return statement will nevere be reached,
but some compilers warn if it is not included, while others won't compile if
it is. */
@@ -270,7 +270,7 @@ void vClearInterruptMaskFromISR( __attribute__( ( unused ) ) uint32_t ulMask )
::: "memory"
);
-#if !defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
+#if !defined (__ARMCC_VERSION) || (defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050))
/* Just to avoid compiler warning. ulMask is used from the asm code but
the compiler can't see that. Some compilers generate warnings without the
following line, while others generate warnings if the line is included. */
diff --git a/TE_Controller/src/asf.h b/TE_Controller/src/asf.h
index 1a4e5bf..c1b700c 100644
--- a/TE_Controller/src/asf.h
+++ b/TE_Controller/src/asf.h
@@ -57,8 +57,8 @@
#include
// From module: EXTINT - External Interrupt (Callback APIs)
-#include
-#include
+//#include
+//#include
// From module: FreeRTOS - kernel 10.0.0
#include
diff --git a/TE_Controller/src/config/conf_usb.h b/TE_Controller/src/config/conf_usb.h
index b8a397f..d61a2c2 100644
--- a/TE_Controller/src/config/conf_usb.h
+++ b/TE_Controller/src/config/conf_usb.h
@@ -62,9 +62,9 @@
// (USB_CONFIG_ATTR_REMOTE_WAKEUP|USB_CONFIG_ATTR_BUS_POWERED)
//! USB Device string definitions (Optional)
-#define USB_DEVICE_MANUFACTURE_NAME "ATMEL ASF"
-#define USB_DEVICE_PRODUCT_NAME "CDC Virtual Com"
-// #define USB_DEVICE_SERIAL_NAME "12...EF"
+#define USB_DEVICE_MANUFACTURE_NAME "Svyazcom LLC"//"ATMEL ASF"
+#define USB_DEVICE_PRODUCT_NAME "RealSense box controller"//"CDC Virtual Com"
+#define USB_DEVICE_SERIAL_NAME "00000000"
/**
@@ -122,9 +122,9 @@
//! Interface callback definition
#define UDI_CDC_ENABLE_EXT(port) main_cdc_enable(port)
#define UDI_CDC_DISABLE_EXT(port) main_cdc_disable(port)
-#define UDI_CDC_RX_NOTIFY(port) uart_rx_notify(port)
+#define UDI_CDC_RX_NOTIFY(port) //uart_rx_notify(port)
#define UDI_CDC_TX_EMPTY_NOTIFY(port)
-#define UDI_CDC_SET_CODING_EXT(port,cfg) uart_config(port,cfg)
+#define UDI_CDC_SET_CODING_EXT(port,cfg) //uart_config(port,cfg)
#define UDI_CDC_SET_DTR_EXT(port,set) main_cdc_set_dtr(port,set)
#define UDI_CDC_SET_RTS_EXT(port,set)
diff --git a/TE_Controller/src/main.c b/TE_Controller/src/main.c
index d83b0c1..7471bb4 100644
--- a/TE_Controller/src/main.c
+++ b/TE_Controller/src/main.c
@@ -38,6 +38,7 @@
#include "conf_usb.h"
#include "ui.h"
#include "uart.h"
+#include
static volatile bool main_b_cdc_enable = false;
void prvGetRegistersFromStack (uint32_t *pulFaultStackAddress);
@@ -70,7 +71,7 @@ int main(void)
InitTask_cdc_rx_check();
// Init LED
InitTask_led_blink();
- ui_init();//ui_powerdown();
+ //ui_init();//ui_powerdown();
vTaskStartScheduler();
while(true){
@@ -80,9 +81,23 @@ int main(void)
void Task_cdc_rx_check(void *parameters)
{
+ #define PORT0 0
//volatile uint8_t led = 1;
+ char rcvBuff[128] = {0};
+ char *pStr = rcvBuff;
+ int len = 0;
while(true)
- {
+ {
+ while(udi_cdc_multi_is_rx_ready(PORT0))
+ {
+ len += sprintf(pStr++, "%c", udi_cdc_multi_getc(PORT0));
+ }
+ if(len>0)
+ {
+ printf("<%s\n", rcvBuff);
+ len=0;
+ pStr = rcvBuff;
+ }
//cdc_rx_check();
/*#if !defined (DEBUG_CPU_IRQ_DISABLE)
@@ -120,9 +135,9 @@ void Task_led_blink(void *parameters)
while(1)
{
- printf("%u sec\n\r", cnt++);//// stdio_usb_putchar (NULL, "data");//
+ printf(">%u sec\n\r", 10*(cnt++));//// stdio_usb_putchar (NULL, "data");//
+ vTaskDelay(10000);
LED_Toggle(LED_PIN);
- vTaskDelay(1000);
/*if((c1 % 50000) == 0){
//periodic_event_1s();
if(!stdio_cdc_opened){