From 84c7783b0b68c71c8a6419ca59617f956bd4b136 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Fri, 3 May 2019 11:26:11 +0300 Subject: diagnostics at least once a second. gas sensor stub --- Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c | 7 +++++++ Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c | 2 +- Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c | 8 ++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index 785d9fc3c..db13f5e15 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -67,7 +67,11 @@ DiagnosticsMonitors DiagnosticsMonitor = DIAGNOSTICS_MONITORS__INIT; #define DIAGNOSTICS_LIMIT 3 #define DIAGNOSTICS_DANCER_LIMIT 30 int DiagnosticsIndex = 0; +#ifdef REDUCED_DIAGNOSTICS +int DiagnosticCollectionLimit = 1; //number of data samples to collect before sending to the host +#else int DiagnosticCollectionLimit = 2; //number of data samples to collect before sending to the host +#endif //int DiagnosticLimit = eHundredMillisecond; //frequency of data collection //int DiagnosticFastLimit = eTenMillisecond; //frequency of data collection #ifdef REDUCED_DIAGNOSTICS @@ -190,6 +194,9 @@ void SetDiagnosticCollectionLimit(int limit) { if ((limit)&&(limit<= DIAGNOSTICS_LIMIT)) DiagnosticCollectionLimit = limit; +#ifdef REDUCED_DIAGNOSTICS + DiagnosticCollectionLimit = 1; //overrule - send at least once every second +#endif } uint8_t HeaterCounterIndex[MAX_HEATERS_NUM]= {0,0,0,0,0,0,0,0,0,0}; diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c index b12064915..f0ce7397c 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c @@ -118,7 +118,7 @@ void LoadConfigurationParameters(ConfigurationParameters *Params) EmbeddedParameters.has_breaksensorlimit = true; EmbeddedParameters.breaksensorlimit = 10; EmbeddedParameters.has_diagnosticcollectionlimit = true; - EmbeddedParameters.diagnosticcollectionlimit = 2; + EmbeddedParameters.diagnosticcollectionlimit = 1; EmbeddedParameters.has_overheatcountlimit = true; EmbeddedParameters.overheatcountlimit = 3; EmbeddedParameters.has_underheatcountlimit = true; diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c index 34cb61e27..c6f2526db 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c @@ -11,6 +11,7 @@ #include "drivers/Flash_Memory/FATFS/ff.h" #include "drivers/Flash_Memory/FATFS/Control_File_System.h" +#include "drivers/adc_sampling/adc.h" //#include "graphics_adapter.h" @@ -33,6 +34,13 @@ void Stub_ProgressRequest(MessageContainer* requestContainer) assert(iFResult); } } + else + if((request->amount == 0x0C) && (request->delay == 0x0C)) //Get Gas Sensor + { + response.progress = (double)Calculate_Gas_Power_Consumption(); + response.has_progress = true; + + } else if((request->amount == 0xDF) && (request->delay == 0xDF)) //Power off { PowerOffInit(); -- cgit v1.3.1