aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Embedded_SW')
-rw-r--r--Software/Embedded_SW/Embedded/Communication/Connection.c29
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c62
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c4
-rw-r--r--Software/Embedded_SW/Embedded/Main.c12
-rw-r--r--Software/Embedded_SW/Embedded/Modules/General/MachineStatus.h1
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_ExtFlash.c8
-rw-r--r--Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.h1
7 files changed, 34 insertions, 83 deletions
diff --git a/Software/Embedded_SW/Embedded/Communication/Connection.c b/Software/Embedded_SW/Embedded/Communication/Connection.c
index 7f4efdd1b..af60541aa 100644
--- a/Software/Embedded_SW/Embedded/Communication/Connection.c
+++ b/Software/Embedded_SW/Embedded/Communication/Connection.c
@@ -26,6 +26,9 @@
#include "Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h"
#include "StateMachines/Printing/PrintingSTM.h"
+#include "StateMachines/Initialization/InitSequence.h"
+#include "StateMachines/Initialization/PowerOffSequence.h"
+#include "Modules/General/MachineStatus.h"
#include "Modules/heaters/heaters_ex.h"
#include "modules/Diagnostics/Diagnostics.h"
@@ -39,6 +42,20 @@ char HexToDecimal(char hex)
int j = hex / 0x10;
return j*10+i;
}
+bool KeepAliveActive = false;
+
+void StopRecurringReports(void)
+{
+ ReportStopReporting();
+ DiagnosticsStop();
+ JobStopReporting();
+ AlarmHandlingStop();
+ PowerUpStopReporting();
+ MachineUpdateStopReporting();
+ PowerDownStopReporting();
+
+ KeepAliveActive = false;
+}
void ConnectionRequest(MessageContainer* requestContainer)
{
MessageContainer responseContainer;
@@ -66,10 +83,7 @@ void ConnectionRequest(MessageContainer* requestContainer)
if (request->has_unixtime)
utilsUpdateDateTime(request->unixtime);//(request->seconds);
- ReportStopReporting();
- DiagnosticsStop();
- JobStopReporting();
- AlarmHandlingStop();
+ StopRecurringReports();
/*
extern TangoVersion_t _gTangoVersion;
extern char Dat[50];
@@ -139,7 +153,6 @@ void DisconnectionRequest(MessageContainer* requestContainer)
}
int KeepAliveOneSecondCounter = 0;
#define KEEPALIVE_COMMUNICATION_ABORT_LIMIT 10
-bool KeepAliveActive = false;
bool keepalivetest = false;
void KeepAliveRequestFunc(MessageContainer* requestContainer)
{
@@ -215,11 +228,7 @@ void KeepAliveOneSecondCall(void)
Report("keepalive ",__FILE__,__LINE__,KeepAliveOneSecondCounter,RpWarning,msec_millisecondCounter, 0);
//LOG_ERROR(KeepAliveOneSecondCounter, "Communication keepalive failed");
KeepAliveOneSecondCounter = 0;
- KeepAliveActive = false;
- ReportStopReporting();
- DiagnosticsStop();
- JobStopReporting();
- AlarmHandlingStop();
+ StopRecurringReports();
CommunicationMailboxFlush();
keepalivetest = false;
//USBCDCD_init();
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c
index 1f2c304e8..ab9a3dde5 100644
--- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c
@@ -412,12 +412,10 @@ uint16_t volt;
bool WHS_Set_Blower_Control_Closed_Loop(double Q_value)
{
double current_dying_head_flow_Q = 0.0;
- double tmp = 0.0;
current_dying_head_flow_Q = get_CurrentQ(HEAD_FLOW_METER);//get_average_Q(HEAD_FLOW_METER);
ReportWithPackageFilter(WasteFilter,"------------ current_dying_head_flow_Q =-----------------", __FILE__,__LINE__, current_dying_head_flow_Q, RpMessage, 0, 0);
ReportWithPackageFilter(WasteFilter,"------------ SET_DYEING_HEAD_ORRIFFICE_SENSOR =-----------------", __FILE__,__LINE__, (int)(Q_value * 1000), RpMessage, (int)(current_dying_head_flow_Q * 1000), 0);
- tmp = fabs((current_dying_head_flow_Q) - (Q_value));
if (IFS_Clearing_Suction == true)
{
@@ -454,66 +452,6 @@ bool WHS_Set_Blower_Control_Closed_Loop(double Q_value)
}
volt = getBlowerState();
WHS_Pid_Testing_Func(Q_value,current_dying_head_flow_Q);
- //close_loop_time = 1;
- if (0)//(tmp > 0.02)
- {
- //volt = g_MAX5805_device.CODE;
- if (current_dying_head_flow_Q < Q_value)
- {
- if (( Q_value - current_dying_head_flow_Q) > 1)
- {
- /* increase blower voltage by large step: */
- ReportWithPackageFilter(WasteFilter,"------------ increase blower voltage by 100:-----------------", __FILE__,__LINE__, volt, RpMessage, STEP_100, 0);
- SendLimitedBlowerControl(volt + STEP_100);
- close_loop_time = 15;
- }
- else
- {
- if (( Q_value - current_dying_head_flow_Q) > 0.20)
- {
- /* increase blower voltage by small step: */
- ReportWithPackageFilter(WasteFilter,"------------ increase blower voltage by 10:-----------------", __FILE__,__LINE__, volt, RpMessage, STEP_10, 0);
- SendLimitedBlowerControl(volt + STEP_10);
- close_loop_time = 4;
- }
- else
- {
- /* increase blower voltage by small step: */
- ReportWithPackageFilter(WasteFilter,"------------ increase blower voltage by 1:-----------------", __FILE__,__LINE__, volt, RpMessage, STEP_1, 0);
- SendLimitedBlowerControl(volt + STEP_1);
- close_loop_time = 2;
- }
- }
- }
- else
- {
- if (( current_dying_head_flow_Q - Q_value) > 1)
- {
- /* decrease blower voltage by large step: */
- ReportWithPackageFilter(WasteFilter,"------------ decrease blower voltage by 100:-----------------", __FILE__,__LINE__, volt, RpMessage, STEP_100, 0);
- SendLimitedBlowerControl(volt - STEP_100);
- close_loop_time = 15;
- }
- else
- {
- if (( current_dying_head_flow_Q - Q_value) > 0.20)
- {
- /* decrease blower voltage by small step: */
- ReportWithPackageFilter(WasteFilter,"------------ decrease blower voltage by 10:-----------------", __FILE__,__LINE__, volt, RpMessage, STEP_10, 0);
- SendLimitedBlowerControl(volt - STEP_10);
- close_loop_time = 4;
- }
- else
- {
- /* decrease blower voltage by small step: */
- ReportWithPackageFilter(WasteFilter,"------------ decrease blower voltage by 1:-----------------", __FILE__,__LINE__, volt, RpMessage, STEP_1, 0);
- SendLimitedBlowerControl(volt - STEP_1);
- close_loop_time = 2;
- }
- }
- }
- }
- //Report("------------ Blower Control :-----------------", __FILE__,Orf_zero_value[HEAD_FLOW_METER], (int)(current_dying_head_flow_Q*100), RpMessage, (int)(Q_value*100), 0);
return OK;
}
diff --git a/Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c b/Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c
index b448a9801..389548f26 100644
--- a/Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c
+++ b/Software/Embedded_SW/Embedded/Drivers/USB_Communication/USBCDCD.c
@@ -994,7 +994,7 @@ unsigned int USBCDCD_sendData(const unsigned char *_pBuff,
unsigned int _length,
unsigned int _timeout)
{
- int len = 0;
+ //int len = 0;
uint8_t size[4];
size[3] = (_length>>24) & 0xFF;
size[2] = (_length>>16) & 0xFF;
@@ -1003,7 +1003,7 @@ unsigned int USBCDCD_sendData(const unsigned char *_pBuff,
if (USB_Reinit ==true)
return OK;
- len = USBBufferWrite((tUSBBuffer *)&txBuffer, size, 4);
+ /*len = */USBBufferWrite((tUSBBuffer *)&txBuffer, size, 4);
/*if (len == 0)
{
USBRingBufFlush(&(txBuffer.sPrivateData.sRingBuf));
diff --git a/Software/Embedded_SW/Embedded/Main.c b/Software/Embedded_SW/Embedded/Main.c
index de91e5b99..c1d83abb3 100644
--- a/Software/Embedded_SW/Embedded/Main.c
+++ b/Software/Embedded_SW/Embedded/Main.c
@@ -136,7 +136,7 @@ Void MyswitchFxn(Task_Handle prev, Task_Handle next)
/* ======== errHook ======== */
Void errHook(Error_Block *eb)
{
- FRESULT Fresult = FR_OK;
+ //FRESULT Fresult = FR_OK;
uint32_t Bytes = 0;
//char File[50] = "";*/
@@ -158,7 +158,7 @@ Void errHook(Error_Block *eb)
FirstErrorFlag = false;
MCU_E2PromProgram(EEPROM_INIT_FAILURE_COUNTER,InitFailures+1);
len = usnprintf(message, 300, "\r\nerror task 0x%x %s context prev task 0x%x,%s", PrevTask,Task_Handle_name(PrevTask),NextTask,Task_Handle_name(NextTask));
- Fresult = f_write(LogFileHandle,message,len,&Bytes );
+ f_write(LogFileHandle,message,len,&Bytes );
site = Error_getSite(eb);
eid = Error_getId(eb);
eCode = Error_getCode(eb);
@@ -166,21 +166,21 @@ Void errHook(Error_Block *eb)
len = usnprintf(message, 300, "\r\nerror %d, eid %d mod %d file %s line %d",
eCode, eid,site->mod,
site->file,site->line);
- Fresult = f_write(LogFileHandle,message,len,&Bytes );
+ f_write(LogFileHandle,message,len,&Bytes );
//LOG_ERROR (eCode, "error # ");
// check originator's mod id against known mods
if (site->mod == Main_Module_id()) {
- Fresult = f_write(LogFileHandle,"\r\napp error: ",12,&Bytes );
+ f_write(LogFileHandle,"\r\napp error: ",12,&Bytes );
}
// check error id against known errors
if (eid == Error_E_generic) {
- Fresult = f_write(LogFileHandle,"generic: ",10,&Bytes );
+ f_write(LogFileHandle,"generic: ",10,&Bytes );
}
else if (eid == Assert_E_assertFailed) {
System_printf("assertion violation: ");
- Fresult = f_write(LogFileHandle,"\r\nassertion violation: ",22,&Bytes );
+ f_write(LogFileHandle,"\r\nassertion violation: ",22,&Bytes );
}
}
CloseLogFile();
diff --git a/Software/Embedded_SW/Embedded/Modules/General/MachineStatus.h b/Software/Embedded_SW/Embedded/Modules/General/MachineStatus.h
index b3b773b1e..ed3ec205d 100644
--- a/Software/Embedded_SW/Embedded/Modules/General/MachineStatus.h
+++ b/Software/Embedded_SW/Embedded/Modules/General/MachineStatus.h
@@ -14,6 +14,7 @@
uint32_t MachineUpdateInitFunc(MessageContainer* requestContainer);
uint32_t StopMachineUpdateFunc(MessageContainer* requestContainer);
+void MachineUpdateStopReporting(void);
void SetMachineStatus (MachineState State);
int MachineUpdateResponseFunc(void);
uint32_t StartInkFillingStatusRequestFunc(MessageContainer* requestContainer);
diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_ExtFlash.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_ExtFlash.c
index 51c92ed8c..3d1809b37 100644
--- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_ExtFlash.c
+++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_ExtFlash.c
@@ -291,7 +291,7 @@ void Stub_ExtFlashReadWordsRequest(MessageContainer* requestContainer)
//---------------------------------------------------------------------------------------------
void Stub_ExtFlashWriteWordsRequest(MessageContainer* requestContainer)
{
-
+/*
uint32_t status = PASSED;
MessageContainer responseContainer;
@@ -300,7 +300,7 @@ void Stub_ExtFlashWriteWordsRequest(MessageContainer* requestContainer)
StubExtFlashWriteWordsResponse response = STUB_EXT_FLASH_WRITE_WORDS_RESPONSE__INIT;
- uint32_t Current_Start_address = ExtFlashWriteBuf(/*0,*/request->n_wordtwrite, request->wordtwrite);// alwayes send sddress 0
+ uint32_t Current_Start_address = ExtFlashWriteBuf(request->n_wordtwrite, request->wordtwrite);// alwayes send sddress 0
response.address = Current_Start_address;
response.has_address = true;
@@ -317,13 +317,14 @@ void Stub_ExtFlashWriteWordsRequest(MessageContainer* requestContainer)
SendChars((char*)container_buffer, container_size);
stub_ext_flash_write_words_request__free_unpacked(request,NULL);
+ */
}
void Stub_ExtFlashReadWordsRequest(MessageContainer* requestContainer)
{
uint32_t status = PASSED;
- MessageContainer responseContainer;
+ /*MessageContainer responseContainer;
StubExtFlashReadWordsRequest* request = stub_ext_flash_read_words_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data);
@@ -344,6 +345,7 @@ void Stub_ExtFlashReadWordsRequest(MessageContainer* requestContainer)
free(responseContainer.data.data);
SendChars((char*)container_buffer, container_size);
stub_ext_flash_read_words_request__free_unpacked(request,NULL);
+ */
}
diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.h b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.h
index d0157ed47..dd1d2ddfb 100644
--- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.h
+++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.h
@@ -41,6 +41,7 @@ double GetZone1RMSCurrent(double VAC);
uint32_t PowerUpUpdateFunc(MessageContainer* requestContainer);
uint32_t AbortPowerUpFunc(MessageContainer* requestContainer);
+void PowerUpStopReporting(void);
#endif /* STATEMACHINES_INITIALIZATION_INITSEQUENCE_H_ */