From 5accee4df85cc47b5700ad32090451ded2a121fa Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Thu, 26 Jul 2018 16:34:16 +0300 Subject: warning removed. diagnostics stops when the commtx mailbox is full. --- Software/Embedded_SW/Embedded/Communication/CommunicationTask.c | 6 +++--- Software/Embedded_SW/Embedded/Communication/CommunicationTask.h | 2 +- Software/Embedded_SW/Embedded/Communication/Connection.c | 5 ++++- Software/Embedded_SW/Embedded/Communication/Container.c | 9 +++++---- Software/Embedded_SW/Embedded/Communication/Container.h | 2 +- 5 files changed, 14 insertions(+), 10 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Communication') diff --git a/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c b/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c index aa50b4db8..b6841ef7e 100644 --- a/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c +++ b/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c @@ -122,7 +122,7 @@ void communicationTask(UArg arg0, UArg arg1) } -uint32_t CommunicationTaskSendMessage(char* buffer,size_t length) +bool CommunicationTaskSendMessage(char* buffer,size_t length) { CommTxMessageStruc Message; CommTxMsgCounter++; @@ -131,9 +131,9 @@ uint32_t CommunicationTaskSendMessage(char* buffer,size_t length) Message.msgSize = length; Message.Buff = buffer; if (CommunicationTxMsgQ != NULL) - /*retcode =*/ Mailbox_post(CommunicationTxMsgQ , &Message, BIOS_NO_WAIT); + return Mailbox_post(CommunicationTxMsgQ , &Message, BIOS_NO_WAIT); - return OK; + return false; } int32_t SetCommunicationPath(bool UARTorUSB) { diff --git a/Software/Embedded_SW/Embedded/Communication/CommunicationTask.h b/Software/Embedded_SW/Embedded/Communication/CommunicationTask.h index 5746eb825..50309c899 100644 --- a/Software/Embedded_SW/Embedded/Communication/CommunicationTask.h +++ b/Software/Embedded_SW/Embedded/Communication/CommunicationTask.h @@ -21,7 +21,7 @@ extern uint32_t CommunicationTaskInit(void); extern uint32_t CommunicationTaskMessageReceived(uint16_t msgSize); -extern uint32_t CommunicationTaskSendMessage(char* buffer,size_t length); +extern bool CommunicationTaskSendMessage(char* buffer,size_t length); #define isUART true #define isUSB false diff --git a/Software/Embedded_SW/Embedded/Communication/Connection.c b/Software/Embedded_SW/Embedded/Communication/Connection.c index ed7aa9dfc..320dc56d1 100644 --- a/Software/Embedded_SW/Embedded/Communication/Connection.c +++ b/Software/Embedded_SW/Embedded/Communication/Connection.c @@ -18,8 +18,11 @@ #include "Common/SW_Info/SW_Info.h" #include "Common/report/report.h" #include + #include "StateMachines/Printing/PrintingSTM.h" -#include "drivers/Uart_Comm/Uart.h" + +#include "Modules/heaters/heaters_ex.h" +#include "modules/AlarmHandling/Diagnostics.h" void ConnectionRequest(MessageContainer* requestContainer) diff --git a/Software/Embedded_SW/Embedded/Communication/Container.c b/Software/Embedded_SW/Embedded/Communication/Container.c index 60e972968..5cecd48f0 100644 --- a/Software/Embedded_SW/Embedded/Communication/Container.c +++ b/Software/Embedded_SW/Embedded/Communication/Container.c @@ -32,12 +32,13 @@ #include "Modules/General/GeneralHardware.h" #include "Modules/heaters/heaters_ex.h" #include "Modules/AlarmHandling/AlarmHandling.h" -//#include "Drivers/USB_Communication/USBCDCD.h" +#include "modules/AlarmHandling/Diagnostics.h" +#include "Modules/General/process.h" +#include "Modules/Thread/Thread_ex.h" + #include "Communication/CommunicationTask.h" #include "StateMachines/Printing/PrintingSTM.h" -#include "Modules/General/process.h" -#include "Modules/Thread/Thread_ex.h" #include "Common/report/report.h" #include "Connection.h" @@ -274,7 +275,7 @@ void receive_callback(char* buffer, size_t length) message_container__free_unpacked(requestContainer, NULL); } -uint32_t SendChars(char* buffer,size_t length) +bool SendChars(char* buffer,size_t length) { return CommunicationTaskSendMessage(buffer, length); } diff --git a/Software/Embedded_SW/Embedded/Communication/Container.h b/Software/Embedded_SW/Embedded/Communication/Container.h index 8e9aaacf9..212814160 100644 --- a/Software/Embedded_SW/Embedded/Communication/Container.h +++ b/Software/Embedded_SW/Embedded/Communication/Container.h @@ -7,6 +7,6 @@ MessageContainer createContainer(MessageType type, char* token, protobuf_c_boolean completed, void* response, size_t (*packPtr)(void*, uint8_t*), size_t (*sizePtr)(void*)); void receive_callback(char* buffer, size_t length); -uint32_t SendChars(char* buffer,size_t length); +bool SendChars(char* buffer,size_t length); #endif //CONTAINER_H -- cgit v1.3.1