aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2020-05-26 16:58:56 +0300
committerAvi Levkovich <avi@twine-s.com>2020-05-26 16:58:56 +0300
commitf0fc1abe6628c903d2e58dcd1b1a88ef43d45057 (patch)
tree6419453aa84c6ea8131d1c9a01f25d656c6b0d62 /Software/Embedded_SW
parent2a0905a1f57519b0cd33594a3a7fcb3f5f860d74 (diff)
downloadTango-f0fc1abe6628c903d2e58dcd1b1a88ef43d45057.tar.gz
Tango-f0fc1abe6628c903d2e58dcd1b1a88ef43d45057.zip
add the function test_dancer_responce_RTFU .
in order to use it unmark the define test_RTFU_dancer stub : stubManager.Run<ProgressResponse>("ProgressRequest" ,0xdace, 1);// triger, direction 0 or 1
Diffstat (limited to 'Software/Embedded_SW')
-rw-r--r--Software/Embedded_SW/Embedded/DataDef.h1
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/SSI_Comm/Dancer/Dancer.c58
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/SSI_Comm/Dancer/Dancer.h3
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c12
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h2
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c18
6 files changed, 89 insertions, 5 deletions
diff --git a/Software/Embedded_SW/Embedded/DataDef.h b/Software/Embedded_SW/Embedded/DataDef.h
index 3ca1c54cc..ecd04b742 100644
--- a/Software/Embedded_SW/Embedded/DataDef.h
+++ b/Software/Embedded_SW/Embedded/DataDef.h
@@ -11,6 +11,7 @@
//#define USE_USB
#define Stub_Mode 1
#define USE_HIGH_SPEED_GPIO // to use AHB GPIO (A..J) ports A-J APB or AHB, ports K-Q on AHB only
+//#define test_RTFU_dancer 1
//#define WithTempSensorFiltrer (to use the function Filter_Temparature_Measurement)
//#define DEBUG_TEST_FUNCTIONS
#define HIZ_TIMEOUT 1000
diff --git a/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/Dancer/Dancer.c b/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/Dancer/Dancer.c
index 749fad6b0..ae814a8cb 100644
--- a/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/Dancer/Dancer.c
+++ b/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/Dancer/Dancer.c
@@ -5,7 +5,7 @@
* Author: avi
*/
-
+#include "include.h"
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
@@ -27,7 +27,8 @@
#include "drivers/FPGA/FPGA_SSI_Comm.h"
#include "PMR/Hardware/HardwareDancerType.pb-c.h"
-
+#include <driverlib/timer.h>
+#include "Modules/Control/MillisecTask.h"
extern SSI_DANCER_ENC DANCER_ENC[NUM_OF_ROTENC];
@@ -105,5 +106,58 @@ void Loop_SSI()
}
+//-----------------------------------------------------------------
+
+#include "drivers/FPGA/FPGA_SPI_Comm.h"
+bool test_dancer_direction = false, test_dancer_flag = false;
+
+void test_dancer_responce_RTFU()
+{
+ static uint32_t i = 0, FT = 0;
+
+ static uint32_t save_milisec = 0;
+
+ static uint16_t Save_start_ENC = 0;
+
+
+ if(test_dancer_flag == true)
+ {
+ i=1;
+ test_dancer_flag = false;
+ MotorDriverRequest[21].Direction = test_dancer_direction;
+ //MotorDriverRequest[21].Speed = 60;
+ //FPGA_SetMotSpeedDirect(21);//RDancer
+ MotorSetSpeed(21, 60);
+ save_milisec = msec_millisecondCounter;
+ }
+
+ if((i>0)&&(i<5000))
+ {
+ FPGA_SSI_Transmit(2);//RDancer
+ delayUs(100);
+ FPGA_SSI_Receive(2);//RDancer
+
+ if(i == 1)
+ {
+ Save_start_ENC = DANCER_ENC[2].Position;
+ }
+ if((((DANCER_ENC[2].Position - Save_start_ENC) >= 2 ) || ((Save_start_ENC - DANCER_ENC[2].Position) >= 2 )) && (FT == 0))
+ {
+ FT = 1;
+ Report("*-*-*-*-* time till movement mSec *-*-*-*-*", __FILE__, __LINE__, 0, RpMessage, (int)(/*abs*/(msec_millisecondCounter-save_milisec)), 0);
+
+ }
+
+ Report("*-*-*-*-* test_dancer_responce_RTFU *-*-*-*-*", __FILE__, __LINE__, 0, RpMessage, (int)(DANCER_ENC[2].Position), 0);
+ i=i+1;
+ }
+ else
+ {
+ i=0;
+ FT = 0;
+ //MotorDriverRequest[21].Stop = Hard_Stop;
+ //FPGA_SetMotStop(21);
+ }
+}
diff --git a/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/Dancer/Dancer.h b/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/Dancer/Dancer.h
index 8c9d8cfd7..6598b88c2 100644
--- a/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/Dancer/Dancer.h
+++ b/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/Dancer/Dancer.h
@@ -17,7 +17,10 @@ uint32_t Read_Dryer_Status(HardwareDancerType DancerId);
void Loop_SSI();
+void test_dancer_responce_RTFU(bool motor_direction);
+void test_dancer_responce_RTFU();
+extern bool test_dancer_direction, test_dancer_flag;
#endif /* DRIVERS_SSI_COMM_DANCER_DANCER_H_ */
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
index dfd01cef5..e2e006ba6 100644
--- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
+++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
@@ -490,9 +490,15 @@ uint32_t MillisecLoop(uint32_t tick)
#ifdef HUNDRED_MICROSECONDS_DANCER_READ
SaveLogData();
#else
- Dancer_Data[FEEDER_DANCER] = Read_Dancer_Position(FEEDER_DANCER);
- Dancer_Data[POOLER_DANCER] = Read_Dancer_Position(POOLER_DANCER);
- Dancer_Data[WINDER_DANCER] = Read_Dancer_Position(WINDER_DANCER);
+
+ #ifdef test_RTFU_dancer
+ test_dancer_responce_RTFU();
+ #else
+ Dancer_Data[FEEDER_DANCER] = Read_Dancer_Position(FEEDER_DANCER);
+ Dancer_Data[POOLER_DANCER] = Read_Dancer_Position(POOLER_DANCER);
+ Dancer_Data[WINDER_DANCER] = Read_Dancer_Position(WINDER_DANCER);
+ #endif
+
#endif
return OK;
}
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h
index 9335a6d08..25336f50c 100644
--- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h
+++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h
@@ -52,5 +52,7 @@ void MillisecLogClose(void);
extern bool watchdogCriticalAlarm;
+extern uint32_t Millisec_timerBase;
+
extern Task_Handle Millisecond_Task_Handle;
#endif /* MODULES_CONTROL_MILLISECTASK_H_ */
diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c
index fff8596f8..30067afa9 100644
--- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c
+++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c
@@ -86,6 +86,24 @@ void Stub_ProgressRequest(MessageContainer* requestContainer)
response.has_progress = true;
}
else
+ if(request->amount == 0xdace)//test_dancer_responce_RTFU
+ {
+ test_dancer_flag = true;
+
+ if(request->delay == 0x01)
+ {
+ test_dancer_direction = true;
+ }
+ else
+ if(request->delay == 0x00)
+ {
+ test_dancer_direction = false;
+ }
+
+ response.progress = 0xdace;
+ response.has_progress = true;
+ }
+ else
if(request->amount == 0x3EC)
{
if(request->delay == 0x01)