aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2018-11-12 15:04:02 +0200
committerShlomo Hecht <shlomo@twine-s.com>2018-11-12 15:04:02 +0200
commiteee8a19447eaeb87fd38d11354a4adc29148963a (patch)
treee92f4ddee94428107c1a2d78bcd6c3fa0af519d8 /Software/Embedded_SW/Embedded/Communication/CommunicationTask.c
parent6bf9ac4eca2a4b9616a1a62ba89707651c410562 (diff)
downloadTango-eee8a19447eaeb87fd38d11354a4adc29148963a.tar.gz
Tango-eee8a19447eaeb87fd38d11354a4adc29148963a.zip
some memory management hooks. fix motors homing
Diffstat (limited to 'Software/Embedded_SW/Embedded/Communication/CommunicationTask.c')
-rw-r--r--Software/Embedded_SW/Embedded/Communication/CommunicationTask.c8
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 ac0f13a2a..13d059020 100644
--- a/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c
+++ b/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c
@@ -12,7 +12,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;
@@ -163,7 +163,7 @@ void communicationTask(UArg arg0, UArg arg1)
}
}
-int UnSentMessages=0;
+int UnSentMessages=0, deliveryfailure = 0;
bool CommunicationTaskSendMessage(char* buffer,size_t length)
{
CommTxMessageStruc Message;
@@ -179,11 +179,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;
@@ -195,6 +198,7 @@ void CommunicationMailboxFlush(void)
UnSentMessages--;
LOG_ERROR(Message.msgSize,"Flushing Message");
my_free(Message.Buff);
+ memoryrelease+=Message.msgSize;
}
}
}