From cd18fb27a2499072f18cb0320ddeb85a0500a93e Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Thu, 31 Oct 2019 10:16:10 +0200 Subject: version 1.4.6.0 - going forward --- .../Modules/Diagnostics/DiagnosticActions.c | 6 + .../Embedded/Modules/Diagnostics/Diagnostics.c | 225 +++++++++++++++------ .../Modules/Diagnostics/DiagnosticsHoming.c | 9 +- 3 files changed, 178 insertions(+), 62 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Diagnostics') diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticActions.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticActions.c index 4597efa93..9a81854e6 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticActions.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticActions.c @@ -271,6 +271,12 @@ uint32_t SetDigitalOutRequestRequestFunc(MessageContainer* requestContainer) case INTERFACE_IOS__GPO_TFEED_BREAK_1: Pumps_Control(WASTECH_PUMP2, request->value); break; + case INTERFACE_IOS__GPO_BUZZER: + if (request->value == true) + Buzzer(MODE_ON);//use START or STOP, 0 - 100%(); + else + Buzzer(MODE_OFF);//use START or STOP, 0 - 100%(); + break; default: responseContainer.has_error = true; responseContainer.error = ERROR_CODE__GENERAL_ERROR; diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index 6db76e842..d4e1636a5 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -63,7 +63,7 @@ uint32_t DiagnosticsStop(void); uint32_t Diagnostics_ControlTrigger(uint32_t IfIndex, uint32_t ReadValue); uint32_t Diagnostics_TenMiliControlTrigger(uint32_t IfIndex, uint32_t ReadValue); uint32_t Diagnostics_OneSecControlTrigger(uint32_t IfIndex, uint32_t ReadValue); -uint32_t DispensersCollection(uint32_t IfIndex, uint32_t ReadValue); +uint32_t Diagnostics_OneMinControlTrigger(uint32_t IfIndex, uint32_t ReadValue); DiagnosticsMonitors DiagnosticsMonitor = DIAGNOSTICS_MONITORS__INIT; @@ -100,12 +100,16 @@ double dryerzone3temperature[DIAGNOSTICS_LIMIT+1]; double dispensermotorfrequency[MAX_SYSTEM_DISPENSERS][DIAGNOSTICS_LIMIT+1]; double dispenserspressure[MAX_SYSTEM_DISPENSERS][DIAGNOSTICS_LIMIT+1]; +double dispenserinklevel[MAX_SYSTEM_DISPENSERS][1]; +double midtankinklevel[MAX_SYSTEM_DISPENSERS][1]; double MidTankpressure[MAX_SYSTEM_DISPENSERS][1]; double HeatersCurrent[NUM_OF_CURRENT_HEATERS][1]; double VOC_Sensor; DoubleArray DispenserFreq[MAX_SYSTEM_DISPENSERS]; DoubleArray DiagnosticsDispenserPressure[MAX_SYSTEM_DISPENSERS]; +DoubleArray DispenserInkLevel[MAX_SYSTEM_DISPENSERS]; +DoubleArray DiagnosticsMidTankInkLevel[MAX_SYSTEM_DISPENSERS]; HeaterState **heatersstates; HeaterState HeaterInfo[HEATER_TYPE__MixerHeater+1]; @@ -136,6 +140,7 @@ typedef enum DiagnosticsTrigger, DiagnosticsTenMiliTrigger, DiagnosticsOneSecTrigger, + DiagnosticsOneMinuteTrigger }DiagnosticsMessages; typedef struct DiagnosticsMessage{ @@ -164,14 +169,16 @@ void DiagnosticsInit(void) DiagnosticsMsgQ = Mailbox_create(sizeof(DiagnosticsMessageStruc), 40, NULL,&eb); - DiagnosticsMonitor.dispensersmotorsfrequency = (DoubleArray**)my_malloc(sizeof(DoubleArray *)*8); - DiagnosticsMonitor.dispenserspressure = (DoubleArray**)my_malloc(sizeof(DoubleArray)*8); - DiagnosticsMonitor.dispenserslinearpositions = (DoubleArray**)my_malloc(sizeof(DoubleArray)*8); - DiagnosticsMonitor.dispensersangularencoders = (DoubleArray**)my_malloc(sizeof(DoubleArray)*8); + DiagnosticsMonitor.dispensersmotorsfrequency = (DoubleArray**)my_malloc(sizeof(DoubleArray *)*MAX_SYSTEM_DISPENSERS); + DiagnosticsMonitor.dispenserspressure = (DoubleArray**)my_malloc(sizeof(DoubleArray)*MAX_SYSTEM_DISPENSERS); + DiagnosticsMonitor.midtanksinklevel = (DoubleArray**)my_malloc(sizeof(DoubleArray)*MAX_SYSTEM_DISPENSERS); + DiagnosticsMonitor.dispensersinklevel = (DoubleArray**)my_malloc(sizeof(DoubleArray)*MAX_SYSTEM_DISPENSERS); for (i = 0; i= Diagnostic_Extended_Mode) @@ -448,13 +551,7 @@ void Diagnostic100msecCollection(void) MidTankpressure[i][0] = 1.00-(IDS_Dispenser_Data[i].consumedinnanolitter/5800000); } */ - if (DiagnosticMode == Diagnostic_Extreme_Mode) - { - for (i=0;i= Diagnostic_Extreme_Mode) + DiagnosticTenMsecCollection(); break; case DiagnosticsOneSecTrigger: DiagnosticOneSecCollection(); break; + case DiagnosticsOneMinuteTrigger: + DiagnosticOneMinuteCollection(); + break; default: break; } diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c index 14c083b4d..497556878 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c @@ -27,6 +27,7 @@ #include "drivers/Motors/Motor.h" #include "drivers/Valves/Valve.h" #include "Drivers/I2C_Communication/DAC/blower.h" +#include "drivers/Flash_ram/MCU_E2Prom.h" #include "ids/ids_ex.h" #include "General/process.h" @@ -57,7 +58,7 @@ return OK; uint32_t MotorHomingRequestFunc(MessageContainer* requestContainer) { uint32_t numberOfSteps = 0; - uint32_t LoadArmRounds = (int)dryerbufferlength; + uint32_t LoadArmRounds = 0; MessageContainer responseContainer; @@ -66,6 +67,12 @@ uint32_t MotorHomingRequestFunc(MessageContainer* requestContainer) MotorHomingResponse response = MOTOR_HOMING_RESPONSE__INIT; TimerMotors_t MotorId = (TimerMotors_t)request->motortype; + + if (dryerbufferlength) + LoadArmRounds = (int)dryerbufferlength; + else + MCU_E2PromRead(EEPROM_STORAGE_DRYER_CYCLES,&LoadArmRounds); + if (LoadArmRounds <= 2) LoadArmRounds = 20; -- cgit v1.3.1