aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2018-08-23 08:39:49 +0300
committerShlomo Hecht <shlomo@twine-s.com>2018-08-23 08:39:49 +0300
commitbe4b16ebb5b6d6d77834c85b087aa748129cbdcd (patch)
treebac998ba5f01f118dbb6a3e5810eb2b4b9c6d856 /Software/Embedded_SW
parent48800971a024f2bf7e8b6ae673ecbb2235ef18dc (diff)
downloadTango-be4b16ebb5b6d6d77834c85b087aa748129cbdcd.tar.gz
Tango-be4b16ebb5b6d6d77834c85b087aa748129cbdcd.zip
USB buffers updated to 4000. USB and UART share THE SAME RX BUFFER!
Diffstat (limited to 'Software/Embedded_SW')
-rw-r--r--Software/Embedded_SW/Embedded/Communication/CommunicationTask.c6
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c12
-rw-r--r--Software/Embedded_SW/Embedded/Include.h2
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Dispenser.c1
4 files changed, 12 insertions, 9 deletions
diff --git a/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c b/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c
index 5ec028e86..91f1a78aa 100644
--- a/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c
+++ b/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c
@@ -31,12 +31,12 @@ struct serialBuffer {
size_t size;
} typedef SerialBuffer;
-char Buffer[4000];
+char CommRxBuffer[COMM_MAX_BUFFER_SIZE];
SerialBuffer inBuffer;
uint32_t initArray(size_t initialSize) {
SerialBuffer *a = &inBuffer;
- if (initialSize >= 4000) return 0;
- a->buffer = Buffer;
+ if (initialSize >= COMM_MAX_BUFFER_SIZE) return 0;
+ a->buffer = CommRxBuffer;
a->used = 0;
a->size = initialSize;
return initialSize;
diff --git a/Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c b/Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c
index 1dfcfbfad..04561139e 100644
--- a/Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c
+++ b/Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c
@@ -56,7 +56,6 @@ typedef unsigned long USBCDCDEventType;
#endif
/* Defines */
-#define USBBUFFERSIZE 256
//****************************************************************************
//
// A buffer into which the composite device can write the combined config
@@ -79,8 +78,9 @@ typedef volatile enum {
/* Static variables and handles */
static volatile USBCDCD_USBState state;
-static unsigned char receiveBuffer[USBBUFFERSIZE];
-static unsigned char transmitBuffer[USBBUFFERSIZE];
+extern unsigned char CommRxBuffer[COMM_MAX_BUFFER_SIZE];
+//static unsigned char receiveBuffer[COMM_MAX_BUFFER_SIZE];
+static unsigned char transmitBuffer[COMM_MAX_BUFFER_SIZE];
int expected_message_size;
int current_message_size;
@@ -214,8 +214,8 @@ tUSBBuffer rxBuffer =
USBDCDCPacketRead, /* pfnTransfer */
USBDCDCRxPacketAvailable, /* pfnAvailable */
(void *)&g_sCDCDevice, /* pvHandle */
- receiveBuffer, /* pcBuffer */
- USBBUFFERSIZE, /* ulBufferSize */
+ CommRxBuffer, /* pcBuffer */
+ COMM_MAX_BUFFER_SIZE, /* ulBufferSize */
{{0, 0, 0, 0}, 0, 0} /* private data workspace */
};
@@ -228,7 +228,7 @@ tUSBBuffer txBuffer =
USBDCDCTxPacketAvailable, /* pfnAvailable */
(void *)&g_sCDCDevice, /* pvHandle */
transmitBuffer, /* pcBuffer */
- USBBUFFERSIZE, /* ulBufferSize */
+ COMM_MAX_BUFFER_SIZE, /* ulBufferSize */
{{0, 0, 0, 0}, 0, 0} /* private data workspace */
};
diff --git a/Software/Embedded_SW/Embedded/Include.h b/Software/Embedded_SW/Embedded/Include.h
index 7a9dda68b..d99971021 100644
--- a/Software/Embedded_SW/Embedded/Include.h
+++ b/Software/Embedded_SW/Embedded/Include.h
@@ -56,6 +56,8 @@
#define PI 3.1415926
+#define COMM_MAX_BUFFER_SIZE 4000
+
typedef uint32_t (* callback_fptr)(uint32_t deviceID, uint32_t ReadValue);
extern void SysTickHandler(void);
diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Dispenser.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Dispenser.c
index 0bcc9f7c9..7c0a4c980 100644
--- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Dispenser.c
+++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Dispenser.c
@@ -9,6 +9,7 @@
#include "Drivers/USB_Communication/USBCDCD.h"
#include "drivers/adc_sampling/adc.h"
+#include "modules/ids/ids_ex.h"