diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-11-13 10:46:15 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-11-13 10:46:15 +0200 |
| commit | 00525cc261ec117e2eb78ac2a4525fa3da92d399 (patch) | |
| tree | 9f4c311d915b0305f31925bab4d87a97cf82d790 /Software/Embedded_SW/Embedded/Communication/CommunicationTask.c | |
| parent | 8d4920307ed4bbb6760245728934b91e249fe6c4 (diff) | |
| parent | 996422d12e0a40aa408757989232f0225dc29a28 (diff) | |
| download | Tango-00525cc261ec117e2eb78ac2a4525fa3da92d399.tar.gz Tango-00525cc261ec117e2eb78ac2a4525fa3da92d399.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Communication/CommunicationTask.c')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Communication/CommunicationTask.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c b/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c index 2b551108d..b27ab687d 100644 --- a/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c +++ b/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c @@ -15,7 +15,7 @@ static void (*callback)(char* buffer, size_t length); Mailbox_Handle CommunicationRxMsgQ = NULL; Mailbox_Handle CommunicationTxMsgQ = NULL; -#define COMMUNICATION_NUM_MSGS 15 +#define COMMUNICATION_NUM_MSGS 20 typedef struct CommRxMessage{ //uint16_t messageId; uint16_t msgSize; @@ -157,7 +157,7 @@ void communicationTask(UArg arg0, UArg arg1) } } -int UnSentMessages=0; +int UnSentMessages=0, deliveryfailure = 0; bool CommunicationTaskSendMessage(char* buffer,size_t length) { CommTxMessageStruc Message; @@ -173,11 +173,14 @@ bool CommunicationTaskSendMessage(char* buffer,size_t length) if (retcode == false) { my_free(buffer); + deliveryfailure++; + CommunicationMailboxFlush(); } return retcode; } +int memoryrelease = 0; void CommunicationMailboxFlush(void) { int i; @@ -189,6 +192,7 @@ void CommunicationMailboxFlush(void) UnSentMessages--; LOG_ERROR(Message.msgSize,"Flushing Message"); my_free(Message.Buff); + memoryrelease+=Message.msgSize; } } } |
