aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2018-05-24 18:07:02 +0300
committerShlomo Hecht <shlomo@twine-s.com>2018-05-24 18:07:02 +0300
commit296f2c7ca8d4e64d4c7ed3f0830861010f546a71 (patch)
treea2613c7cbc31ee0701683c607c30649fec1e17b8 /Software/Embedded_SW/Embedded
parent138fe61879c98c0fe2fbc15f69d4cfd9b7dc66cb (diff)
downloadTango-296f2c7ca8d4e64d4c7ed3f0830861010f546a71.tar.gz
Tango-296f2c7ca8d4e64d4c7ed3f0830861010f546a71.zip
Alarm Handling module introduced (Task, Init, Loop functions)
Diffstat (limited to 'Software/Embedded_SW/Embedded')
-rw-r--r--Software/Embedded_SW/Embedded/Embedded.cfg7
-rw-r--r--Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c102
-rw-r--r--Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.h15
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c10
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c1
-rw-r--r--Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c4
6 files changed, 131 insertions, 8 deletions
diff --git a/Software/Embedded_SW/Embedded/Embedded.cfg b/Software/Embedded_SW/Embedded/Embedded.cfg
index 8ee187e7c..8b7325d36 100644
--- a/Software/Embedded_SW/Embedded/Embedded.cfg
+++ b/Software/Embedded_SW/Embedded/Embedded.cfg
@@ -143,7 +143,7 @@ Program.global.millisec = Task.create("&MillisecTask", task8Params);
var task9Params = new Task.Params();
task9Params.instance.name = "HeatersControl";
-task9Params.priority = 6;
+task9Params.priority = 7;
Program.global.HeatersControl = Task.create("&HeatersControlTask", task9Params);
var task10Params = new Task.Params();
@@ -151,6 +151,11 @@ task10Params.instance.name = "communicationTx";
task10Params.priority = 3;
Program.global.communicationTx = Task.create("&communicationTxTask", task10Params);
+var task11Params = new Task.Params();
+task11Params.instance.name = "AlarmHandling";
+task11Params.priority = 6;
+Program.global.AlarmHandling = Task.create("&AlarmHandlingTask", task11Params);
+
/* ================ NDK configuration ================ */
/*var Ndk = xdc.loadPackage('ti.ndk.config');
var Global = xdc.useModule('ti.ndk.config.Global');
diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c
new file mode 100644
index 000000000..1733498c5
--- /dev/null
+++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c
@@ -0,0 +1,102 @@
+/*
+ * AlarmHandling.c
+
+ *
+ * Created on: 24 may 2018
+ * Author: shlomo
+ */
+
+#include "include.h"
+#include "Modules/General/GeneralHardware.h"
+
+#include "AlarmHandling.h"
+#include <driverlib/timer.h>
+#include <inc/hw_ints.h>
+
+#include "drivers/adc_sampling/adc.h"
+#include "Control/control.h"
+
+#include "drivers/Motors/Motor.h"
+#include "drivers/Danser_SSI/SSI_Comm.h"
+#include "drivers/Heater/TemperatureSensor.h"
+#include "drivers/FPGA/FPGA_SPI_Comm.h"
+#include "drivers/FPGA/FPGA.h"
+
+#include "modules/thread/thread_ex.h"
+
+Task_Handle AlarmHandling_Task_Handle;
+Mailbox_Handle AlarmHandlingMsgQ = NULL;
+static GateMutex_Handle gateAlarmHandlingDB;
+
+/******************** Functions ********************************************/
+//uint32_t Control_Delta_Position_Pass(uint32_t Current_Read,uint32_t Previous_Read);
+//**********************************************************************
+typedef enum
+{
+ AlarmHandlingTrigger,
+}AlarmHandlingMessages;
+
+typedef struct AlarmHandlingMessage{
+ uint16_t messageId;
+ uint16_t msglen;
+ uint32_t tick;
+ uint8_t messageData[20];
+}AlarmHandlingMessageStruc;
+
+/******************** CODE ********************************************/
+//**********************************************************************
+
+void AlarmHandlingInit(void)
+{
+ Error_Block eb;
+ int i;
+
+ Error_init(&eb);
+
+ AlarmHandlingMsgQ = Mailbox_create(sizeof(AlarmHandlingMessageStruc), 20, NULL,&eb);
+
+
+ //memset(AlarmHandlingDatalog,0,sizeof(uint32_t)*MAX_TANGO_CONTROL_DEVICES);
+
+ /*gateAlarmHandlingDB = GateMutex_create(NULL, &eb);
+ if (gateAlarmHandlingDB == NULL)
+ {
+ System_abort("Could not create USB Wait gate");
+ }*/
+
+
+ return;
+}
+uint32_t AlarmHandlingLoop(uint32_t tick)
+{
+ return OK;
+}
+/******************************************************************************
+ * ======== messageTsk ========
+ * Task for this function is created statically. See the project's .cfg file.
+ * this message task is created statically in system initialization,
+ ******************************************************************************/
+void AlarmHandlingTask(UArg arg0, UArg arg1)
+{
+ AlarmHandlingMessageStruc Message;
+ //char str[60];
+ //uint16_t length;
+ //Clock_setTimeout(HostKAClock, 1000);
+ //Clock_start(HostKAClock);
+ AlarmHandlingInit();
+ AlarmHandling_Task_Handle = Task_self();
+ while(1)
+ {
+ Mailbox_pend(AlarmHandlingMsgQ , &Message, BIOS_WAIT_FOREVER);
+ switch (Message.messageId)
+ {
+ case AlarmHandlingTrigger:
+ AlarmHandlingLoop(Message.tick);
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+
diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.h b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.h
new file mode 100644
index 000000000..c5eb88660
--- /dev/null
+++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.h
@@ -0,0 +1,15 @@
+/*
+ * AlarmHandling.h
+ *
+ * Created on: 24 במאי 2018
+ * Author: shlomo
+ */
+
+#ifndef MODULES_ALARMHANDLING_ALARMHANDLING_H_
+#define MODULES_ALARMHANDLING_ALARMHANDLING_H_
+
+
+
+
+
+#endif /* MODULES_ALARMHANDLING_ALARMHANDLING_H_ */
diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c
index ea8953519..ba766509b 100644
--- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c
+++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c
@@ -67,7 +67,7 @@ char stubToken[36] = {0};
void HeatingTestRequest(MessageContainer* requestContainer)
{
-#ifdef DEBUG_TEST_FUNCTIONS
+//#ifdef DEBUG_TEST_FUNCTIONS
MessageContainer responseContainer;
uint8_t* container_buffer;
uint32_t status = 0;
@@ -119,10 +119,10 @@ void HeatingTestRequest(MessageContainer* requestContainer)
//free(requestContainer);
stub_heating_test_request__free_unpacked(request,NULL);
-#else
- LOG_ERROR (-1, "Heating Control not on debug");
- return ERROR;
-#endif
+//#else
+// LOG_ERROR (-1, "Heating Control not on debug");
+// return ERROR;
+//#endif
}
void HeatingTestPollRequest(MessageContainer* requestContainer)
{
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
index 67f2227d2..c036f4913 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
@@ -310,6 +310,7 @@ bool InitialProcess = false;
#endif
}
Winder_Prepare();
+ PrepareReady(Module_Thread,ModuleDone);
//set 3 dancers to the profile positions
InitialProcess = true;
return OK;
diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c
index 6f0d6de63..761f4fffb 100644
--- a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c
+++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c
@@ -137,8 +137,8 @@ static ReturnCode PrepareState(void *JobDetails)
PrepareWaiting[Module_Winder] = ModuleWaiting;
PrepareWaiting[Module_Thread] = ModuleWaiting;
ThreadPrepareState(&CurrentJob);
- PrepareWaiting[Module_IDS] = ModuleWaiting;
- IDSPrepareState(JobDetails);
+ //PrepareWaiting[Module_IDS] = ModuleWaiting;
+ //IDSPrepareState(JobDetails);
/*
* typedef enum