Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: function_utilities/function_utilities.cpp
- Revision:
- 19:23b7c1ad8683
- Parent:
- 18:b8adf1582ea3
- Child:
- 23:59218d4a256d
--- a/function_utilities/function_utilities.cpp Wed Sep 04 11:02:57 2019 +0000
+++ b/function_utilities/function_utilities.cpp Mon Sep 09 06:29:56 2019 +0000
@@ -9,6 +9,21 @@
//FlashWriter writer(6);//2부터 7까지 되는듯 아마 sector
+//int CID_RX_CMD = 100;
+//int CID_RX_REF_POSITION = 200;
+//int CID_RX_REF_TORQUE = 300;
+//int CID_RX_REF_PRES_DIFF = 400;
+//int CID_RX_REF_VOUT = 500;
+//int CID_RX_REF_VALVE_POSITION = 600;
+//int CID_RX_REF_CURRENT = 700;
+//
+//int CID_TX_INFO = 1100;
+//int CID_TX_POSITION = 1200;
+//int CID_TX_TORQUE = 1300;
+//int CID_TX_PRES = 1400;
+//int CID_TX_VOUT = 1500;
+//int CID_TX_VALVE_POSITION = 1600;
+
/*******************************************************************************
* VARIABLE
******************************************************************************/
@@ -206,13 +221,12 @@
int VALVE_POS_TMP = 0;
int JOINT_VEL_TMP = 0;
int DDV_POS_AVG = 0;
-int VALVE_POS_AVG[100] = {0};
+int VALVE_POS_AVG[50] = {0};
int VALVE_POS_AVG_OLD = 0;
int data_num = 0;
int ID_index = 0;
int DZ_index = 1;
-int ID_index_array[100] = {0};
-int FR_index_array[100] = {0};
+int ID_index_array[50] = {0};
int first_check = 0;
double init_time = 0.0;
int VEL_POINT = 0;
@@ -226,7 +240,8 @@
int one_period_end = 0;
double Ref_Vel_Test = 0.0;
long TMR2_FOR_SLOW_LOGGING = 0;
-int velcount = 0;
+//int velcount = 0;
+int Ref_Valve_Pos_FF_CAN = 0;
char max_check = 0;
char min_check = 0;
@@ -284,6 +299,8 @@
double CUR_CURRENT = 0.0;
double u_CUR[3] = {0.0,0.0,0.0};
+//int Ref_Valve_Pos_FF_CAN = 0;
+
/*******************************************************************************
* General math functions
******************************************************************************/
@@ -324,12 +341,6 @@
/*******************************************************************************
* ROM functions
******************************************************************************/
-void ROM_INIT_DATA(void)
-{
- //ROM_RESET_DATA();
- ROM_CALL_DATA();
-}
-
void ROM_RESET_DATA(void) {
FlashWriter writer(6);//2부터 7까지 되는듯 아마 sector
if (!writer.ready()) writer.open();
@@ -395,8 +406,8 @@
}
for(int i=0; i<100; i++)
{
- writer.write(RID_VALVE_POS_VS_FLOWRATE_0 + i, (int) (JOINT_VEL[ID_index] & 0xFFFF));
- writer.write(RID_VALVE_POS_VS_FLOWRATE_0_1 + i, (int) ((JOINT_VEL[ID_index] >> 16) & 0xFFFF));
+ writer.write(RID_VALVE_POS_VS_FLOWRATE_0 + i, (int) (JOINT_VEL[i] & 0xFFFF));
+ writer.write(RID_VALVE_POS_VS_FLOWRATE_0_1 + i, (int) ((JOINT_VEL[i] >> 16) & 0xFFFF));
}
writer.write(RID_VALVE_MAX_POS, (int) VALVE_MAX_POS);
writer.write(RID_VALVE_MIN_POS, (int) VALVE_MIN_POS);
@@ -550,3 +561,4 @@
}
+