aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Drivers
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2018-08-30 17:20:06 +0300
committerShlomo Hecht <shlomo@twine-s.com>2018-08-30 17:20:06 +0300
commit62db371c2acc1564cc8bedbe2e355dd863d2bac4 (patch)
treeaa0f85fd52f8a29469236d77123e642d4ceca003 /Software/Embedded_SW/Embedded/Drivers
parent89136a907fcc2ab46ec332e71c1cb4dc478830a9 (diff)
downloadTango-62db371c2acc1564cc8bedbe2e355dd863d2bac4.tar.gz
Tango-62db371c2acc1564cc8bedbe2e355dd863d2bac4.zip
support fast communication (multiple Rx messages from PC). set dispenser homing microstep to 1
Diffstat (limited to 'Software/Embedded_SW/Embedded/Drivers')
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c10
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/Uart_Comm/Uart.c9
2 files changed, 13 insertions, 6 deletions
diff --git a/Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c b/Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c
index 04561139e..b4da9afa9 100644
--- a/Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c
+++ b/Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c
@@ -530,6 +530,8 @@ uint32_t ControlHandler(void *pvCBData, uint32_t ui32Event, uint32_t ui32MsgValu
return(0);
}
+uint32_t buffId = 0xFF;
+
void handleRx(void)
{
uint32_t ui32Read;
@@ -551,7 +553,9 @@ if (expected_message_size == 0)
} while(size_bar < 4);
expected_message_size = *(int *)size;
- initArray( expected_message_size);
+ buffId = initArray( expected_message_size);
+ if (buffId == 0xFF)
+ expected_message_size = 0;
}
do
@@ -561,14 +565,14 @@ if (expected_message_size == 0)
// Did we get a character?
if(ui32Read)
{
- insertArray(ui8Char);
+ insertArray(buffId,ui8Char);
current_message_size++;
}
if (current_message_size == expected_message_size)
{
g_RxCount += current_message_size;
- CommunicationTaskMessageReceived(g_RxCount);
+ CommunicationTaskMessageReceived(buffId,current_message_size);
expected_message_size = 0;
current_message_size = 0;
break;
diff --git a/Software/Embedded_SW/Embedded/Drivers/Uart_Comm/Uart.c b/Software/Embedded_SW/Embedded/Drivers/Uart_Comm/Uart.c
index ec61f414c..b5c61eb46 100644
--- a/Software/Embedded_SW/Embedded/Drivers/Uart_Comm/Uart.c
+++ b/Software/Embedded_SW/Embedded/Drivers/Uart_Comm/Uart.c
@@ -199,6 +199,8 @@ void UART_ResetBuffers(void)
// The UART interrupt handler.
//
//*****************************************************************************
+uint32_t U0buffId = 0xFF;
+
void UARTIntHandler(UArg arg0)
{
uint32_t ui32Status;
@@ -235,7 +237,8 @@ void UARTIntHandler(UArg arg0)
//uDataLength[uindex] = U0_expected_message_size;
//if (uindex++>=50)
// uindex = 0;
- if (initArray( U0_expected_message_size) == 0)
+ U0buffId = initArray( U0_expected_message_size);
+ if (U0buffId == 0xFF)
U0_expected_message_size = 0;
U0_size_bar = 0;
memcpy (oldsize,size,4);
@@ -246,7 +249,7 @@ void UARTIntHandler(UArg arg0)
ui8Char = (char)ROM_UARTCharGetNonBlocking(UART_BASE);
Uart_rx_TotalCounter++;
- insertArray(ui8Char);
+ insertArray(U0buffId,ui8Char);
U0_current_message_size++;
if (U0_current_message_size == U0_expected_message_size)
@@ -254,7 +257,7 @@ void UARTIntHandler(UArg arg0)
Clock_setTimeout(UartClock, UartClockTimeout);
Clock_start(UartClock);
Uart_rx_Counter+=(4+U0_current_message_size);
- CommunicationTaskMessageReceived(U0_current_message_size);
+ CommunicationTaskMessageReceived(U0buffId, U0_current_message_size);
U0_expected_message_size = 0;
U0_current_message_size = 0;
break;