aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Control
diff options
context:
space:
mode:
authorMirta <mirta@twine-s.com>2019-05-12 13:34:12 +0300
committerMirta <mirta@twine-s.com>2019-05-12 13:34:12 +0300
commit843774b4d84769783cf0100ad5a91ce3871c83b1 (patch)
tree3323ea585fd8475d3720bb4912b62c86c4a7b0f9 /Software/Embedded_SW/Embedded/Modules/Control
parent3043e65ad539455ad2510e402e1c8f2d168577d2 (diff)
parent524bc43f07339979eda1c812354a9a2e8e0f7e09 (diff)
downloadTango-843774b4d84769783cf0100ad5a91ce3871c83b1.tar.gz
Tango-843774b4d84769783cf0100ad5a91ce3871c83b1.zip
MERGE
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Control')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c2
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/control.c92
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/control.h5
3 files changed, 92 insertions, 7 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
index 193769265..916d33772 100644
--- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
+++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
@@ -48,6 +48,7 @@
#include "Common/SWUpdate/FileSystem.h"
#include "Communication/Connection.h"
+#include "Modules/General/buttons.h"
Task_Handle Millisecond_Task_Handle;
/******************** Definitions ********************************************/
@@ -514,6 +515,7 @@ uint32_t MillisecLowLoop(uint32_t tick)
{
Speed_Data = Calculate_Speed_Sensor_Velocity();
Read_Buttons_Reg();
+ Ink_Cart_Led();
for (Sensor_i = 0;Sensor_i < MAX_TEMPERATURE_SENSOR_ID;Sensor_i++)
{
MillisecUpdateTemperatures (Sensor_i,TemperatureSensorRead(Sensor_i));
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c
index 52b52d93b..f1e19d851 100644
--- a/Software/Embedded_SW/Embedded/Modules/Control/control.c
+++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c
@@ -69,7 +69,7 @@ typedef struct
uint32_t StartTick;
DataReadCBFunction ControlDataReadPtr;
ControlCBFunction ControlCallbackPtr;
- uint16_t ControlTiming;
+ uint32_t ControlTiming;
}ControlDeviceStruc;
typedef enum
@@ -158,7 +158,7 @@ uint32_t ControlActivityLed( uint32_t Parameter1)
{
static bool flag = false;
static uint8_t counter;
- const uint8_t Blink_Freq = 15;//odd number
+ const uint8_t Blink_Freq = 3;//odd number
if (flag==true)
{
@@ -166,11 +166,51 @@ uint32_t ControlActivityLed( uint32_t Parameter1)
ACTIVITY_RED_LED_OFF; // Heaters indication - all the Heaters OFF
if(power.color == fastBILNK)
Pannel_Leds(POWER_ON_OFF,MODE_OFF);
-
+ else
if((power.color == BLINK) && (counter % Blink_Freq == 0) )
{
Pannel_Leds(POWER_ON_OFF,MODE_OFF);
}
+ ///////////////////////////////////////////////////////////
+ if(jog.color == fastBILNK)
+ Pannel_Leds(THREAD_JOGGING,MODE_OFF);
+ else
+ if((jog.color == BLINK) && (counter % Blink_Freq == 0) )
+ {
+ Pannel_Leds(THREAD_JOGGING,MODE_OFF);
+ }
+ ///////////////////////////////////////////////////////////
+ if(load.color == fastBILNK)
+ Pannel_Leds(THREAD_LOAD,MODE_OFF);
+ else
+ if((load.color == BLINK) && (counter % Blink_Freq == 0) )
+ {
+ Pannel_Leds(THREAD_LOAD,MODE_OFF);
+ }
+ ///////////////////////////////////////////////////////////
+ if(cart1.color == fastBILNK)
+ Pannel_Leds(CART_1,MODE_OFF);
+ else
+ if((cart1.color == BLINK) && (counter % Blink_Freq == 0) )
+ {
+ Pannel_Leds(CART_1,MODE_OFF);
+ }
+ ///////////////////////////////////////////////////////////
+ if(cart2.color == fastBILNK)
+ Pannel_Leds(CART_2,MODE_OFF);
+ else
+ if((cart2.color == BLINK) && (counter % Blink_Freq == 0) )
+ {
+ Pannel_Leds(CART_2,MODE_OFF);
+ }
+ ///////////////////////////////////////////////////////////
+ if(cart3.color == fastBILNK)
+ Pannel_Leds(CART_3,MODE_OFF);
+ else
+ if((cart3.color == BLINK) && (counter % Blink_Freq == 0) )
+ {
+ Pannel_Leds(CART_3,MODE_OFF);
+ }
flag = false;
}
else
@@ -181,11 +221,53 @@ uint32_t ControlActivityLed( uint32_t Parameter1)
if(power.color == fastBILNK)
Pannel_Leds(POWER_ON_OFF,MODE_ON);
-
+ else
if((power.color == BLINK) && (counter % Blink_Freq == 0) )
{
Pannel_Leds(POWER_ON_OFF,MODE_ON);
}
+ ///////////////////////////////////////////////////////////
+ if(jog.color == fastBILNK)
+ Pannel_Leds(THREAD_JOGGING,MODE_ON);
+ else
+ if((jog.color == BLINK) && (counter % Blink_Freq == 0) )
+ {
+ Pannel_Leds(THREAD_JOGGING,MODE_ON);
+ }
+ ///////////////////////////////////////////////////////////
+ if(load.color == fastBILNK)
+ Pannel_Leds(THREAD_LOAD,MODE_ON);
+ else
+ if((load.color == BLINK) && (counter % Blink_Freq == 0) )
+ {
+ Pannel_Leds(THREAD_LOAD,MODE_ON);
+ }
+ ///////////////////////////////////////////////////////////
+ if(cart1.color == fastBILNK)
+ Pannel_Leds(CART_1,MODE_ON);
+ else
+ if((cart1.color == BLINK) && (counter % Blink_Freq == 0) )
+ {
+ Pannel_Leds(CART_1,MODE_ON);
+ }
+ ///////////////////////////////////////////////////////////
+ if(cart2.color == fastBILNK)
+ Pannel_Leds(CART_2,MODE_ON);
+ else
+ if((cart2.color == BLINK) && (counter % Blink_Freq == 0) )
+ {
+ Pannel_Leds(CART_2,MODE_ON);
+ }
+ ///////////////////////////////////////////////////////////
+ if(cart3.color == fastBILNK)
+ Pannel_Leds(CART_3,MODE_ON);
+ else
+ if((cart3.color == BLINK) && (counter % Blink_Freq == 0) )
+ {
+ Pannel_Leds(CART_3,MODE_ON);
+ }
+
+
flag = true;
}
@@ -224,7 +306,7 @@ void ControlStart(void)
* both these callbacks can be removed. if a new call is arriving, it invalidates the previous one (no dual control or data)
*
***************************************************************************************************************************************************/
-uint32_t AddControlCallback( ControlCBFunction Callback, CTRL_TIMING_ENUM CtrlFrequency, DataReadCBFunction DriverfPtr, uint16_t IfIndex, uint32_t Parameter1, uint32_t Parameter2 )
+uint32_t AddControlCallback( ControlCBFunction Callback, uint32_t CtrlFrequency, DataReadCBFunction DriverfPtr, uint16_t IfIndex, uint32_t Parameter1, uint32_t Parameter2 )
{
assert(Callback);
assert(DriverfPtr);
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.h b/Software/Embedded_SW/Embedded/Modules/Control/control.h
index 8d7e219ac..380040e34 100644
--- a/Software/Embedded_SW/Embedded/Modules/Control/control.h
+++ b/Software/Embedded_SW/Embedded/Modules/Control/control.h
@@ -19,7 +19,8 @@ typedef enum {
eTenMillisecond = 10,
eHundredMillisecond = 100,
eOneSecond = 1000,
- eOneMinute = 60000
+ eOneMinute = 60000,
+ eOneHour = 3600000
}CTRL_TIMING_ENUM;
typedef enum
{
@@ -37,7 +38,7 @@ typedef enum
void ControlInit(void);
void ControlStop(void);
void ControlStart(void);
-uint32_t AddControlCallback( ControlCBFunction Callback, CTRL_TIMING_ENUM CtrlFrequency, DataReadCBFunction DriverfPtr, uint16_t IfIndex, uint32_t Parameter1, uint32_t Parameter2 );
+uint32_t AddControlCallback( ControlCBFunction Callback, uint32_t CtrlFrequency, DataReadCBFunction DriverfPtr, uint16_t IfIndex, uint32_t Parameter1, uint32_t Parameter2 );
int RemoveControlCallback(uint32_t deviceId, ControlCBFunction Callback );
//The safe remove command can be used ONLY when called from the control callback itself
int SafeRemoveControlCallback(uint32_t deviceId , ControlCBFunction Callback);