From ddde99ac703d1e4ccfdea5030042fbf85dfcec38 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Tue, 23 Oct 2018 18:34:18 +0300 Subject: infrastructure for file system commands. rockers disabled --- Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread') diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index 54309a187..21a4a23c1 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -666,8 +666,8 @@ uint32_t ThreadPreSegmentState(void *JobDetails) //only for testing - when control works, these motors will take their speed from the dryer //MotorSetSpeed(HARDWARE_MOTOR_TYPE__MOTO_RDRIVING, OriginalMotorSpd_2PPS[FEEDER_MOTOR]); -//#warning rocker disabled - if (MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RLOADING].maxfrequency > 0) +#warning rocker disabled +/* if (MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RLOADING].maxfrequency > 0) { MotorSetDirection((TimerMotors_t)HARDWARE_MOTOR_TYPE__MOTO_RLOADING,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RLOADING].directionthreadwize); MotorSetSpeed(HARDWARE_MOTOR_TYPE__MOTO_RLOADING, 2); @@ -676,8 +676,8 @@ uint32_t ThreadPreSegmentState(void *JobDetails) { MotorSetDirection((TimerMotors_t)HARDWARE_MOTOR_TYPE__MOTO_LLOADING,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_LLOADING].directionthreadwize); MotorSetSpeed(HARDWARE_MOTOR_TYPE__MOTO_LLOADING, 2); - } - //#warning rocker disabled + }*/ + #warning rocker disabled // MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_RDRIVING,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDRIVING].directionthreadwize, 0, GPI_LS_RLOADMOTOR_UP, EndState); //TODO -- cgit v1.3.1 From 28ed912cd2237978bd9f2b19ae6713c32566bb5f Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Wed, 24 Oct 2018 09:11:54 +0300 Subject: flush messages from coomTx, reduce mailbox size to 20 --- .../Embedded_SW/Embedded/Common/report/reportInit.c | 6 +++++- .../Embedded/Communication/CommunicationTask.c | 18 ++++++++++++++++-- .../Embedded/Communication/CommunicationTask.h | 3 +++ .../Embedded_SW/Embedded/Modules/Thread/Thread_print.c | 1 + 4 files changed, 25 insertions(+), 3 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread') diff --git a/Software/Embedded_SW/Embedded/Common/report/reportInit.c b/Software/Embedded_SW/Embedded/Common/report/reportInit.c index bb44de929..5d010bc1e 100644 --- a/Software/Embedded_SW/Embedded/Common/report/reportInit.c +++ b/Software/Embedded_SW/Embedded/Common/report/reportInit.c @@ -112,7 +112,11 @@ int ReportResponseFunc(char *message, /* The formatted message if (container_buffer) { size_t container_size = message_container__pack(&responseContainer, container_buffer); - SendChars(container_buffer, container_size); + if (SendChars(container_buffer, container_size) == false) //comm tx mailbox full + { + CommunicationMailboxFlush(); + //protobufToken[0] = 0; + } } free(responseContainer.data.data); } diff --git a/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c b/Software/Embedded_SW/Embedded/Communication/CommunicationTask.c index f2ecb16b4..b63c74fee 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 20 typedef struct CommRxMessage{ //uint16_t messageId; uint16_t msgSize; @@ -184,6 +184,20 @@ bool CommunicationTaskSendMessage(char* buffer,size_t length) return retcode; } +void CommunicationMailboxFlush(void) +{ + int i; + CommTxMessageStruc Message; + for (i=0;i