Compare commits
29
Commits
f363d3afba
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a24d8e8d35 | ||
|
|
3e7060965e | ||
|
|
fd9e7f54eb | ||
|
|
f8212892a2 | ||
|
|
884d9bcca9 | ||
|
|
5af74419e0 | ||
|
|
f0b28b55fb | ||
|
|
97b8f28e70 | ||
|
|
608bbf1cfa | ||
|
|
711cb50658 | ||
|
|
746e87df86 | ||
|
|
fa24e0f109 | ||
|
|
40fdf13fd1 | ||
|
|
55cd53b746 | ||
|
|
c7c81ddb83 | ||
|
|
52f9390981 | ||
|
|
475a625663 | ||
|
|
7b36324101 | ||
|
|
c9f827661b | ||
|
|
475314f2a5 | ||
|
|
68396cb7ac | ||
|
|
688534c117 | ||
|
|
98ec0e7855 | ||
|
|
45a13b9c5d | ||
|
|
f7f3d76d9a | ||
|
|
f8985df185 | ||
|
|
fdc37dab4a | ||
|
|
cfc538bd4d | ||
|
|
da1659a582 |
@@ -1,90 +1,90 @@
|
||||
declare -A calMap
|
||||
calMap[JG01]="\{\n\
|
||||
\{ 0, 2525, -7533, -6846\}, \{ 0, 12726, -7818, -6860\},\n\
|
||||
\{ 0, 2490, -7836, -6907\}, \{ 0, 4479, -7716, -6837\},\n\
|
||||
\{ 0, 6409, -7770, -6776\}, \{ 0, 14616, -7977, -6816\},\n\
|
||||
\{ 0, -22557, -8002, -6911\}, \{ 0, -22587, -8121, -6918\},\n\
|
||||
\{ 0, -1124, -8123, -7030\}, \{ 0, -152, -8219, -7042\},\n\
|
||||
\{ 0, 1823, -8209, -7130\}, \{ 0, 1790, -8290, -7214\},\n\
|
||||
\{ 0, 1669, -8362, -7283\}, \{ 0, 1634, -8459, -7276\},\n\
|
||||
\{ 0, 1615, -8315, -7415\}, \{ 0, 1698, -8168, -7366\},\n\
|
||||
\{ 0, 1535, -8285, -7520\}, \{ 0, 1619, -8285, -7532\},\n\
|
||||
\{ 0, 1609, -8201, -7693\}, \{ 0, 1671, -8145, -7769\},\n\
|
||||
\{ 0, 1676, -8135, -7805\}, \{ 0, 951, -10279, -8871\},\n\
|
||||
\{ 0, 976, -10235, -8978\}, \{ 0, 1118, -10127, -9019\},\n\
|
||||
\{ 0, 1175, -10003, -9007\}, \{ 0, 1386, -9847, -9039\},\n\
|
||||
\{ 0, 1535, -9572, -9058\}, \{ 0, 1729, -9493, -9006\},\n\
|
||||
\{ 0, -1158, -9312, -9003\}, \{ 0, 23771, -9147, -8928\},\n\
|
||||
\{ 0, 20733, -9074, -8924\}, \{ 0, 2455, -8841, -8886\},\n\
|
||||
\{ 0, 2622, -8718, -8735\}, \{ 0, 2791, -8615, -8705\},\n\
|
||||
\{ 0, 2861, -8168, -8331\}, \{ 0, 3076, -8091, -8218\},\n\
|
||||
\{ 0, 3257, -8046, -8100\}, \{ 0, 3331, -7923, -8073\},\n\
|
||||
\{ 0, 3396, -7826, -7994\}, \{ 0, 3478, -7842, -8016\},\n\
|
||||
\{ 0, 3518, -7846, -7765\}, \{ 0, 3585, -7753, -7715\},\n\
|
||||
\{ 0, 150, -8145, -8591\}, \{ 0, 192, -8090, -8570\},\n\
|
||||
\{ 0, 207, -8150, -8597\}, \{ 0, 178, -8142, -8656\},\n\
|
||||
\{ 0, 89, -8557, -8688\}, \{ 0, 107, -8614, -8733\},\n\
|
||||
\{ 0, 194, -8605, -8782\}, \{ 0, 153, -8655, -8881\},\n\
|
||||
\{ 0, 70, -8615, -8952\}, \{ 0, 35, -8596, -9148\},\n\
|
||||
\{ 0, 49, -8636, -9286\}, \{ 0, 6, -8587, -9435\},\n\
|
||||
\{ 0, -51, -8540, -9549\}, \{ 0, -65, -8588, -9700\},\n\
|
||||
\{ 0, -55, -8503, -9820\}, \{ 0, -20, -8414, -9907\},\n\
|
||||
\{ 0, -112, -8481, -10031\}, \{ 0, -69, -8535, -10185\},\n\
|
||||
\{ 0, 2, -8550, -10052\}, \{ 0, -1, -8493, -10291\},\n\
|
||||
\{ 0, -73, -8441, -10380\}, \{ 0, 1958, -6930, -8295\},\n\
|
||||
\{ 0, -1148, -6939, -8396\}, \{ 0, 1915, -6784, -8370\},\n\
|
||||
\{ 0, 1871, -6970, -8514\}, \{ 0, 1821, -6974, -8387\},\n\
|
||||
\{ 0, 1781, -6906, -8431\}, \{ 0, 1736, -6897, -8462\},\n\
|
||||
\{ 0, 1664, -7024, -8377\}, \{ 0, 1629, -7127, -8436\},\n\
|
||||
\{ 0, 1603, -7148, -8528\}, \{ 0, 1577, -7198, -8500\},\n\
|
||||
\{ 0, 1528, -7311, -8512\}, \{ 0, 1577, -7390, -8570\},\n\
|
||||
\{ 0, 1616, -7436, -8572\}, \{ 0, 1589, -7597, -8590\},\n\
|
||||
\{ 0, 1722, -7550, -8568\}, \{ 0, 1741, -7691, -8449\},\n\
|
||||
\{ 0, 1767, -7775, -8328\}, \n\
|
||||
\{ 0, 406, -10530, -8223\}, \{ 0, 697, -9933, -7988\},\n\
|
||||
\{ 0, 296, -10497, -8272\}, \{ 0, 515, -10264, -8093\},\n\
|
||||
\{ 0, 689, -10212, -8064\}, \{ 0, 40, -10960, -8572\},\n\
|
||||
\{ 0, 722, -10878, -8518\}, \{ 0, 59, -10987, -8962\},\n\
|
||||
\{ 0, 56, -11264, -8770\}, \{ 0, -464, -11341, -9159\},\n\
|
||||
\{ 0, 19, -10924, -8887\}, \{ 0, -669, -10927, -8679\},\n\
|
||||
\{ 0, -701, -11154, -8712\}, \{ 0, -255, -10739, -8009\},\n\
|
||||
\{ 0, -192, -10509, -8242\}, \{ 0, -1057, -11183, -9007\},\n\
|
||||
\{ 0, -57, -10606, -8350\}, \{ 0, -719, -10949, -8880\},\n\
|
||||
\{ 0, -760, -11084, -8660\}, \{ 0, -457, -10735, -8833\},\n\
|
||||
\{ 0, -188, -10623, -9119\}, \{ 0, -628, -12609, -10119\},\n\
|
||||
\{ 0, -434, -12714, -10225\}, \{ 0, -727, -13074, -10685\},\n\
|
||||
\{ 0, -12, -12408, -10190\}, \{ 0, 33, -12790, -10624\},\n\
|
||||
\{ 0, 93, -13235, -10819\}, \{ 0, -363, -13301, -11183\},\n\
|
||||
\{ 0, -514, -13955, -11557\}, \{ 0, -458, -13878, -11722\},\n\
|
||||
\{ 0, 93, -13086, -11726\}, \{ 0, -663, -13597, -11868\},\n\
|
||||
\{ 0, 174, -12814, -11295\}, \{ 0, 121, -12278, -11150\},\n\
|
||||
\{ 0, 425, -11255, -10363\}, \{ 0, 430, -11645, -10189\},\n\
|
||||
\{ 0, 277, -11844, -9499\}, \{ 0, -132, -12241, -9420\},\n\
|
||||
\{ 0, 448, -11934, -9612\}, \{ 0, 200, -11778, -9582\},\n\
|
||||
\{ 0, -40, -12069, -9336\}, \{ 0, 1692, -11315, -9085\},\n\
|
||||
\{ 0, -1753, -11445, -9482\}, \{ 0, -2520, -12620, -10068\},\n\
|
||||
\{ 0, -1976, -12674, -10218\}, \{ 0, -1984, -12525, -10354\},\n\
|
||||
\{ 0, -2272, -13476, -10932\}, \{ 0, -2123, -13918, -11095\},\n\
|
||||
\{ 0, -2883, -14447, -11659\}, \{ 0, -2826, -13946, -11563\},\n\
|
||||
\{ 0, -2697, -13680, -11328\}, \{ 0, -3068, -13393, -11614\},\n\
|
||||
\{ 0, -2935, -13074, -11882\}, \{ 0, -3017, -13038, -11163\},\n\
|
||||
\{ 0, -2490, -12379, -11288\}, \{ 0, -2463, -12286, -10726\},\n\
|
||||
\{ 0, -2686, -12167, -10673\}, \{ 0, -2428, -12077, -10555\},\n\
|
||||
\{ 0, -2282, -12564, -10388\}, \{ 0, -2017, -12303, -10844\},\n\
|
||||
\{ 0, -2329, -12637, -11250\}, \{ 0, -2703, -13362, -11807\},\n\
|
||||
\{ 0, -1820, -12605, -11733\}, \{ 0, 596, -10833, -9852\},\n\
|
||||
\{ 0, 9, -11140, -9776\}, \{ 0, 41, -11168, -9478\},\n\
|
||||
\{ 0, -261, -11368, -9752\}, \{ 0, 226, -11282, -9879\},\n\
|
||||
\{ 0, -68, -11454, -10148\}, \{ 0, -314, -12278, -10716\},\n\
|
||||
\{ 0, -66, -11998, -10762\}, \{ 0, -58, -11469, -10664\},\n\
|
||||
\{ 0, 319, -10759, -10212\}, \{ 0, 122, -11041, -9901\},\n\
|
||||
\{ 0, -269, -11085, -10008\}, \{ 0, 637, -10569, -9674\},\n\
|
||||
\{ 0, 1185, -10632, -9521\}, \{ 0, 902, -11053, -9681\},\n\
|
||||
\{ 0, 560, -11408, -9588\}, \{ 0, 1162, -11079, -9371\},\n\
|
||||
\{ 0, 1780, -10547, -9133\}, \n\
|
||||
};"
|
||||
|
||||
calMap[JG02]="\{\n\
|
||||
\{ 0, 1573, -6646, -6900\}, \{ 0, 1251, -7021, -7119\},\n\
|
||||
\{ 0, 1157, -7139, -7184\}, \{ 0, 970, -7380, -7280\},\n\
|
||||
\{ 0, 803, -7646, -7340\}, \{ 0, 243, -7702, -7475\},\n\
|
||||
\{ 0, 116, -7899, -7666\}, \{ 0, 345, -7915, -7779\},\n\
|
||||
\{ 0, 257, -8072, -7835\}, \{ 0, 63, -8061, -7871\},\n\
|
||||
\{ 0, -40, -8151, -7949\}, \{ 0, -144, -8363, -8066\},\n\
|
||||
\{ 0, -184, -8320, -8111\}, \{ 0, -360, -8458, -8205\},\n\
|
||||
\{ 0, -426, -8583, -8238\}, \{ 0, -444, -8534, -8338\},\n\
|
||||
\{ 0, -451, -8508, -8371\}, \{ 0, -610, -8581, -8378\},\n\
|
||||
\{ 0, -605, -8582, -8381\}, \{ 0, -1401, -8503, -8391\},\n\
|
||||
\{ 0, -2160, -8656, -8346\}, \{ 0, 243, -9749, -9637\},\n\
|
||||
\{ 0, -503, -9663, -9572\}, \{ 0, -444, -9526, -9554\},\n\
|
||||
\{ 0, -495, -9581, -9559\}, \{ 0, -463, -9515, -9427\},\n\
|
||||
\{ 0, -1209, -9399, -9343\}, \{ 0, -356, -9263, -9275\},\n\
|
||||
\{ 0, -200, -9145, -9160\}, \{ 0, -110, -9062, -9013\},\n\
|
||||
\{ 0, -165, -9138, -8950\}, \{ 0, -104, -9094, -8849\},\n\
|
||||
\{ 0, -744, -9062, -8679\}, \{ 0, -743, -9084, -8557\},\n\
|
||||
\{ 0, -613, -8622, -8069\}, \{ 0, -492, -8651, -7949\},\n\
|
||||
\{ 0, 76, -8666, -7826\}, \{ 0, 362, -8890, -7855\},\n\
|
||||
\{ 0, -204, -8686, -7668\}, \{ 0, -305, -8955, -7710\},\n\
|
||||
\{ 0, -199, -8941, -7435\}, \{ 0, -141, -8992, -7377\},\n\
|
||||
\{ 0, -1015, -8907, -7741\}, \{ 0, -886, -8961, -7784\},\n\
|
||||
\{ 0, -594, -9151, -7921\}, \{ 0, -875, -9062, -7860\},\n\
|
||||
\{ 0, -1280, -9528, -7885\}, \{ 0, -379, -9555, -8104\},\n\
|
||||
\{ 0, -291, -9633, -8172\}, \{ 0, -1145, -9625, -8226\},\n\
|
||||
\{ 0, -1437, -9653, -8314\}, \{ 0, -1372, -9610, -8489\},\n\
|
||||
\{ 0, -208, -9649, -8693\}, \{ 0, -202, -9527, -8755\},\n\
|
||||
\{ 0, 120, -9542, -8873\}, \{ 0, 126, -9448, -9003\},\n\
|
||||
\{ 0, 167, -9519, -9142\}, \{ 0, 459, -9523, -9194\},\n\
|
||||
\{ 0, 41, -9266, -9117\}, \{ 0, 189, -9303, -9236\},\n\
|
||||
\{ 0, 7, -9305, -9289\}, \{ 0, -32, -9342, -9391\},\n\
|
||||
\{ 0, -106, -9252, -9433\}, \{ 0, -195, -9450, -7698\},\n\
|
||||
\{ 0, -84, -9434, -7715\}, \{ 0, 126, -9365, -7699\},\n\
|
||||
\{ 0, 244, -9474, -7798\}, \{ 0, 112, -9616, -7895\},\n\
|
||||
\{ 0, 514, -9631, -7921\}, \{ 0, 468, -9609, -7939\},\n\
|
||||
\{ 0, -209, -9770, -7983\}, \{ 0, -329, -9925, -8028\},\n\
|
||||
\{ 0, -845, -9918, -8117\}, \{ 0, 44, -9921, -8106\},\n\
|
||||
\{ 0, 251, -10042, -8254\}, \{ 0, 277, -10008, -8327\},\n\
|
||||
\{ 0, 737, -10139, -8391\}, \{ 0, 1260, -10272, -8496\},\n\
|
||||
\{ 0, -17449, -10172, -8508\}, \{ 0, -6484, -10284, -8635\},\n\
|
||||
\{ 0, 541, -10256, -8560\}, \n\
|
||||
\{ 0, 509, -2785, -4375\}, \{ 0, 655, -3482, -4447\},\n\
|
||||
\{ 0, 520, -3231, -4651\}, \{ 0, 680, -3122, -4790\},\n\
|
||||
\{ 0, 328, -3648, -4712\}, \{ 0, 260, -3454, -4515\},\n\
|
||||
\{ 0, 433, -3027, -4446\}, \{ 0, 34, -4304, -4676\},\n\
|
||||
\{ 0, 54, -3707, -4650\}, \{ 0, -19, -3829, -5231\},\n\
|
||||
\{ 0, -156, -4018, -5292\}, \{ 0, -331, -4155, -5423\},\n\
|
||||
\{ 0, -424, -4210, -5207\}, \{ 0, -592, -4131, -5572\},\n\
|
||||
\{ 0, -494, -4135, -5732\}, \{ 0, -687, -4055, -5030\},\n\
|
||||
\{ 0, -1000, -4456, -5228\}, \{ 0, -337, -3931, -5340\},\n\
|
||||
\{ 0, -168, -3962, -5326\}, \{ 0, -852, -4534, -5798\},\n\
|
||||
\{ 0, -541, -4458, -5156\}, \{ 0, -842, -5570, -6166\},\n\
|
||||
\{ 0, -1490, -5883, -6645\}, \{ 0, -1036, -5917, -6151\},\n\
|
||||
\{ 0, -1369, -5946, -5969\}, \{ 0, -916, -5927, -6200\},\n\
|
||||
\{ 0, -521, -5595, -6066\}, \{ 0, -823, -5731, -5925\},\n\
|
||||
\{ 0, -262, -5267, -5315\}, \{ 0, -697, -5434, -5676\},\n\
|
||||
\{ 0, -362, -5193, -4887\}, \{ 0, -430, -5147, -4911\},\n\
|
||||
\{ 0, -94, -5403, -5159\}, \{ 0, -747, -5796, -4772\},\n\
|
||||
\{ 0, -679, -4909, -4531\}, \{ 0, -500, -5364, -4694\},\n\
|
||||
\{ 0, -147, -5225, -4463\}, \{ 0, -283, -5815, -4360\},\n\
|
||||
\{ 0, -724, -6148, -4647\}, \{ 0, -295, -6069, -4375\},\n\
|
||||
\{ 0, -397, -6086, -4105\}, \{ 0, -116, -6343, -4698\},\n\
|
||||
\{ 0, -589, -6398, -5353\}, \{ 0, -1068, -6640, -5014\},\n\
|
||||
\{ 0, -785, -7017, -5093\}, \{ 0, -29, -6238, -5186\},\n\
|
||||
\{ 0, 380, -6370, -5063\}, \{ 0, -239, -7191, -5605\},\n\
|
||||
\{ 0, 321, -7256, -5177\}, \{ 0, 430, -6673, -4887\},\n\
|
||||
\{ 0, 226, -7136, -5687\}, \{ 0, 142, -7175, -5498\},\n\
|
||||
\{ 0, 333, -6596, -5434\}, \{ 0, 315, -6574, -5520\},\n\
|
||||
\{ 0, -109, -6681, -5798\}, \{ 0, -587, -7290, -5748\},\n\
|
||||
\{ 0, -229, -7105, -5463\}, \{ 0, -480, -7092, -6033\},\n\
|
||||
\{ 0, -1162, -7488, -6578\}, \{ 0, -1244, -8230, -6838\},\n\
|
||||
\{ 0, -941, -7941, -6976\}, \{ 0, -1181, -7816, -6868\},\n\
|
||||
\{ 0, -1792, -8128, -6590\}, \{ 0, -644, -7614, -4524\},\n\
|
||||
\{ 0, -873, -7358, -3775\}, \{ 0, -1250, -7370, -4506\},\n\
|
||||
\{ 0, -819, -7520, -4500\}, \{ 0, -1579, -8679, -4626\},\n\
|
||||
\{ 0, -1332, -7353, -4338\}, \{ 0, -1128, -7821, -5030\},\n\
|
||||
\{ 0, -927, -7988, -4954\}, \{ 0, -2035, -7884, -5097\},\n\
|
||||
\{ 0, -2533, -8953, -6171\}, \{ 0, -1576, -8029, -5542\},\n\
|
||||
\{ 0, -1185, -7297, -5523\}, \{ 0, -2139, -8830, -6236\},\n\
|
||||
\{ 0, -2137, -8976, -6225\}, \{ 0, -1387, -8252, -6043\},\n\
|
||||
\{ 0, -1139, -8286, -5988\}, \{ 0, -1252, -8224, -6388\},\n\
|
||||
\{ 0, -1617, -8211, -5983\}, \n\
|
||||
};"
|
||||
|
||||
calMap[JG03]="\{\n\
|
||||
@@ -173,4 +173,269 @@ calMap[JG05]="\{\n\
|
||||
\{ 0, 2739, -6557, 11185\}, \{ 0, 2815, -6469, 11256\},\n\
|
||||
\{ 0, 2849, -6807, 11103\}, \{ 0, 2850, -6769, 11097\},\n\
|
||||
\{ 0, 2923, -6999, 11232\}, \n\
|
||||
};"
|
||||
};"
|
||||
|
||||
calMap[JG06]="\{\n\
|
||||
\{ 0, -3836, -1067, 4891\}, \{ 0, -4831, -2098, 4103\},\n\
|
||||
\{ 0, -4849, -1871, 4566\}, \{ 0, -4534, -1666, 4512\},\n\
|
||||
\{ 0, -5764, -2767, 4245\}, \{ 0, -5591, -2123, 4174\},\n\
|
||||
\{ 0, -4727, -1565, 4368\}, \{ 0, -5834, -2262, 3942\},\n\
|
||||
\{ 0, -5421, -2062, 3790\}, \{ 0, -4996, -1380, 4260\},\n\
|
||||
\{ 0, -5538, -1861, 3494\}, \{ 0, -5272, -1652, 3740\},\n\
|
||||
\{ 0, -5561, -1802, 4038\}, \{ 0, -5320, -1734, 3742\},\n\
|
||||
\{ 0, -4354, -1230, 4170\}, \{ 0, -5705, -1862, 3840\},\n\
|
||||
\{ 0, -6223, -2211, 3218\}, \{ 0, -5048, -1596, 3669\},\n\
|
||||
\{ 0, -5235, -1541, 3735\}, \{ 0, -6009, -2219, 3301\},\n\
|
||||
\{ 0, -5545, -1879, 3686\}, \{ 0, -7174, -2853, -434\},\n\
|
||||
\{ 0, -6759, -3117, 56\}, \{ 0, -7376, -3291, 221\},\n\
|
||||
\{ 0, -7601, -3243, 150\}, \{ 0, -7065, -2752, -42\},\n\
|
||||
\{ 0, -7701, -2828, -144\}, \{ 0, -7598, -3002, 464\},\n\
|
||||
\{ 0, -7312, -2476, 399\}, \{ 0, -7939, -2374, -62\},\n\
|
||||
\{ 0, -7622, -2213, 482\}, \{ 0, -6715, -1688, 1033\},\n\
|
||||
\{ 0, -6755, -1445, 722\}, \{ 0, -6817, -1385, 1061\},\n\
|
||||
\{ 0, -6155, -864, 1431\}, \{ 0, -6700, -1746, 1070\},\n\
|
||||
\{ 0, -6973, -1127, 835\}, \{ 0, -6456, -1152, 686\},\n\
|
||||
\{ 0, -6542, -1505, 1059\}, \{ 0, -6659, -1374, 584\},\n\
|
||||
\{ 0, -6605, -983, 630\}, \{ 0, -6366, -1046, 800\},\n\
|
||||
\{ 0, -4668, 343, 1086\}, \{ 0, -5072, 560, 468\},\n\
|
||||
\{ 0, -4124, 1399, 1284\}, \{ 0, -3465, 10068, 22599\},\n\
|
||||
\{ 0, -4167, 2018, 1119\}, \{ 0, -4910, 1612, 717\},\n\
|
||||
\{ 0, -4917, 1600, 968\}, \{ 0, -4171, 1731, 430\},\n\
|
||||
\{ 0, -3432, 13873, 166\}, \{ 0, -3571, 2840, 870\},\n\
|
||||
\{ 0, -3060, 2468, 463\}, \{ 0, -2858, 2369, 373\},\n\
|
||||
\{ 0, -2948, 3186, 438\}, \{ 0, -3305, 2984, -160\},\n\
|
||||
\{ 0, -2027, 3128, -798\}, \{ 0, -2663, 3320, -865\},\n\
|
||||
\{ 0, -3992, -562, -1509\}, \{ 0, -2913, 2844, -1081\},\n\
|
||||
\{ 0, -3205, 3373, -1418\}, \{ 0, -3366, 3063, -1645\},\n\
|
||||
\{ 0, -3878, 2873, -920\}, \{ 0, -1801, 6168, 2384\},\n\
|
||||
\{ 0, -1252, 6409, 2308\}, \{ 0, -1724, 6027, 2474\},\n\
|
||||
\{ 0, -1937, 5849, 2730\}, \{ 0, -1921, 5622, 2349\},\n\
|
||||
\{ 0, -2162, 5995, -1804\}, \{ 0, -1707, 6306, 2744\},\n\
|
||||
\{ 0, -1334, 5651, 3112\}, \{ 0, -2132, 5216, 2588\},\n\
|
||||
\{ 0, -1878, 5912, 2448\}, \{ 0, -1233, 5205, 2467\},\n\
|
||||
\{ 0, -1139, 5350, 2967\}, \{ 0, -2373, 5368, -23580\},\n\
|
||||
\{ 0, -1706, 5450, 2374\}, \{ 0, -1718, 5876, 2333\},\n\
|
||||
\{ 0, -1569, 5961, 2570\}, \{ 0, -1177, 6423, 2665\},\n\
|
||||
\{ 0, -1210, 5976, 2608\}, \n\
|
||||
};"
|
||||
|
||||
calMap[LJ01]="\{\n\
|
||||
\{ 0, 5716, -1041, -12697\}, \{ 0, 5110, -1450, -13222\},\n\
|
||||
\{ 0, 4487, -1630, -13282\}, \{ 0, 4606, -1821, -13197\},\n\
|
||||
\{ 0, 4663, -2299, -13302\}, \{ 0, 4092, -2324, -13451\},\n\
|
||||
\{ 0, 4233, -2419, -13189\}, \{ 0, 3702, -2961, -14147\},\n\
|
||||
\{ 0, 3167, -3408, -14660\}, \{ 0, 3564, -3255, -13877\},\n\
|
||||
\{ 0, 3320, -3407, -13671\}, \{ 0, 3137, -3350, -13820\},\n\
|
||||
\{ 0, 3342, -3703, -13808\}, \{ 0, 3519, -3970, -14069\},\n\
|
||||
\{ 0, 2983, -4415, -14335\}, \{ 0, 3636, -3825, -13840\},\n\
|
||||
\{ 0, 3461, -3922, -14323\}, \{ 0, 3419, -4022, -14031\},\n\
|
||||
\{ 0, 3763, -4066, -13832\}, \{ 0, 3929, -3504, -13827\},\n\
|
||||
\{ 0, 3634, -4035, -14096\}, \{ 0, 3195, -6232, -14808\},\n\
|
||||
\{ 0, 3428, -6179, -14913\}, \{ 0, 3506, -5525, -14510\},\n\
|
||||
\{ 0, 3754, -5724, -14134\}, \{ 0, 3630, -5791, -14743\},\n\
|
||||
\{ 0, 3857, -5548, -14269\}, \{ 0, 4654, -4964, -13701\},\n\
|
||||
\{ 0, 4853, -4388, -13822\}, \{ 0, 4735, -4632, -13864\},\n\
|
||||
\{ 0, 4981, -4381, -13979\}, \{ 0, 5528, -3984, -13626\},\n\
|
||||
\{ 0, 5130, -4326, -13639\}, \{ 0, 5095, -3792, -13638\},\n\
|
||||
\{ 0, 5346, -3366, -13030\}, \{ 0, 5498, -3496, -13682\},\n\
|
||||
\{ 0, 5144, -3120, -13986\}, \{ 0, 5427, -2871, -12931\},\n\
|
||||
\{ 0, 5939, -2824, -12646\}, \{ 0, 6030, -2983, -12662\},\n\
|
||||
\{ 0, 5959, -3142, -12116\}, \{ 0, 5903, -2700, -11731\},\n\
|
||||
\{ 0, 6256, -3546, -10932\}, \{ 0, 6384, -3767, -11326\},\n\
|
||||
\{ 0, 6086, -3399, -11769\}, \{ 0, 5915, -3257, -12066\},\n\
|
||||
\{ 0, 6257, -4021, -12273\}, \{ 0, 6084, -4192, -12153\},\n\
|
||||
\{ 0, 5482, -4102, -12637\}, \{ 0, 5836, -3698, -12767\},\n\
|
||||
\{ 0, 6025, -4014, -13219\}, \{ 0, 5713, -3812, -14315\},\n\
|
||||
\{ 0, 5997, -3855, -14788\}, \{ 0, 5866, -3905, -15408\},\n\
|
||||
\{ 0, 5328, -4627, -16458\}, \{ 0, 5686, -3646, -14885\},\n\
|
||||
\{ 0, 5551, -3407, -15112\}, \{ 0, 5720, -3165, -14247\},\n\
|
||||
\{ 0, 6044, -3818, -14224\}, \{ 0, 5963, -3342, -14531\},\n\
|
||||
\{ 0, 6128, -3225, -13495\}, \{ 0, 6564, -3662, -13408\},\n\
|
||||
\{ 0, 6000, -3479, -13609\}, \{ 0, 5876, -3190, -11817\},\n\
|
||||
\{ 0, 7165, -2876, -10874\}, \{ 0, 6593, -4000, -11565\},\n\
|
||||
\{ 0, 6207, -3694, -11278\}, \{ 0, 6732, -2326, -11167\},\n\
|
||||
\{ 0, 6335, -3650, -11508\}, \{ 0, 6220, -4220, -12438\},\n\
|
||||
\{ 0, 6069, -3838, -12545\}, \{ 0, 6182, -4635, -12472\},\n\
|
||||
\{ 0, 5696, -4834, -12334\}, \{ 0, 6047, -4121, -11691\},\n\
|
||||
\{ 0, 6324, -4125, -10980\}, \{ 0, 6102, -3923, -10939\},\n\
|
||||
\{ 0, 6091, -3829, -10736\}, \{ 0, 5858, -4001, -10473\},\n\
|
||||
\{ 0, 5473, -4773, -11209\}, \{ 0, 6045, -4642, -10361\},\n\
|
||||
\{ 0, 5494, -4391, -10203\}, \n\
|
||||
};"
|
||||
|
||||
calMap[LJ02]="\{\n\
|
||||
\{ 0, -726, 598, -2561\}, \{ 0, -743, 864, -2549\},\n\
|
||||
\{ 0, -769, 992, -2477\}, \{ 0, -905, 665, -2742\},\n\
|
||||
\{ 0, -944, 665, -2710\}, \{ 0, -1180, 727, -2794\},\n\
|
||||
\{ 0, -1012, 642, -2599\}, \{ 0, -1195, 690, -2770\},\n\
|
||||
\{ 0, -1191, 667, -2846\}, \{ 0, -1173, 684, -2759\},\n\
|
||||
\{ 0, -1158, 708, -2795\}, \{ 0, -1072, 678, -2852\},\n\
|
||||
\{ 0, -1175, 872, -2747\}, \{ 0, -1011, 862, -2673\},\n\
|
||||
\{ 0, -1086, 755, -2927\}, \{ 0, -1042, 1076, -2731\},\n\
|
||||
\{ 0, -1042, 914, -2765\}, \{ 0, -758, 1182, -2443\},\n\
|
||||
\{ 0, -757, 1219, -2500\}, \{ 0, -534, 1472, -2295\},\n\
|
||||
\{ 0, -497, 1543, -2104\}, \{ 0, -1267, -632, -3273\},\n\
|
||||
\{ 0, -1133, -761, -3048\}, \{ 0, -1065, -375, -2952\},\n\
|
||||
\{ 0, -722, -133, -2551\}, \{ 0, -586, 52, -2505\},\n\
|
||||
\{ 0, -546, 67, -2219\}, \{ 0, -477, 177, -2017\},\n\
|
||||
\{ 0, -317, 317, -1888\}, \{ 0, -161, 364, -1712\},\n\
|
||||
\{ 0, 5, 359, -1770\}, \{ 0, -283, 214, -1901\},\n\
|
||||
\{ 0, -59, 353, -1551\}, \{ 0, 108, 454, -1465\},\n\
|
||||
\{ 0, -74, 796, -1225\}, \{ 0, 41, 685, -1221\},\n\
|
||||
\{ 0, 84, 576, -1318\}, \{ 0, 14, 504, -1313\},\n\
|
||||
\{ 0, 37, 448, -1301\}, \{ 0, 18, 344, -1408\},\n\
|
||||
\{ 0, -70, 240, -1384\}, \{ 0, -27, 186, -1595\},\n\
|
||||
\{ 0, 622, 981, -855\}, \{ 0, 351, 889, -1188\},\n\
|
||||
\{ 0, 475, 758, -1328\}, \{ 0, 305, 1025, -1222\},\n\
|
||||
\{ 0, 526, 609, -1397\}, \{ 0, 398, 426, -1695\},\n\
|
||||
\{ 0, 237, 543, -1835\}, \{ 0, 357, 739, -1747\},\n\
|
||||
\{ 0, 400, 699, -1834\}, \{ 0, 319, 943, -1998\},\n\
|
||||
\{ 0, 244, 783, -2197\}, \{ 0, 249, 976, -2195\},\n\
|
||||
\{ 0, 266, 859, -2406\}, \{ 0, 332, 959, -2477\},\n\
|
||||
\{ 0, 225, 968, -2554\}, \{ 0, 97, 808, -2815\},\n\
|
||||
\{ 0, 73, 895, -2852\}, \{ 0, -155, 877, -2986\},\n\
|
||||
\{ 0, -71, 914, -2943\}, \{ 0, -232, 862, -2966\},\n\
|
||||
\{ 0, -347, 772, -3176\}, \{ 0, 675, 250, -956\},\n\
|
||||
\{ 0, 589, 204, -935\}, \{ 0, 459, 110, -867\},\n\
|
||||
\{ 0, 149, -88, -1251\}, \{ 0, 272, -145, -930\},\n\
|
||||
\{ 0, 304, -62, -857\}, \{ 0, 24, -487, -1384\},\n\
|
||||
\{ 0, 51, -31, -984\}, \{ 0, 154, -77, -992\},\n\
|
||||
\{ 0, -23, -238, -1234\}, \{ 0, 28, -331, -1323\},\n\
|
||||
\{ 0, 104, -415, -1424\}, \{ 0, -177, -633, -1704\},\n\
|
||||
\{ 0, 21, -514, -1572\}, \{ 0, 210, -796, -1584\},\n\
|
||||
\{ 0, 133, -693, -1782\}, \{ 0, 161, -882, -1824\},\n\
|
||||
\{ 0, 118, -1098, -1994\}, \n\
|
||||
};"
|
||||
|
||||
calMap[LJ03]="\{\n\
|
||||
\{ 0, 13063, -4747, -10433\}, \{ 0, 3443, -4140, -9849\},\n\
|
||||
\{ 0, 7069, -4629, -10540\}, \{ 0, 13946, -4544, -10775\},\n\
|
||||
\{ 0, 12968, -4307, -10347\}, \{ 0, 20281, -5019, -11282\},\n\
|
||||
\{ 0, 22661, -5079, -11148\}, \{ 0, 16734, -4442, -10374\},\n\
|
||||
\{ 0, 15423, -4074, -10422\}, \{ 0, 22851, -4441, -10405\},\n\
|
||||
\{ 0, 14291, -3978, -9960\}, \{ 0, 4367, -3954, -9810\},\n\
|
||||
\{ 0, 11785, -3957, -10150\}, \{ 0, 3218, -3775, -9825\},\n\
|
||||
\{ 0, 3344, -3314, -9254\}, \{ 0, 6873, -3528, -9614\},\n\
|
||||
\{ 0, 3630, -3230, -9069\}, \{ 0, 3442, -3275, -9653\},\n\
|
||||
\{ 0, 3346, -3858, -9895\}, \{ 0, 3721, -3391, -9296\},\n\
|
||||
\{ 0, 3261, -3428, -9383\}, \{ 0, -24770, -8031, -10490\},\n\
|
||||
\{ 0, -24608, -7690, -10198\}, \{ 0, -24868, -7897, -9937\},\n\
|
||||
\{ 0, -24880, -7994, -10295\}, \{ 0, -24908, -7089, -10312\},\n\
|
||||
\{ 0, -24547, -7588, -10044\}, \{ 0, -24905, -8076, -9985\},\n\
|
||||
\{ 0, -24646, -7229, -9709\}, \{ 0, -24916, -7800, -10193\},\n\
|
||||
\{ 0, -25334, -8019, -10733\}, \{ 0, -24839, -7637, -10037\},\n\
|
||||
\{ 0, -25020, -7138, -9907\}, \{ 0, -24502, -7503, -10369\},\n\
|
||||
\{ 0, -24471, -7222, -10546\}, \{ 0, -24537, -7066, -10359\},\n\
|
||||
\{ 0, -24407, -6616, -9797\}, \{ 0, -23898, -7370, -10755\},\n\
|
||||
\{ 0, -24587, -7630, -10656\}, \{ 0, -24411, -7258, -11072\},\n\
|
||||
\{ 0, -24028, -7203, -10471\}, \{ 0, -24139, -7585, -10014\},\n\
|
||||
\{ 0, -23817, -6456, -10002\}, \{ 0, -24122, -6453, -10354\},\n\
|
||||
\{ 0, 25236, -6345, -9380\}, \{ 0, 25260, -6144, -9727\},\n\
|
||||
\{ 0, -25031, -6591, -10264\}, \{ 0, 11624, -6478, -10071\},\n\
|
||||
\{ 0, 11896, -5407, -9780\}, \{ 0, 14144, -5554, -10328\},\n\
|
||||
\{ 0, 5556, -5558, -10775\}, \{ 0, 3406, -5945, -10115\},\n\
|
||||
\{ 0, 3384, -5384, -10050\}, \{ 0, 3263, -4468, -9634\},\n\
|
||||
\{ 0, 5991, -4734, -9494\}, \{ 0, 3953, -5377, -10430\},\n\
|
||||
\{ 0, 4514, -3687, -9547\}, \{ 0, 4487, -3691, -9332\},\n\
|
||||
\{ 0, 5085, -4417, -9657\}, \{ 0, 5222, -3694, -9115\},\n\
|
||||
\{ 0, 4960, -4086, -8862\}, \{ 0, 4994, -4292, -9127\},\n\
|
||||
\{ 0, 5162, -4509, -8554\}, \{ 0, 4337, -5390, -8443\},\n\
|
||||
\{ 0, 4628, -4976, -9047\}, \{ 0, 4293, -4876, -9218\},\n\
|
||||
\{ 0, 4465, -5352, -9014\}, \{ 0, 4428, -4936, -9521\},\n\
|
||||
\{ 0, 4048, -5497, -9795\}, \{ 0, 4290, -6034, -9032\},\n\
|
||||
\{ 0, 4184, -4996, -8434\}, \{ 0, 3950, -4983, -8474\},\n\
|
||||
\{ 0, 4247, -4407, -7955\}, \{ 0, 4386, -4769, -8079\},\n\
|
||||
\{ 0, 4311, -5367, -8478\}, \{ 0, 4283, -4809, -8025\},\n\
|
||||
\{ 0, 3885, -4011, -7495\}, \{ 0, 3885, -4593, -7577\},\n\
|
||||
\{ 0, 3622, -5239, -8157\}, \{ 0, 3576, -5007, -7816\},\n\
|
||||
\{ 0, 3778, -3793, -7362\}, \n\
|
||||
};"
|
||||
|
||||
calMap[LJ04]="\{\n\
|
||||
\{ 0, -3188, -5668, -7029\}, \{ 0, -3144, -5592, -6708\},\n\
|
||||
\{ 0, -3332, -5859, -7135\}, \{ 0, -3402, -5694, -6908\},\n\
|
||||
\{ 0, -3376, -5858, -7070\}, \{ 0, -3383, -5474, -6886\},\n\
|
||||
\{ 0, -3518, -5487, -6925\}, \{ 0, -3383, -5342, -6659\},\n\
|
||||
\{ 0, -3487, -5535, -6848\}, \{ 0, -3472, -5206, -6576\},\n\
|
||||
\{ 0, -3432, -5335, -6581\}, \{ 0, -3502, -5071, -6421\},\n\
|
||||
\{ 0, -3549, -5020, -6390\}, \{ 0, -3618, -4961, -6310\},\n\
|
||||
\{ 0, -3774, -4938, -6377\}, \{ 0, -3868, -5039, -6488\},\n\
|
||||
\{ 0, -3865, -4778, -6328\}, \{ 0, -3812, -4602, -6360\},\n\
|
||||
\{ 0, -3990, -4498, -6189\}, \{ 0, -3820, -4493, -6070\},\n\
|
||||
\{ 0, -3793, -4262, -5963\}, \{ 0, -4355, -5745, -6648\},\n\
|
||||
\{ 0, -4372, -5742, -6633\}, \{ 0, -4458, -5618, -6650\},\n\
|
||||
\{ 0, -4484, -5695, -6732\}, \{ 0, -4367, -5513, -6642\},\n\
|
||||
\{ 0, -4433, -5498, -6628\}, \{ 0, -4364, -5480, -6563\},\n\
|
||||
\{ 0, -4344, -5382, -6497\}, \{ 0, -4255, -5470, -6465\},\n\
|
||||
\{ 0, -4154, -5145, -6183\}, \{ 0, -4211, -5200, -6136\},\n\
|
||||
\{ 0, -4086, -5205, -6195\}, \{ 0, -4113, -5261, -6338\},\n\
|
||||
\{ 0, -4069, -4832, -5831\}, \{ 0, -3835, -4826, -5801\},\n\
|
||||
\{ 0, -4030, -5011, -6065\}, \{ 0, -3711, -4838, -5795\},\n\
|
||||
\{ 0, -3644, -4881, -5899\}, \{ 0, -3507, -4813, -5800\},\n\
|
||||
\{ 0, -3453, -4947, -5520\}, \{ 0, -3374, -4954, -5642\},\n\
|
||||
\{ 0, -4837, -5736, -7500\}, \{ 0, -4470, -5620, -7385\},\n\
|
||||
\{ 0, -4401, -5408, -7370\}, \{ 0, -4271, -5626, -7496\},\n\
|
||||
\{ 0, -4286, -5828, -7556\}, \{ 0, -4184, -5982, -7565\},\n\
|
||||
\{ 0, -3923, -5491, -7415\}, \{ 0, -3926, -5554, -7685\},\n\
|
||||
\{ 0, -3657, -5235, -7542\}, \{ 0, -3530, -5104, -7717\},\n\
|
||||
\{ 0, -3370, -4853, -7737\}, \{ 0, -3224, -4703, -7679\},\n\
|
||||
\{ 0, -3100, -4620, -7733\}, \{ 0, -3010, -4547, -7648\},\n\
|
||||
\{ 0, -2838, -4318, -7619\}, \{ 0, -2907, -4260, -7604\},\n\
|
||||
\{ 0, -2883, -4306, -7768\}, \{ 0, -2878, -3949, -7601\},\n\
|
||||
\{ 0, -2927, -4097, -7840\}, \{ 0, -2816, -3790, -7544\},\n\
|
||||
\{ 0, -2853, -3654, -7534\}, \{ 0, -2052, -2142, -3986\},\n\
|
||||
\{ 0, -2109, -2259, -4027\}, \{ 0, -2132, -2002, -3745\},\n\
|
||||
\{ 0, -2275, -2181, -3810\}, \{ 0, -2353, -1951, -3419\},\n\
|
||||
\{ 0, -2428, -2046, -3391\}, \{ 0, -2537, -1974, -3301\},\n\
|
||||
\{ 0, -2568, -1805, -3074\}, \{ 0, -2764, -1930, -3068\},\n\
|
||||
\{ 0, -2793, -1922, -2816\}, \{ 0, -2931, -2060, -2982\},\n\
|
||||
\{ 0, -3118, -2158, -2858\}, \{ 0, -3370, -2240, -3088\},\n\
|
||||
\{ 0, -3411, -2369, -3055\}, \{ 0, -3867, -2590, -3016\},\n\
|
||||
\{ 0, -3965, -2696, -3099\}, \{ 0, -4112, -2907, -3438\},\n\
|
||||
\{ 0, -4226, -2747, -3341\}, \n\
|
||||
};"
|
||||
|
||||
calMap[LJ06]="\{\n\
|
||||
\{ 0, -4989, -7102, -2178\}, \{ 0, -5092, -7204, -2325\},\n\
|
||||
\{ 0, -4959, -7013, -2137\}, \{ 0, -4960, -6784, -1920\},\n\
|
||||
\{ 0, -5025, -6734, -2104\}, \{ 0, -5181, -6637, -2017\},\n\
|
||||
\{ 0, -5262, -6792, -2110\}, \{ 0, -5362, -6621, -2110\},\n\
|
||||
\{ 0, -5258, -6451, -2031\}, \{ 0, -5375, -6390, -2064\},\n\
|
||||
\{ 0, -5280, -6288, -2052\}, \{ 0, -5445, -6434, -2101\},\n\
|
||||
\{ 0, -5553, -6402, -2272\}, \{ 0, -5603, -6628, -2477\},\n\
|
||||
\{ 0, -5661, -6626, -2492\}, \{ 0, -5731, -6618, -2616\},\n\
|
||||
\{ 0, -5746, -6626, -2664\}, \{ 0, -6007, -7024, -2951\},\n\
|
||||
\{ 0, -6018, -7010, -2969\}, \{ 0, -5746, -6939, -2833\},\n\
|
||||
\{ 0, -5770, -7034, -3026\}, \{ 0, -8509, -8777, -6863\},\n\
|
||||
\{ 0, -8593, -9060, -6868\}, \{ 0, -8514, -9104, -6795\},\n\
|
||||
\{ 0, -8401, -9387, -6931\}, \{ 0, -8236, -9191, -6586\},\n\
|
||||
\{ 0, -8155, -9371, -6595\}, \{ 0, -8192, -9551, -6363\},\n\
|
||||
\{ 0, -7995, -9550, -6185\}, \{ 0, -7968, -9690, -6220\},\n\
|
||||
\{ 0, -7826, -9694, -6052\}, \{ 0, -7694, -9660, -5763\},\n\
|
||||
\{ 0, -7857, -10020, -5947\}, \{ 0, -7543, -9682, -5463\},\n\
|
||||
\{ 0, -7184, -9071, -4747\}, \{ 0, -7282, -9220, -4767\},\n\
|
||||
\{ 0, -7417, -9371, -4765\}, \{ 0, -7238, -9321, -4430\},\n\
|
||||
\{ 0, -7320, -9420, -4560\}, \{ 0, -7254, -9185, -4270\},\n\
|
||||
\{ 0, -7378, -9262, -4324\}, \{ 0, -7078, -9074, -3976\},\n\
|
||||
\{ 0, -10047, -10956, -7258\}, \{ 0, -10107, -10961, -7192\},\n\
|
||||
\{ 0, -10264, -11167, -7427\}, \{ 0, -10160, -10823, -7282\},\n\
|
||||
\{ 0, -10276, -11378, -7508\}, \{ 0, -10576, -11282, -7688\},\n\
|
||||
\{ 0, -10801, -11460, -7845\}, \{ 0, -10822, -10983, -7809\},\n\
|
||||
\{ 0, -10947, -10998, -8018\}, \{ 0, -11215, -10876, -8255\},\n\
|
||||
\{ 0, -11247, -10590, -8188\}, \{ 0, -11302, -10269, -8237\},\n\
|
||||
\{ 0, -11583, -10213, -8413\}, \{ 0, -11561, -10001, -8448\},\n\
|
||||
\{ 0, -11482, -9425, -8273\}, \{ 0, -11573, -9203, -8344\},\n\
|
||||
\{ 0, -11661, -8895, -8267\}, \{ 0, -11843, -8879, -8259\},\n\
|
||||
\{ 0, -11799, -8715, -8112\}, \{ 0, -12002, -8422, -8238\},\n\
|
||||
\{ 0, -12022, -8434, -8409\}, \{ 0, -8755, -4274, -4932\},\n\
|
||||
\{ 0, -9183, -4523, -5458\}, \{ 0, -9293, -4300, -5260\},\n\
|
||||
\{ 0, -9530, -4543, -5569\}, \{ 0, -9573, -4168, -5429\},\n\
|
||||
\{ 0, -9847, -4448, -5638\}, \{ 0, -9999, -4504, -5969\},\n\
|
||||
\{ 0, -9858, -4176, -5716\}, \{ 0, -9988, -4378, -5978\},\n\
|
||||
\{ 0, -9760, -3942, -5627\}, \{ 0, -10072, -4163, -6002\},\n\
|
||||
\{ 0, -9892, -4091, -5833\}, \{ 0, -9873, -3867, -5828\},\n\
|
||||
\{ 0, -9911, -4149, -5877\}, \{ 0, -9844, -4016, -5908\},\n\
|
||||
\{ 0, -9528, -3912, -5604\}, \{ 0, -9432, -3911, -5648\},\n\
|
||||
\{ 0, -9314, -3730, -5422\}, \n\
|
||||
};"
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
clear;clc;
|
||||
|
||||
fid = fopen("../caldata", "w");
|
||||
fprintf(fid, "declare -A calMap\n");
|
||||
|
||||
for i = 1:6
|
||||
id = sprintf("JG%02d", i);
|
||||
write_data(fid, pwd, id);
|
||||
end
|
||||
|
||||
for i = 1:6
|
||||
id = sprintf("LJ%02d", i);
|
||||
write_data(fid, pwd, id);
|
||||
end
|
||||
|
||||
fclose(fid);
|
||||
|
||||
function write_data(fid, folder_name, dev_id)
|
||||
file_path = sprintf("%s/phase_%s.mat", folder_name, dev_id);
|
||||
if ~isfile(file_path)
|
||||
warning('[%s] dose not exist.\n', file_path);
|
||||
return;
|
||||
end
|
||||
load(file_path);
|
||||
data = sortrows(dataDec1, 1);
|
||||
fprintf(fid, 'calMap[%s]="\\{\\n\\\n', dev_id);
|
||||
for i = 1:size(data,1)
|
||||
if (mod(i, 2) == 1)
|
||||
fprintf(fid, "\t");
|
||||
end
|
||||
fprintf(fid, "\\{%6d, %6d, %6d, %6d\\},", ...
|
||||
data(i,2), data(i,3), data(i,4), data(i,5));
|
||||
if (mod(i, 2) == 1)
|
||||
fprintf(fid, " ");
|
||||
else
|
||||
fprintf(fid, "\\n\\\n");
|
||||
end
|
||||
end
|
||||
fprintf(fid, '\\n\\\n};"\n\n');
|
||||
end
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -22,7 +22,7 @@ except ImportError:
|
||||
from COMTool.widgets import statusBar
|
||||
|
||||
class Plugin(Plugin_Base):
|
||||
id = "DEIFEI"
|
||||
id = "DUIFEI"
|
||||
name = _("DUIFEI")
|
||||
showReceiveDataSignal = pyqtSignal(str)
|
||||
|
||||
@@ -181,7 +181,7 @@ class Plugin(Plugin_Base):
|
||||
self.config["customSendItems"] = newItems
|
||||
self.showReceiveDataSignal.connect(self.showReceivedData)
|
||||
# frame struct
|
||||
self.structSelfTestRsp = Struct("<BB B BBBbbb BbBBB H")
|
||||
self.structSelfTestRsp = Struct("<BB B BBBbbb BbBBB BB")
|
||||
self.structStatusCheckRsp = Struct("<BB Q HIII IBBBBI BBHH HHHIIIIII i II 4s IIII d Q dBB dB H B 3s BBBbbb BbBBB 2s")
|
||||
self.structFljData = Struct("<dddd IHI fff fff")
|
||||
self.structLjData = Struct("<IHI ffff IHI fff fff fff IHI fff fff fff IHI fff fff fff I")
|
||||
@@ -260,6 +260,8 @@ class Plugin(Plugin_Base):
|
||||
|
||||
ret = "----------- 自检回令 -----------\n"
|
||||
|
||||
ret += f"节点编号: 0x{payload[-2]:02X}\n"
|
||||
|
||||
ret += "节点类型: "
|
||||
if payload[1] == 0xDD:
|
||||
ret += f"K频段 (0x{payload[1]:02X})\n"
|
||||
|
||||
@@ -2,28 +2,28 @@
|
||||
# Automatically-generated file. Do not edit!
|
||||
################################################################################
|
||||
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
C_SRCS += \
|
||||
../src/dev_profile/global_timer_profile.c \
|
||||
../src/dev_profile/intc_profile.c \
|
||||
../src/dev_profile/timer_profile.c
|
||||
../src/dev_profile/timer_profile.c
|
||||
|
||||
OBJS += \
|
||||
./src/dev_profile/global_timer_profile.o \
|
||||
./src/dev_profile/intc_profile.o \
|
||||
./src/dev_profile/timer_profile.o
|
||||
./src/dev_profile/timer_profile.o
|
||||
|
||||
C_DEPS += \
|
||||
./src/dev_profile/global_timer_profile.d \
|
||||
./src/dev_profile/intc_profile.d \
|
||||
./src/dev_profile/timer_profile.d
|
||||
./src/dev_profile/timer_profile.d
|
||||
|
||||
|
||||
# Each subdirectory must supply rules for building sources it contributes
|
||||
src/dev_profile/%.o: ../src/dev_profile/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -std=c17 -pedantic -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ C_DEPS += \
|
||||
src/systembus/%.o: ../src/systembus/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -std=c17 -pedantic -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -2,28 +2,28 @@
|
||||
# Automatically-generated file. Do not edit!
|
||||
################################################################################
|
||||
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
C_SRCS += \
|
||||
../src/networking/link_layer/geometry/coord.c \
|
||||
../src/networking/link_layer/geometry/eulerangles.c \
|
||||
../src/networking/link_layer/geometry/quaternion.c
|
||||
../src/networking/link_layer/geometry/quaternion.c
|
||||
|
||||
OBJS += \
|
||||
./src/networking/link_layer/geometry/coord.o \
|
||||
./src/networking/link_layer/geometry/eulerangles.o \
|
||||
./src/networking/link_layer/geometry/quaternion.o
|
||||
./src/networking/link_layer/geometry/quaternion.o
|
||||
|
||||
C_DEPS += \
|
||||
./src/networking/link_layer/geometry/coord.d \
|
||||
./src/networking/link_layer/geometry/eulerangles.d \
|
||||
./src/networking/link_layer/geometry/quaternion.d
|
||||
./src/networking/link_layer/geometry/quaternion.d
|
||||
|
||||
|
||||
# Each subdirectory must supply rules for building sources it contributes
|
||||
src/networking/link_layer/geometry/%.o: ../src/networking/link_layer/geometry/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -std=c17 -pedantic -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Automatically-generated file. Do not edit!
|
||||
################################################################################
|
||||
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
C_SRCS += \
|
||||
../src/networking/link_layer/framing.c \
|
||||
../src/networking/link_layer/link_layer.c \
|
||||
@@ -11,7 +11,7 @@ C_SRCS += \
|
||||
../src/networking/link_layer/scan.c \
|
||||
../src/networking/link_layer/schdevent.c \
|
||||
../src/networking/link_layer/service.c \
|
||||
../src/networking/link_layer/time_sync.c
|
||||
../src/networking/link_layer/time_sync.c
|
||||
|
||||
OBJS += \
|
||||
./src/networking/link_layer/framing.o \
|
||||
@@ -21,7 +21,7 @@ OBJS += \
|
||||
./src/networking/link_layer/scan.o \
|
||||
./src/networking/link_layer/schdevent.o \
|
||||
./src/networking/link_layer/service.o \
|
||||
./src/networking/link_layer/time_sync.o
|
||||
./src/networking/link_layer/time_sync.o
|
||||
|
||||
C_DEPS += \
|
||||
./src/networking/link_layer/framing.d \
|
||||
@@ -31,14 +31,14 @@ C_DEPS += \
|
||||
./src/networking/link_layer/scan.d \
|
||||
./src/networking/link_layer/schdevent.d \
|
||||
./src/networking/link_layer/service.d \
|
||||
./src/networking/link_layer/time_sync.d
|
||||
./src/networking/link_layer/time_sync.d
|
||||
|
||||
|
||||
# Each subdirectory must supply rules for building sources it contributes
|
||||
src/networking/link_layer/%.o: ../src/networking/link_layer/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -std=c17 -pedantic -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -2,25 +2,25 @@
|
||||
# Automatically-generated file. Do not edit!
|
||||
################################################################################
|
||||
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
C_SRCS += \
|
||||
../src/networking/phy_layer/phy_antenna.c \
|
||||
../src/networking/phy_layer/phy_layer.c
|
||||
../src/networking/phy_layer/phy_layer.c
|
||||
|
||||
OBJS += \
|
||||
./src/networking/phy_layer/phy_antenna.o \
|
||||
./src/networking/phy_layer/phy_layer.o
|
||||
./src/networking/phy_layer/phy_layer.o
|
||||
|
||||
C_DEPS += \
|
||||
./src/networking/phy_layer/phy_antenna.d \
|
||||
./src/networking/phy_layer/phy_layer.d
|
||||
./src/networking/phy_layer/phy_layer.d
|
||||
|
||||
|
||||
# Each subdirectory must supply rules for building sources it contributes
|
||||
src/networking/phy_layer/%.o: ../src/networking/phy_layer/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -std=c17 -pedantic -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -2,28 +2,28 @@
|
||||
# Automatically-generated file. Do not edit!
|
||||
################################################################################
|
||||
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
LD_SRCS += \
|
||||
../src/lscript.ld
|
||||
../src/lscript.ld
|
||||
|
||||
C_SRCS += \
|
||||
../src/main.c \
|
||||
../src/system_monitor.c
|
||||
../src/system_monitor.c
|
||||
|
||||
OBJS += \
|
||||
./src/main.o \
|
||||
./src/system_monitor.o
|
||||
./src/system_monitor.o
|
||||
|
||||
C_DEPS += \
|
||||
./src/main.d \
|
||||
./src/system_monitor.d
|
||||
./src/system_monitor.d
|
||||
|
||||
|
||||
# Each subdirectory must supply rules for building sources it contributes
|
||||
src/%.o: ../src/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -std=c17 -pedantic -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -2,22 +2,22 @@
|
||||
# Automatically-generated file. Do not edit!
|
||||
################################################################################
|
||||
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
C_SRCS += \
|
||||
../src/time_ctrl/time_ctrl.c
|
||||
../src/time_ctrl/time_ctrl.c
|
||||
|
||||
OBJS += \
|
||||
./src/time_ctrl/time_ctrl.o
|
||||
./src/time_ctrl/time_ctrl.o
|
||||
|
||||
C_DEPS += \
|
||||
./src/time_ctrl/time_ctrl.d
|
||||
./src/time_ctrl/time_ctrl.d
|
||||
|
||||
|
||||
# Each subdirectory must supply rules for building sources it contributes
|
||||
src/time_ctrl/%.o: ../src/time_ctrl/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -std=c17 -pedantic -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
# Automatically-generated file. Do not edit!
|
||||
################################################################################
|
||||
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
C_SRCS += \
|
||||
../src/util/circ_queue.c \
|
||||
../src/util/clist.c \
|
||||
../src/util/common.c \
|
||||
../src/util/crc.c \
|
||||
../src/util/list.c \
|
||||
../src/util/util.c
|
||||
../src/util/util.c
|
||||
|
||||
OBJS += \
|
||||
./src/util/circ_queue.o \
|
||||
@@ -17,7 +17,7 @@ OBJS += \
|
||||
./src/util/common.o \
|
||||
./src/util/crc.o \
|
||||
./src/util/list.o \
|
||||
./src/util/util.o
|
||||
./src/util/util.o
|
||||
|
||||
C_DEPS += \
|
||||
./src/util/circ_queue.d \
|
||||
@@ -25,14 +25,14 @@ C_DEPS += \
|
||||
./src/util/common.d \
|
||||
./src/util/crc.d \
|
||||
./src/util/list.d \
|
||||
./src/util/util.d
|
||||
./src/util/util.d
|
||||
|
||||
|
||||
# Each subdirectory must supply rules for building sources it contributes
|
||||
src/util/%.o: ../src/util/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -std=c17 -pedantic -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -278,7 +278,7 @@ static int32_t Mpc_SystemConfig(MPC *instPtr, uint8_t *msg)
|
||||
* @param InstPtr A double pointer to MPC instance.
|
||||
* @param config A pointer to MPC configurations.
|
||||
*
|
||||
* @return None.
|
||||
* @return Error code.
|
||||
*
|
||||
******************************************************************************/
|
||||
int32_t Mpc_Init(MPC **instPtr, MPC_CONFIG *config)
|
||||
@@ -290,7 +290,7 @@ int32_t Mpc_Init(MPC **instPtr, MPC_CONFIG *config)
|
||||
(*instPtr) = malloc(sizeof(MPC));
|
||||
if ((*instPtr) == NULL)
|
||||
{
|
||||
return FAILURE;
|
||||
return ENOMEM;
|
||||
}
|
||||
(*instPtr)->rxQueue = NULL;
|
||||
(*instPtr)->txQueue = NULL;
|
||||
@@ -307,14 +307,15 @@ int32_t Mpc_Init(MPC **instPtr, MPC_CONFIG *config)
|
||||
bramConfigPtr = XBram_LookupConfig(config->bramId);
|
||||
if (bramConfigPtr == NULL)
|
||||
{
|
||||
Status = EDCONF;
|
||||
goto mpc_init_error;
|
||||
Mpc_Destroy(*instPtr);
|
||||
return EDCONF;
|
||||
}
|
||||
Status = XBram_CfgInitialize(&mpcBram, bramConfigPtr,
|
||||
bramConfigPtr->CtrlBaseAddress);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
goto mpc_init_error;
|
||||
Mpc_Destroy(*instPtr);
|
||||
return Status;
|
||||
}
|
||||
/*
|
||||
* Execute the BRAM driver selftest.
|
||||
@@ -322,7 +323,8 @@ int32_t Mpc_Init(MPC **instPtr, MPC_CONFIG *config)
|
||||
Status = XBram_SelfTest(&mpcBram, 0);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
goto mpc_init_error;
|
||||
Mpc_Destroy(*instPtr);
|
||||
return Status;
|
||||
}
|
||||
|
||||
mpcHwConfig.txBuffAddr = mpcBram.Config.MemBaseAddress;
|
||||
@@ -332,32 +334,47 @@ int32_t Mpc_Init(MPC **instPtr, MPC_CONFIG *config)
|
||||
Status = MpcHw_Init(&((*instPtr)->mpchwDesc), &mpcHwConfig);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
Status = ENOMEM;
|
||||
goto mpc_init_error;
|
||||
Mpc_Destroy(*instPtr);
|
||||
return ENOMEM;
|
||||
}
|
||||
if (CircQueueCreate(&((*instPtr)->txQueue), (*instPtr)->config.txQueueMax) == false)
|
||||
{
|
||||
Status = ENOMEM;
|
||||
goto mpc_init_error;
|
||||
Mpc_Destroy(*instPtr);
|
||||
return ENOMEM;
|
||||
}
|
||||
if (CircQueueCreate(&((*instPtr)->rxQueue), (*instPtr)->config.rxQueueMax) == false)
|
||||
{
|
||||
Status = ENOMEM;
|
||||
goto mpc_init_error;
|
||||
Mpc_Destroy(*instPtr);
|
||||
return ENOMEM;
|
||||
}
|
||||
(*instPtr)->isEnable = false; // nothing received.
|
||||
(*instPtr)->isRxDone = false; // nothing received.
|
||||
(*instPtr)->isTxDone = true; // nothing to be sent.
|
||||
return SUCCESS;
|
||||
|
||||
mpc_init_error:
|
||||
free((*instPtr)->mpchwDesc);
|
||||
free((*instPtr)->txQueue);
|
||||
free((*instPtr)->rxQueue);
|
||||
free(*instPtr);
|
||||
return Status;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* @brief Destroy MPC instance.
|
||||
*
|
||||
* @param InstPtr A pointer to MPC instance.
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
******************************************************************************/
|
||||
void Mpc_Destroy(MPC *instPtr)
|
||||
{
|
||||
if (instPtr == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
free(instPtr->mpchwDesc);
|
||||
free(instPtr->txQueue);
|
||||
free(instPtr->rxQueue);
|
||||
free(instPtr);
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* @brief Generate a remote test response message.
|
||||
@@ -534,17 +551,16 @@ int32_t Mpc_RxIrqHandler(MPC *instPtr)
|
||||
Status = MpcHw_Recv(instPtr->mpchwDesc, mpcReq);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
goto recv_error;
|
||||
DBG_ERROR("SystemBus::RX error!\n");
|
||||
free(mpcReq);
|
||||
return Status;
|
||||
}
|
||||
if (CircQueuePush(instPtr->rxQueue, (void *)mpcReq) == false)
|
||||
{
|
||||
DBG_ERROR("SystemBus::RX Queue overflowed!\n");
|
||||
Status = EQUEUE;
|
||||
goto recv_error;
|
||||
free(mpcReq);
|
||||
return EQUEUE;
|
||||
}
|
||||
instPtr->isRxDone = false; // another reception is undergoing.
|
||||
return SUCCESS;
|
||||
recv_error:
|
||||
free(mpcReq);
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@ typedef struct
|
||||
/************************** Function Prototypes ******************************/
|
||||
|
||||
int32_t Mpc_Init(MPC **instPtr, MPC_CONFIG *config);
|
||||
void Mpc_Destroy(MPC *instPtr);
|
||||
|
||||
int32_t Mpc_HandleCmd(MPC *instPtr);
|
||||
int32_t Mpc_PendRemoteTest(MPC *instPtr);
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
# Automatically-generated file. Do not edit!
|
||||
################################################################################
|
||||
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
C_SRCS += \
|
||||
../src/dev_profile/ad9361_profile.c \
|
||||
../src/dev_profile/ad9361_reg_profile.c \
|
||||
../src/dev_profile/global_timer_profile.c \
|
||||
../src/dev_profile/hmc7044_profile.c \
|
||||
../src/dev_profile/intc_profile.c \
|
||||
../src/dev_profile/timer_profile.c
|
||||
../src/dev_profile/timer_profile.c
|
||||
|
||||
OBJS += \
|
||||
./src/dev_profile/ad9361_profile.o \
|
||||
@@ -17,7 +17,7 @@ OBJS += \
|
||||
./src/dev_profile/global_timer_profile.o \
|
||||
./src/dev_profile/hmc7044_profile.o \
|
||||
./src/dev_profile/intc_profile.o \
|
||||
./src/dev_profile/timer_profile.o
|
||||
./src/dev_profile/timer_profile.o
|
||||
|
||||
C_DEPS += \
|
||||
./src/dev_profile/ad9361_profile.d \
|
||||
@@ -25,14 +25,14 @@ C_DEPS += \
|
||||
./src/dev_profile/global_timer_profile.d \
|
||||
./src/dev_profile/hmc7044_profile.d \
|
||||
./src/dev_profile/intc_profile.d \
|
||||
./src/dev_profile/timer_profile.d
|
||||
./src/dev_profile/timer_profile.d
|
||||
|
||||
|
||||
# Each subdirectory must supply rules for building sources it contributes
|
||||
src/dev_profile/%.o: ../src/dev_profile/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -std=c17 -pedantic -Wall -Wformat=2 -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -2,28 +2,28 @@
|
||||
# Automatically-generated file. Do not edit!
|
||||
################################################################################
|
||||
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
C_SRCS += \
|
||||
../src/networking/link_layer/geometry/coord.c \
|
||||
../src/networking/link_layer/geometry/eulerangles.c \
|
||||
../src/networking/link_layer/geometry/quaternion.c
|
||||
../src/networking/link_layer/geometry/quaternion.c
|
||||
|
||||
OBJS += \
|
||||
./src/networking/link_layer/geometry/coord.o \
|
||||
./src/networking/link_layer/geometry/eulerangles.o \
|
||||
./src/networking/link_layer/geometry/quaternion.o
|
||||
./src/networking/link_layer/geometry/quaternion.o
|
||||
|
||||
C_DEPS += \
|
||||
./src/networking/link_layer/geometry/coord.d \
|
||||
./src/networking/link_layer/geometry/eulerangles.d \
|
||||
./src/networking/link_layer/geometry/quaternion.d
|
||||
./src/networking/link_layer/geometry/quaternion.d
|
||||
|
||||
|
||||
# Each subdirectory must supply rules for building sources it contributes
|
||||
src/networking/link_layer/geometry/%.o: ../src/networking/link_layer/geometry/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -std=c17 -pedantic -Wall -Wformat=2 -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Automatically-generated file. Do not edit!
|
||||
################################################################################
|
||||
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
C_SRCS += \
|
||||
../src/networking/link_layer/framing.c \
|
||||
../src/networking/link_layer/link_layer.c \
|
||||
@@ -11,7 +11,7 @@ C_SRCS += \
|
||||
../src/networking/link_layer/scan.c \
|
||||
../src/networking/link_layer/schdevent.c \
|
||||
../src/networking/link_layer/service.c \
|
||||
../src/networking/link_layer/time_sync.c
|
||||
../src/networking/link_layer/time_sync.c
|
||||
|
||||
OBJS += \
|
||||
./src/networking/link_layer/framing.o \
|
||||
@@ -21,7 +21,7 @@ OBJS += \
|
||||
./src/networking/link_layer/scan.o \
|
||||
./src/networking/link_layer/schdevent.o \
|
||||
./src/networking/link_layer/service.o \
|
||||
./src/networking/link_layer/time_sync.o
|
||||
./src/networking/link_layer/time_sync.o
|
||||
|
||||
C_DEPS += \
|
||||
./src/networking/link_layer/framing.d \
|
||||
@@ -31,14 +31,14 @@ C_DEPS += \
|
||||
./src/networking/link_layer/scan.d \
|
||||
./src/networking/link_layer/schdevent.d \
|
||||
./src/networking/link_layer/service.d \
|
||||
./src/networking/link_layer/time_sync.d
|
||||
./src/networking/link_layer/time_sync.d
|
||||
|
||||
|
||||
# Each subdirectory must supply rules for building sources it contributes
|
||||
src/networking/link_layer/%.o: ../src/networking/link_layer/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -std=c17 -pedantic -Wall -Wformat=2 -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -2,25 +2,25 @@
|
||||
# Automatically-generated file. Do not edit!
|
||||
################################################################################
|
||||
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
C_SRCS += \
|
||||
../src/networking/phy_layer/phy_antenna.c \
|
||||
../src/networking/phy_layer/phy_layer.c
|
||||
../src/networking/phy_layer/phy_layer.c
|
||||
|
||||
OBJS += \
|
||||
./src/networking/phy_layer/phy_antenna.o \
|
||||
./src/networking/phy_layer/phy_layer.o
|
||||
./src/networking/phy_layer/phy_layer.o
|
||||
|
||||
C_DEPS += \
|
||||
./src/networking/phy_layer/phy_antenna.d \
|
||||
./src/networking/phy_layer/phy_layer.d
|
||||
./src/networking/phy_layer/phy_layer.d
|
||||
|
||||
|
||||
# Each subdirectory must supply rules for building sources it contributes
|
||||
src/networking/phy_layer/%.o: ../src/networking/phy_layer/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -std=c17 -pedantic -Wall -Wformat=2 -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ C_DEPS += \
|
||||
src/%.o: ../src/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -std=c17 -pedantic -Wall -Wformat=2 -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -2,25 +2,25 @@
|
||||
# Automatically-generated file. Do not edit!
|
||||
################################################################################
|
||||
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
C_SRCS += \
|
||||
../src/systembus/systembus.c \
|
||||
../src/systembus/systembus_uart.c
|
||||
../src/systembus/systembus_uart.c
|
||||
|
||||
OBJS += \
|
||||
./src/systembus/systembus.o \
|
||||
./src/systembus/systembus_uart.o
|
||||
./src/systembus/systembus_uart.o
|
||||
|
||||
C_DEPS += \
|
||||
./src/systembus/systembus.d \
|
||||
./src/systembus/systembus_uart.d
|
||||
./src/systembus/systembus_uart.d
|
||||
|
||||
|
||||
# Each subdirectory must supply rules for building sources it contributes
|
||||
src/systembus/%.o: ../src/systembus/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -std=c17 -pedantic -Wall -Wformat=2 -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -2,22 +2,22 @@
|
||||
# Automatically-generated file. Do not edit!
|
||||
################################################################################
|
||||
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
C_SRCS += \
|
||||
../src/time_ctrl/time_ctrl.c
|
||||
../src/time_ctrl/time_ctrl.c
|
||||
|
||||
OBJS += \
|
||||
./src/time_ctrl/time_ctrl.o
|
||||
./src/time_ctrl/time_ctrl.o
|
||||
|
||||
C_DEPS += \
|
||||
./src/time_ctrl/time_ctrl.d
|
||||
./src/time_ctrl/time_ctrl.d
|
||||
|
||||
|
||||
# Each subdirectory must supply rules for building sources it contributes
|
||||
src/time_ctrl/%.o: ../src/time_ctrl/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
arm-none-eabi-gcc -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
arm-none-eabi-gcc -std=c17 -pedantic -Wall -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
# Automatically-generated file. Do not edit!
|
||||
################################################################################
|
||||
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
C_SRCS += \
|
||||
../src/util/circ_queue.c \
|
||||
../src/util/clist.c \
|
||||
../src/util/common.c \
|
||||
../src/util/crc.c \
|
||||
../src/util/list.c \
|
||||
../src/util/util.c
|
||||
../src/util/util.c
|
||||
|
||||
OBJS += \
|
||||
./src/util/circ_queue.o \
|
||||
@@ -17,7 +17,7 @@ OBJS += \
|
||||
./src/util/common.o \
|
||||
./src/util/crc.o \
|
||||
./src/util/list.o \
|
||||
./src/util/util.o
|
||||
./src/util/util.o
|
||||
|
||||
C_DEPS += \
|
||||
./src/util/circ_queue.d \
|
||||
@@ -25,14 +25,14 @@ C_DEPS += \
|
||||
./src/util/common.d \
|
||||
./src/util/crc.d \
|
||||
./src/util/list.d \
|
||||
./src/util/util.d
|
||||
./src/util/util.d
|
||||
|
||||
|
||||
# Each subdirectory must supply rules for building sources it contributes
|
||||
src/util/%.o: ../src/util/%.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: ARM v7 gcc compiler'
|
||||
$(CC) -Wall -Wformat=2 -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
$(CC) -std=c17 -pedantic -Wall -Wformat=2 -O0 -g3 -I../bsp/ps7_cortexa9_0/include -I../src/include -c -fmessage-length=0 -MT"$@" -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -23,11 +23,11 @@
|
||||
#include "xparameters.h"
|
||||
|
||||
/******** Software Version ********/
|
||||
#define _APP_VER 0x00010008
|
||||
#define _APP_VER 0x00010008
|
||||
|
||||
#define _APP_VER_MAIN ((_APP_VER & 0xFF000000) >> 24)
|
||||
#define _APP_VER_MINOR ((_APP_VER & 0x00FF0000) >> 16)
|
||||
#define _APP_VER_PATCH (_APP_VER & 0x0000FFFF)
|
||||
#define _APP_VER_MAIN ((_APP_VER & 0xFF000000) >> 24)
|
||||
#define _APP_VER_MINOR ((_APP_VER & 0x00FF0000) >> 16)
|
||||
#define _APP_VER_PATCH (_APP_VER & 0x0000FFFF)
|
||||
|
||||
/*********** Debug Info Level ************/
|
||||
// #define _DEBUG_LEVEL 1
|
||||
@@ -38,13 +38,13 @@
|
||||
|
||||
#define DATALINK_ENABLE_AUTORECONNECT
|
||||
#define DATALINK_ENABLE_AUTOTIMESYNC
|
||||
//#define DATALINK_ENABLE_BERTEST
|
||||
// #define DATALINK_ENABLE_BERTEST
|
||||
|
||||
/************ Hardware Configs ************/
|
||||
#define CPU_CLK_HZ XPAR_CPU_CORTEXA9_0_CPU_CLK_FREQ_HZ
|
||||
#define GLOBAL_TIMER_CLK_HZ (CPU_CLK_HZ/2)
|
||||
#define SCU_TIMER_CLK_HZ (CPU_CLK_HZ/2)
|
||||
#define FCLK_CLK0_HZ 100000000
|
||||
#define CPU_CLK_HZ XPAR_CPU_CORTEXA9_0_CPU_CLK_FREQ_HZ
|
||||
#define GLOBAL_TIMER_CLK_HZ (CPU_CLK_HZ / 2)
|
||||
#define SCU_TIMER_CLK_HZ (CPU_CLK_HZ / 2)
|
||||
#define FCLK_CLK0_HZ 100000000
|
||||
|
||||
/********* Zynq Platform Configs **********/
|
||||
// SCU Timer (for logging)
|
||||
@@ -52,8 +52,8 @@
|
||||
#define SCUTIMER_INTR_ID XPAR_SCUTIMER_INTR
|
||||
|
||||
// Physical Layer Configs
|
||||
#define PHY_DEVICE_ID 0
|
||||
#define PHY_BASEADDR XPAR_PHYC_BASEADDR
|
||||
#define PHY_DEVICE_ID 0X00
|
||||
#define PHY_BASEADDR XPAR_PHYC_BASEADDR
|
||||
#define PHY_BEAM_FORMING_ENABLE
|
||||
// -- Antenna Bram Configs
|
||||
#define PHY_ANTCONFIG_BRAM_DEVICE_ID XPAR_PHY_DATA_INTERFACE_ANT_CONFIG_BRAM_CTRL_DEVICE_ID
|
||||
@@ -71,88 +71,88 @@
|
||||
#define TIME_CONTROLLER_BASEADDR XPAR_TMC_BASEADDR
|
||||
|
||||
// System Bus Configs
|
||||
#define SYSBUS_BASE_ADDR XPAR_SYSTEMBUS_BASEADDR
|
||||
#define SYSBUS_TX_INTR_ID XPAR_FABRIC_SYSTEMBUS_TX_DONE_INTR
|
||||
#define SYSBUS_RX_INTR_ID XPAR_FABRIC_SYSTEMBUS_RX_DONE_INTR
|
||||
#define SYSBUS_BASE_ADDR XPAR_SYSTEMBUS_BASEADDR
|
||||
#define SYSBUS_TX_INTR_ID XPAR_FABRIC_SYSTEMBUS_TX_DONE_INTR
|
||||
#define SYSBUS_RX_INTR_ID XPAR_FABRIC_SYSTEMBUS_RX_DONE_INTR
|
||||
|
||||
// Global Timer config
|
||||
#define GLOBAL_TIMER_DEVICE_ID XPAR_GLOBAL_TMR_DEVICE_ID
|
||||
#define GLOBAL_TIMER_BASEADDR XPAR_GLOBAL_TMR_BASEADDR
|
||||
#define GLOBAL_TIMER_INTR_ID XPAR_GLOBAL_TMR_INTR
|
||||
#define GLOBAL_TIMER_DEVICE_ID XPAR_GLOBAL_TMR_DEVICE_ID
|
||||
#define GLOBAL_TIMER_BASEADDR XPAR_GLOBAL_TMR_BASEADDR
|
||||
#define GLOBAL_TIMER_INTR_ID XPAR_GLOBAL_TMR_INTR
|
||||
|
||||
// INTC configis
|
||||
#define INTC_DEVICE_ID XPAR_SCUGIC_0_DEVICE_ID
|
||||
|
||||
// AD9361 Configuration
|
||||
#define SPI_INTERFACE_SPI_ENGINE
|
||||
#define HAVE_SPLIT_GAIN_TABLE 1 /* only set to 0 in case split_gain_table_mode_enable = 0*/
|
||||
#define HAVE_TDD_SYNTH_TABLE 1 /* only set to 0 in case split_gain_table_mode_enable = 0*/
|
||||
#define AD9361_DEVICE 1 /* set it 1 if AD9361 device is used, 0 otherwise */
|
||||
#define AD9364_DEVICE 0 /* set it 1 if AD9364 device is used, 0 otherwise */
|
||||
#define AD9363A_DEVICE 0 /* set it 1 if AD9363A device is used, 0 otherwise */
|
||||
#define HAVE_VERBOSE_MESSAGES /* Recommended during development prints errors and warnings */
|
||||
//#define HAVE_DEBUG_MESSAGES /* For Debug purposes only */
|
||||
// -- AD9361 SPI Engine Configuration
|
||||
#define AD9361_SPI_DEVICE_ID 0
|
||||
#define AD9361_SPI_ENGINE_REF_CLK FCLK_CLK0_HZ
|
||||
#define AD9361_SPI_ENGINE_MAX_SPEED 5000000
|
||||
#define AD9361_SPI_ENGINE_BASEADDR XPAR_AXI_SPI_ENGINE_AXI_SPI_ENGINE_BASEADDR
|
||||
#define AD9361_SPI_ENGINE_DATA_WIDTH 8
|
||||
#define AD9361_SPI_ENGINE_CS_DELAY 3
|
||||
#define AD9361_SPI_CS_AD9361_1 0x01
|
||||
#define AD9361_SPI_CS_AD9361_2 0x02
|
||||
#define AD9361_TIMEOUT_TH 2000
|
||||
#define HAVE_SPLIT_GAIN_TABLE 1 /* only set to 0 in case split_gain_table_mode_enable = 0*/
|
||||
#define HAVE_TDD_SYNTH_TABLE 1 /* only set to 0 in case split_gain_table_mode_enable = 0*/
|
||||
#define AD9361_DEVICE 1 /* set it 1 if AD9361 device is used, 0 otherwise */
|
||||
#define AD9364_DEVICE 0 /* set it 1 if AD9364 device is used, 0 otherwise */
|
||||
#define AD9363A_DEVICE 0 /* set it 1 if AD9363A device is used, 0 otherwise */
|
||||
#define HAVE_VERBOSE_MESSAGES /* Recommended during development prints errors and warnings */
|
||||
// #define HAVE_DEBUG_MESSAGES /* For Debug purposes only */
|
||||
// -- AD9361 SPI Engine Configuration
|
||||
#define AD9361_SPI_DEVICE_ID 0
|
||||
#define AD9361_SPI_ENGINE_REF_CLK FCLK_CLK0_HZ
|
||||
#define AD9361_SPI_ENGINE_MAX_SPEED 5000000
|
||||
#define AD9361_SPI_ENGINE_BASEADDR XPAR_AXI_SPI_ENGINE_AXI_SPI_ENGINE_BASEADDR
|
||||
#define AD9361_SPI_ENGINE_DATA_WIDTH 8
|
||||
#define AD9361_SPI_ENGINE_CS_DELAY 3
|
||||
#define AD9361_SPI_CS_AD9361_1 0x01
|
||||
#define AD9361_SPI_CS_AD9361_2 0x02
|
||||
#define AD9361_TIMEOUT_TH 2000
|
||||
// AD9361 GPIO Configurations
|
||||
#define AD9361_GPIO_DEVICE_ID 0
|
||||
#define AD9361_GPIO_OFFSET 54
|
||||
#define AD9361_GPIO_INPUT 0
|
||||
#define AD9361_GPIO_OUTPUT 1
|
||||
#define AD9361_GPIO_DISABLE 0
|
||||
#define AD9361_GPIO_ENABLE 1
|
||||
#define AD9361_GPIO_DEVICE_ID 0
|
||||
#define AD9361_GPIO_OFFSET 54
|
||||
#define AD9361_GPIO_INPUT 0
|
||||
#define AD9361_GPIO_OUTPUT 1
|
||||
#define AD9361_GPIO_DISABLE 0
|
||||
#define AD9361_GPIO_ENABLE 1
|
||||
// -- AD9361-1
|
||||
#define AD9361_1_TXNRX (AD9361_GPIO_OFFSET+6)
|
||||
#define AD9361_1_ENABLE (AD9361_GPIO_OFFSET+7)
|
||||
#define AD9361_1_EN_AGC (AD9361_GPIO_OFFSET+8)
|
||||
#define AD9361_1_RESET_B (AD9361_GPIO_OFFSET+9)
|
||||
#define AD9361_1_CTRL_OUT0 (AD9361_GPIO_OFFSET+10)
|
||||
#define AD9361_1_CTRL_OUT1 (AD9361_GPIO_OFFSET+11)
|
||||
#define AD9361_1_CTRL_OUT2 (AD9361_GPIO_OFFSET+12)
|
||||
#define AD9361_1_CTRL_OUT3 (AD9361_GPIO_OFFSET+13)
|
||||
#define AD9361_1_CTRL_OUT4 (AD9361_GPIO_OFFSET+14)
|
||||
#define AD9361_1_CTRL_OUT5 (AD9361_GPIO_OFFSET+15)
|
||||
#define AD9361_1_CTRL_OUT6 (AD9361_GPIO_OFFSET+16)
|
||||
#define AD9361_1_CTRL_OUT7 (AD9361_GPIO_OFFSET+17)
|
||||
#define AD9361_1_CTRL_IN0 (AD9361_GPIO_OFFSET+18)
|
||||
#define AD9361_1_CTRL_IN1 (AD9361_GPIO_OFFSET+19)
|
||||
#define AD9361_1_CTRL_IN2 (AD9361_GPIO_OFFSET+20)
|
||||
#define AD9361_1_CTRL_IN3 (AD9361_GPIO_OFFSET+21)
|
||||
#define AD9361_1_TXNRX (AD9361_GPIO_OFFSET + 6)
|
||||
#define AD9361_1_ENABLE (AD9361_GPIO_OFFSET + 7)
|
||||
#define AD9361_1_EN_AGC (AD9361_GPIO_OFFSET + 8)
|
||||
#define AD9361_1_RESET_B (AD9361_GPIO_OFFSET + 9)
|
||||
#define AD9361_1_CTRL_OUT0 (AD9361_GPIO_OFFSET + 10)
|
||||
#define AD9361_1_CTRL_OUT1 (AD9361_GPIO_OFFSET + 11)
|
||||
#define AD9361_1_CTRL_OUT2 (AD9361_GPIO_OFFSET + 12)
|
||||
#define AD9361_1_CTRL_OUT3 (AD9361_GPIO_OFFSET + 13)
|
||||
#define AD9361_1_CTRL_OUT4 (AD9361_GPIO_OFFSET + 14)
|
||||
#define AD9361_1_CTRL_OUT5 (AD9361_GPIO_OFFSET + 15)
|
||||
#define AD9361_1_CTRL_OUT6 (AD9361_GPIO_OFFSET + 16)
|
||||
#define AD9361_1_CTRL_OUT7 (AD9361_GPIO_OFFSET + 17)
|
||||
#define AD9361_1_CTRL_IN0 (AD9361_GPIO_OFFSET + 18)
|
||||
#define AD9361_1_CTRL_IN1 (AD9361_GPIO_OFFSET + 19)
|
||||
#define AD9361_1_CTRL_IN2 (AD9361_GPIO_OFFSET + 20)
|
||||
#define AD9361_1_CTRL_IN3 (AD9361_GPIO_OFFSET + 21)
|
||||
// AD9361-2
|
||||
#define AD9361_2_TXNRX (AD9361_GPIO_OFFSET+22)
|
||||
#define AD9361_2_ENABLE (AD9361_GPIO_OFFSET+23)
|
||||
#define AD9361_2_EN_AGC (AD9361_GPIO_OFFSET+24)
|
||||
#define AD9361_2_RESET_B (AD9361_GPIO_OFFSET+25)
|
||||
#define AD9361_2_CTRL_OUT0 (AD9361_GPIO_OFFSET+26)
|
||||
#define AD9361_2_CTRL_OUT1 (AD9361_GPIO_OFFSET+27)
|
||||
#define AD9361_2_CTRL_OUT2 (AD9361_GPIO_OFFSET+28)
|
||||
#define AD9361_2_CTRL_OUT3 (AD9361_GPIO_OFFSET+29)
|
||||
#define AD9361_2_CTRL_OUT4 (AD9361_GPIO_OFFSET+30)
|
||||
#define AD9361_2_CTRL_OUT5 (AD9361_GPIO_OFFSET+31)
|
||||
#define AD9361_2_CTRL_OUT6 (AD9361_GPIO_OFFSET+32)
|
||||
#define AD9361_2_CTRL_OUT7 (AD9361_GPIO_OFFSET+33)
|
||||
#define AD9361_2_CTRL_IN0 (AD9361_GPIO_OFFSET+34)
|
||||
#define AD9361_2_CTRL_IN1 (AD9361_GPIO_OFFSET+35)
|
||||
#define AD9361_2_CTRL_IN2 (AD9361_GPIO_OFFSET+36)
|
||||
#define AD9361_2_CTRL_IN3 (AD9361_GPIO_OFFSET+37)
|
||||
#define AD9361_2_TXNRX (AD9361_GPIO_OFFSET + 22)
|
||||
#define AD9361_2_ENABLE (AD9361_GPIO_OFFSET + 23)
|
||||
#define AD9361_2_EN_AGC (AD9361_GPIO_OFFSET + 24)
|
||||
#define AD9361_2_RESET_B (AD9361_GPIO_OFFSET + 25)
|
||||
#define AD9361_2_CTRL_OUT0 (AD9361_GPIO_OFFSET + 26)
|
||||
#define AD9361_2_CTRL_OUT1 (AD9361_GPIO_OFFSET + 27)
|
||||
#define AD9361_2_CTRL_OUT2 (AD9361_GPIO_OFFSET + 28)
|
||||
#define AD9361_2_CTRL_OUT3 (AD9361_GPIO_OFFSET + 29)
|
||||
#define AD9361_2_CTRL_OUT4 (AD9361_GPIO_OFFSET + 30)
|
||||
#define AD9361_2_CTRL_OUT5 (AD9361_GPIO_OFFSET + 31)
|
||||
#define AD9361_2_CTRL_OUT6 (AD9361_GPIO_OFFSET + 32)
|
||||
#define AD9361_2_CTRL_OUT7 (AD9361_GPIO_OFFSET + 33)
|
||||
#define AD9361_2_CTRL_IN0 (AD9361_GPIO_OFFSET + 34)
|
||||
#define AD9361_2_CTRL_IN1 (AD9361_GPIO_OFFSET + 35)
|
||||
#define AD9361_2_CTRL_IN2 (AD9361_GPIO_OFFSET + 36)
|
||||
#define AD9361_2_CTRL_IN3 (AD9361_GPIO_OFFSET + 37)
|
||||
// AD9361-Status Code
|
||||
#define AD9361_SYNC (AD9361_GPIO_OFFSET+38)
|
||||
#define AD9361_RX_FIFO_RST (AD9361_GPIO_OFFSET+39)
|
||||
#define AD9361_1_CAL_START (AD9361_GPIO_OFFSET+40)
|
||||
#define AD9361_2_CAL_START (AD9361_GPIO_OFFSET+41)
|
||||
#define AD9361_RECAL (AD9361_GPIO_OFFSET+42)
|
||||
#define AD9361_TX_SWITCH (AD9361_GPIO_OFFSET+43)
|
||||
#define AD9361_1_CAL_DONE (AD9361_GPIO_OFFSET+44)
|
||||
#define AD9361_2_CAL_DONE (AD9361_GPIO_OFFSET+45)
|
||||
#define AD9361_CAL_RESULT (AD9361_GPIO_OFFSET+46)
|
||||
#define AD9361_SYNC (AD9361_GPIO_OFFSET + 38)
|
||||
#define AD9361_RX_FIFO_RST (AD9361_GPIO_OFFSET + 39)
|
||||
#define AD9361_1_CAL_START (AD9361_GPIO_OFFSET + 40)
|
||||
#define AD9361_2_CAL_START (AD9361_GPIO_OFFSET + 41)
|
||||
#define AD9361_RECAL (AD9361_GPIO_OFFSET + 42)
|
||||
#define AD9361_TX_SWITCH (AD9361_GPIO_OFFSET + 43)
|
||||
#define AD9361_1_CAL_DONE (AD9361_GPIO_OFFSET + 44)
|
||||
#define AD9361_2_CAL_DONE (AD9361_GPIO_OFFSET + 45)
|
||||
#define AD9361_CAL_RESULT (AD9361_GPIO_OFFSET + 46)
|
||||
|
||||
typedef enum
|
||||
{
|
||||
@@ -162,23 +162,22 @@ typedef enum
|
||||
} ad9361TxFreq;
|
||||
|
||||
// HMC7044 Configurations
|
||||
#define HMC7044_GPIO_DEVICE_ID 0
|
||||
#define HMC7044_GPIO_OFFSET 54
|
||||
#define HMC7044_RESET (HMC7044_GPIO_OFFSET+0)
|
||||
#define HMC7044_SYNC (HMC7044_GPIO_OFFSET+1)
|
||||
#define HMC7044_GPIO_0 (HMC7044_GPIO_OFFSET+2)
|
||||
#define HMC7044_GPIO_1 (HMC7044_GPIO_OFFSET+3)
|
||||
#define HMC7044_GPIO_2 (HMC7044_GPIO_OFFSET+4)
|
||||
#define HMC7044_GPIO_3 (HMC7044_GPIO_OFFSET+5)
|
||||
#define HMC7044_GPIO_DEVICE_ID 0
|
||||
#define HMC7044_GPIO_OFFSET 54
|
||||
#define HMC7044_RESET (HMC7044_GPIO_OFFSET + 0)
|
||||
#define HMC7044_SYNC (HMC7044_GPIO_OFFSET + 1)
|
||||
#define HMC7044_GPIO_0 (HMC7044_GPIO_OFFSET + 2)
|
||||
#define HMC7044_GPIO_1 (HMC7044_GPIO_OFFSET + 3)
|
||||
#define HMC7044_GPIO_2 (HMC7044_GPIO_OFFSET + 4)
|
||||
#define HMC7044_GPIO_3 (HMC7044_GPIO_OFFSET + 5)
|
||||
// -- HMC7044 SPI Engine Configuration
|
||||
#define HMC7044_SPI_DEVICE_ID 0
|
||||
#define HMC7044_SPI_ENGINE_REF_CLK FCLK_CLK0_HZ
|
||||
#define HMC7044_SPI_ENGINE_MAX_SPEED 5000000
|
||||
#define HMC7044_SPI_ENGINE_BASEADDR XPAR_AXI_SPI_ENGINE_AXI_SPI_ENGINE_BASEADDR
|
||||
#define HMC7044_SPI_ENGINE_DATA_WIDTH 8
|
||||
#define HMC7044_SPI_ENGINE_CS_DELAY 3
|
||||
#define HMC7044_SPI_CS_HMC7044 0x00
|
||||
|
||||
#define HMC7044_SPI_DEVICE_ID 0
|
||||
#define HMC7044_SPI_ENGINE_REF_CLK FCLK_CLK0_HZ
|
||||
#define HMC7044_SPI_ENGINE_MAX_SPEED 5000000
|
||||
#define HMC7044_SPI_ENGINE_BASEADDR XPAR_AXI_SPI_ENGINE_AXI_SPI_ENGINE_BASEADDR
|
||||
#define HMC7044_SPI_ENGINE_DATA_WIDTH 8
|
||||
#define HMC7044_SPI_ENGINE_CS_DELAY 3
|
||||
#define HMC7044_SPI_CS_HMC7044 0x00
|
||||
|
||||
// Configuration Check
|
||||
#if defined(PHY_BEAM_SET_PRESET) && !defined(PHY_BEAM_FORMING_ENABLE)
|
||||
@@ -188,7 +187,7 @@ typedef enum
|
||||
|
||||
#if defined(DATALINK_ENABLE_BERTEST)
|
||||
#if !defined(DATALINK_ENABLE_AUTOTIMESYNC)
|
||||
#warning To enbale bit error rate test, auto time-sync should be enabled...
|
||||
#warning To enbale bit error rate test, auto time-sync should be enabled...
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -34,9 +34,9 @@
|
||||
|
||||
/************************** Function Prototypes ******************************/
|
||||
/*********************** Driver Instance Definitions **************************/
|
||||
static struct hmc7044_dev *hmc7044_inst;
|
||||
static struct ad9361_reg_dev *ad9361_1_reg_inst;
|
||||
static struct ad9361_reg_dev *ad9361_2_reg_inst;
|
||||
static struct hmc7044_dev *hmc7044_inst = NULL;
|
||||
static struct ad9361_reg_dev *ad9361_1_reg_inst = NULL;
|
||||
static struct ad9361_reg_dev *ad9361_2_reg_inst = NULL;
|
||||
// static struct ad9361_rf_phy *ad9361_phy;
|
||||
// static struct ad9361_rf_phy *ad9361_2_phy;
|
||||
|
||||
@@ -214,6 +214,11 @@ int32_t Hardware_Init(void)
|
||||
Status = Hardware_SwitchFreq(ad9361_1_reg_inst, TX_FREQ_4125);
|
||||
XGpioPs_WritePin(&Gpio, AD9361_TX_SWITCH, 0);
|
||||
|
||||
Status = ad9361_reg_write(ad9361_1_reg_inst, 0x0109, 0x00); // Rx Gain
|
||||
Status = ad9361_reg_write(ad9361_1_reg_inst, 0x010C, 0x00); // Rx Gain
|
||||
Status = ad9361_reg_write(ad9361_2_reg_inst, 0x0109, 0x00); // Rx Gain
|
||||
Status = ad9361_reg_write(ad9361_2_reg_inst, 0x010C, 0x00); // Rx Gain
|
||||
|
||||
DBG_PRINT("Done.\n");
|
||||
|
||||
return SUCCESS;
|
||||
@@ -396,12 +401,15 @@ int32_t Hardware_SwitchFreq(struct ad9361_reg_dev *dev, ad9361TxFreq freq)
|
||||
int8_t Hardware_GetAD9361Temp_1(void)
|
||||
{
|
||||
int8_t scaleTemp;
|
||||
double temp;
|
||||
|
||||
ad9361_reg_write(ad9361_1_reg_inst, 0x000B, -64);
|
||||
ad9361_reg_write(ad9361_1_reg_inst, 0x001D, 0x01); // disable aux adc
|
||||
ad9361_reg_read(ad9361_1_reg_inst, 0x000E, (uint8_t*)&scaleTemp);
|
||||
ad9361_reg_write(ad9361_1_reg_inst, 0x001D, 0x00); // enable aux adc
|
||||
|
||||
return (int8_t) scaleTemp/1.16;
|
||||
temp = ((double)scaleTemp + 64)/1.16;
|
||||
return ((temp > INT8_MAX) ? INT8_MAX : (int8_t)temp);
|
||||
}
|
||||
|
||||
// @ Get AD9361 - 2 temperature (Celsius Degree)
|
||||
@@ -411,12 +419,14 @@ int8_t Hardware_GetAD9361Temp_1(void)
|
||||
int8_t Hardware_GetAD9361Temp_2(void)
|
||||
{
|
||||
int8_t scaleTemp;
|
||||
double temp;
|
||||
|
||||
ad9361_reg_write(ad9361_2_reg_inst, 0x000B, -64);
|
||||
ad9361_reg_write(ad9361_2_reg_inst, 0x001D, 0x01); // disable aux adc
|
||||
ad9361_reg_read(ad9361_2_reg_inst, 0x000E, (uint8_t*)&scaleTemp);
|
||||
ad9361_reg_write(ad9361_2_reg_inst, 0x001D, 0x00); // enable aux adc
|
||||
|
||||
return (int8_t) scaleTemp/1.16;
|
||||
temp = ((double)scaleTemp + 64)/1.16;
|
||||
return ((temp > INT8_MAX) ? INT8_MAX : (int8_t)temp);
|
||||
}
|
||||
|
||||
// @ Determine AD9361 lock state
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
* Copyright(c) 2024 Beijing Institute of Technology.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef HWCONFIG_H_
|
||||
#define HWCONFIG_H_
|
||||
/***************************** Include Files *********************************/
|
||||
// Standard
|
||||
#include <stdint.h>
|
||||
@@ -29,4 +30,4 @@ int8_t Hardware_GetAD9361Temp_2(void);
|
||||
uint8_t Hardware_GetAD9361LockStatus(void);
|
||||
uint8_t Hardware_GetHMC7044LockStatus(void);
|
||||
|
||||
|
||||
#endif // HWCONFIG_H_
|
||||
|
||||
+16
-16
@@ -72,20 +72,20 @@ struct callback_desc scutm_callback_desc = {
|
||||
|
||||
L2_CONFIG linkConfig = {
|
||||
.myType = L2_NODE_HEAD,
|
||||
.clustId = 1,
|
||||
.myId = 1,
|
||||
.headId = 1,
|
||||
.netScale = 2,
|
||||
.clustId = 1U,
|
||||
.myId = 1U,
|
||||
.headId = 1U,
|
||||
.netScale = 2U,
|
||||
.phyInstPtr = NULL, // physical layer reference
|
||||
.tmcInstPtr = NULL
|
||||
};
|
||||
|
||||
// L2_CONFIG linkConfig = {
|
||||
// .myType = L2_NODE_MEMBER,
|
||||
// .clustId = 1,
|
||||
// .myId = 2,
|
||||
// .headId = 1,
|
||||
// .netScale = 2,
|
||||
// .clustId = 1U,
|
||||
// .myId = 2U,
|
||||
// .headId = 1U,
|
||||
// .netScale = 2U,
|
||||
// .phyInstPtr = NULL, // physical layer reference
|
||||
// .tmcInstPtr = NULL
|
||||
// };
|
||||
@@ -106,21 +106,21 @@ static PHY_CONFIG phyConfig = {
|
||||
|
||||
TMC_CONFIG tmcConfig = {
|
||||
.baseAddr = TIME_CONTROLLER_BASEADDR,
|
||||
.reset = 10
|
||||
.reset = 10U
|
||||
};
|
||||
|
||||
static SYSBUS_CONFIG sysbusConfig = {
|
||||
.baseAddr = SYSBUS_BASE_ADDR,
|
||||
.txQueueMax = 16,
|
||||
.rxQueueMax = 16
|
||||
.txQueueMax = 16U,
|
||||
.rxQueueMax = 16U
|
||||
};
|
||||
/*********************** Driver Instance Definitions **************************/
|
||||
static struct irq_ctrl_desc *intcDescPtr; // General interrupt controller descriptor
|
||||
static struct timer_desc *logTmPtr;
|
||||
static SYSBUS *sysbusDescPtr;
|
||||
static PHY_INST *phyInstPtr;
|
||||
static struct irq_ctrl_desc *intcDescPtr = NULL; // General interrupt controller descriptor
|
||||
static struct timer_desc *logTmPtr = NULL;
|
||||
static SYSBUS *sysbusDescPtr = NULL;
|
||||
static PHY_INST *phyInstPtr = NULL;
|
||||
static TMC_INST *tmcInstPtr = NULL;
|
||||
L2_INST *linkInstPtr;
|
||||
L2_INST *linkInstPtr = NULL;
|
||||
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
@@ -165,7 +165,7 @@ bool L2_CrcCheck(uint8_t *dataBuff, uint32_t dataLen, L2_CRC_TYPE crcType)
|
||||
ASSERT(dataBuff != NULL);
|
||||
int32_t Status;
|
||||
uint32_t crcVal;
|
||||
crcVal = 0;
|
||||
crcVal = 0U;
|
||||
Status = L2_CrcGen(dataBuff, dataLen, crcType, &crcVal);
|
||||
if (Status == SUCCESS)
|
||||
{
|
||||
|
||||
@@ -75,6 +75,10 @@ COORD Coord_GetScalarMult(COORD a, double t)
|
||||
/** @brief Divides a coordinate vector by a real number. */
|
||||
void Coord_ScalarDiv(COORD *a, double t)
|
||||
{
|
||||
if (t == 0.0) {
|
||||
*a = COORD_NIL;
|
||||
return;
|
||||
}
|
||||
a->x /= t;
|
||||
a->y /= t;
|
||||
a->z /= t;
|
||||
@@ -83,6 +87,9 @@ void Coord_ScalarDiv(COORD *a, double t)
|
||||
/** @brief Divides a coordinate vector by a real number. */
|
||||
COORD Coord_GetScalarDiv(COORD a, double t)
|
||||
{
|
||||
if (t == 0.0) {
|
||||
return COORD_NIL;
|
||||
}
|
||||
COORD ret;
|
||||
ret.x = a.x / t;
|
||||
ret.y = a.y / t;
|
||||
|
||||
@@ -69,9 +69,9 @@ EULERANGLES EulerAngles_GetScalarMult(EULERANGLES e, double f)
|
||||
/** @brief Normalize EulerAngles. */
|
||||
void EulerAngles_Normalize(EULERANGLES *e)
|
||||
{
|
||||
e->alpha = fmod(e->alpha, 2 * EUL_PI);
|
||||
e->beta = fmod(e->beta, 2 * EUL_PI);
|
||||
e->gamma = fmod(e->gamma, 2 * EUL_PI);
|
||||
e->alpha = fmod(e->alpha, 2.0 * EUL_PI);
|
||||
e->beta = fmod(e->beta, 2.0 * EUL_PI);
|
||||
e->gamma = fmod(e->gamma, 2.0 * EUL_PI);
|
||||
}
|
||||
|
||||
/** @brief Normalize EulerAngles. */
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
|
||||
#define EUL_PI 3.14159265358979323846
|
||||
|
||||
#define DEG2RAD(d) ((EUL_PI / 180.0) * d)
|
||||
#define RAD2DEG(r) ((180.0 / EUL_PI) * r)
|
||||
#define DEG2RAD(d) ((EUL_PI / 180.0) * (d))
|
||||
#define RAD2DEG(r) ((180.0 / EUL_PI) * (r))
|
||||
|
||||
/**
|
||||
* Orientations are represented by 3D double precision Tait-Bryan (Euler) tuples
|
||||
|
||||
@@ -91,6 +91,10 @@ QUATERNION Quaternion_GetScalarMult(QUATERNION a, double t)
|
||||
/** @brief Divides a quaternion by a real number. */
|
||||
void Quaternion_ScalarDiv(QUATERNION *q, double t)
|
||||
{
|
||||
if (t == 0.0) {
|
||||
*q = QUATERNION_NIL;
|
||||
return;
|
||||
}
|
||||
q->s /= t;
|
||||
q->i /= t;
|
||||
q->j /= t;
|
||||
@@ -190,6 +194,9 @@ inline double Quaternion_GetRotationAngle(QUATERNION q)
|
||||
/** @brief Get axis of quaternion. */
|
||||
COORD Quaternion_GetRotationAxis(QUATERNION q)
|
||||
{
|
||||
if ((q.s > 1.0) || (q.s < -1.0)) {
|
||||
return COORD_NIL;
|
||||
}
|
||||
double sin_theta_inv;
|
||||
COORD ret;
|
||||
sin_theta_inv = 1.0 / sin(acos(q.s));
|
||||
@@ -202,6 +209,12 @@ COORD Quaternion_GetRotationAxis(QUATERNION q)
|
||||
/** @brief Get the axis and rotate angle of a unit Quaternion */
|
||||
void Quaternion_GetRotationAxisAndAngle(QUATERNION q, COORD *axis, double *angle)
|
||||
{
|
||||
if ((q.s > 1.0) || (q.s < -1.0)) {
|
||||
*axis = COORD_NIL;
|
||||
*angle = NAN;
|
||||
return;
|
||||
}
|
||||
|
||||
double sin_theta_inv;
|
||||
*angle = acos(q.s);
|
||||
|
||||
@@ -218,6 +231,11 @@ void Quaternion_GetRotationAxisAndAngle(QUATERNION q, COORD *axis, double *angle
|
||||
/** @brief Decompose the rotation on to 2 parts. */
|
||||
void Quaternion_GetSwingAndTwist(QUATERNION q, COORD axis, QUATERNION *swing, QUATERNION *twist)
|
||||
{
|
||||
if ((swing == NULL) || (twist == NULL))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
double p;
|
||||
COORD v;
|
||||
v.x = q.i;
|
||||
@@ -326,7 +344,7 @@ EULERANGLES Quaternion_ToEulerAngles(QUATERNION q, EULERANGLES_TYPE type)
|
||||
if (mask1 || mask2)
|
||||
{
|
||||
ret.alpha = 0;
|
||||
ret.gamma = (asinValue > 0) ? (2.0 * atan2(q.i, q.s)) : (-2.0 * atan2(q.i, q.s));
|
||||
ret.gamma = (asinValue > 0.0) ? (2.0 * atan2(q.i, q.s)) : (-2.0 * atan2(q.i, q.s));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -339,6 +357,7 @@ EULERANGLES Quaternion_ToEulerAngles(QUATERNION q, EULERANGLES_TYPE type)
|
||||
|
||||
default:
|
||||
ret = EULERANGLES_NIL;
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -428,7 +447,7 @@ QUATERNION Quaternion_RotationFromTo(COORD from, COORD to)
|
||||
QUATERNION Quaternion_Lerp(QUATERNION q1, QUATERNION q2, double t)
|
||||
{
|
||||
QUATERNION ret;
|
||||
Quaternion_ScalarMult(&q1, 1 - t);
|
||||
Quaternion_ScalarMult(&q1, 1.0 - t);
|
||||
Quaternion_ScalarMult(&q1, t);
|
||||
ret = Quaternion_Add(q1, q2);
|
||||
Quaternion_Normalize(&ret);
|
||||
|
||||
@@ -56,13 +56,13 @@ QUATERNION Quaternion_Add(QUATERNION q1, QUATERNION q2);
|
||||
void Quaternion_ScalarMult(QUATERNION *q, double t);
|
||||
|
||||
/** @brief Multiplies a quaternion by a real number. */
|
||||
QUATERNION Quaternion_GetScalarMult(QUATERNION a, double t);
|
||||
QUATERNION Quaternion_GetScalarMult(QUATERNION q, double t);
|
||||
|
||||
/** @brief Divides a quaternion by a real number. */
|
||||
void Quaternion_ScalarDiv(QUATERNION *q, double t);
|
||||
|
||||
/** @brief Divides a quaternion by a real number. */
|
||||
QUATERNION Quaternion_GetScalarDiv(QUATERNION a, double t);
|
||||
QUATERNION Quaternion_GetScalarDiv(QUATERNION q, double t);
|
||||
|
||||
/** @brief Multiplies two quaternions. */
|
||||
QUATERNION Quaternion_Mult(QUATERNION q1, QUATERNION q2);
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
/***************** Macros (Inline Functions) Definitions *********************/
|
||||
/**************************** Type Definitions *******************************/
|
||||
/************************** Function Prototypes ******************************/
|
||||
static void L2_RcdShift(L2_RCD *rcd, int32_t netxVal);
|
||||
static void L2_RcdShift(L2_RCD *rcd, uint32_t netxVal);
|
||||
static void UpdateMainSate(L2_INST *instPtr, L2_NODE_STATE newSate);
|
||||
static void L2_SetSlotNum(L2_INST *instPtr, uint32_t newSlotNum);
|
||||
static void L2_SetFrameNum(L2_INST *instPtr, uint32_t newFrameNum);
|
||||
@@ -50,7 +50,7 @@ static void L2_FrameStateUpdate(L2_INST *instPtr);
|
||||
/**
|
||||
* @brief Shift L2 status record.(newval->next->curr->last)
|
||||
*/
|
||||
inline void L2_RcdShift(L2_RCD *rcd, int32_t netxVal)
|
||||
inline void L2_RcdShift(L2_RCD *rcd, uint32_t netxVal)
|
||||
{
|
||||
ASSERT(rcd != NULL);
|
||||
rcd->last = rcd->curr;
|
||||
@@ -132,6 +132,7 @@ static void L2_FrameStateUpdate(L2_INST *instPtr)
|
||||
PHY_INST *phyRef = instPtr->config.phyInstPtr;
|
||||
bool isValid;
|
||||
L2_FRAME_TYPE recvType = L2_GetLastOptFrameType(instPtr);
|
||||
isValid = false;
|
||||
// Update frame state.
|
||||
if (Phy_IsFrameValid(phyRef) == false)
|
||||
{
|
||||
@@ -470,6 +471,12 @@ int32_t Linklayer_Init(L2_INST **instPtr, const L2_CONFIG *config)
|
||||
|
||||
// Clear random content
|
||||
memset(*instPtr, 0x00, sizeof(L2_INST));
|
||||
(*instPtr)->sendPktData = NULL;
|
||||
(*instPtr)->recvPktData = NULL;
|
||||
(*instPtr)->schdEventPool = NULL;
|
||||
(*instPtr)->nodeList = NULL;
|
||||
(*instPtr)->scanFSM = NULL;
|
||||
(*instPtr)->serviceFSM = NULL;
|
||||
memcpy(&((*instPtr)->config), config, sizeof(L2_CONFIG));
|
||||
|
||||
// Packet buffer
|
||||
@@ -477,15 +484,15 @@ int32_t Linklayer_Init(L2_INST **instPtr, const L2_CONFIG *config)
|
||||
if ((*instPtr)->sendPktData == NULL)
|
||||
{
|
||||
DBG_ERROR("Allocate memory for sendPktData failed.\n");
|
||||
Status = ENOMEM;
|
||||
goto init_error;
|
||||
Linklayer_Destroy(*instPtr);
|
||||
return ENOMEM;
|
||||
}
|
||||
(*instPtr)->recvPktData = calloc(L2_PACK_LEN_MAX / sizeof(uint64_t), sizeof(uint64_t));
|
||||
if ((*instPtr)->recvPktData == NULL)
|
||||
{
|
||||
DBG_ERROR("Allocate memory for recvPktData failed.\n");
|
||||
Status = ENOMEM;
|
||||
goto init_error;
|
||||
Linklayer_Destroy(*instPtr);
|
||||
return ENOMEM;
|
||||
}
|
||||
// Reset basic info
|
||||
(*instPtr)->netStartTime = NET_START_TIME_INFTY;
|
||||
@@ -528,32 +535,33 @@ int32_t Linklayer_Init(L2_INST **instPtr, const L2_CONFIG *config)
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("L2_CreateSchedEventPool runs failed, with error code: %" PRId32 ".\n", Status);
|
||||
goto init_error;
|
||||
Linklayer_Destroy(*instPtr);
|
||||
return Status;
|
||||
}
|
||||
|
||||
Status = L2_NodeList_Init(&((*instPtr)->nodeList));
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
DBG_ERROR("NodeList_Init runs failed, with error code: %" PRId32 ".\n", Status);
|
||||
goto init_error;
|
||||
Linklayer_Destroy(*instPtr);
|
||||
return Status;
|
||||
}
|
||||
|
||||
Status = L2_Scan_Init(&((*instPtr)->scanFSM));
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
goto init_error;
|
||||
Linklayer_Destroy(*instPtr);
|
||||
return Status;
|
||||
}
|
||||
|
||||
Status = L2_Service_Init(&((*instPtr)->serviceFSM));
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
goto init_error;
|
||||
Linklayer_Destroy(*instPtr);
|
||||
return Status;
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
init_error:
|
||||
Linklayer_Destroy(*instPtr);
|
||||
return Status;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
@@ -589,7 +597,7 @@ int32_t Linklayer_Reconfig(L2_INST *instPtr, const L2_CONFIG *config)
|
||||
instPtr->rtneConfig.last = NULL;
|
||||
instPtr->rtneConfig.curr = NULL;
|
||||
instPtr->rtneConfig.next = NULL;
|
||||
instPtr->cxn2Net = false;
|
||||
instPtr->cxn2Net = (config->myType == L2_NODE_HEAD) ? true : false;
|
||||
instPtr->dataAvail = false;
|
||||
instPtr->frameNum.last = 0;
|
||||
instPtr->frameNum.curr = 0;
|
||||
@@ -637,7 +645,10 @@ int32_t Linklayer_Reconfig(L2_INST *instPtr, const L2_CONFIG *config)
|
||||
******************************************************************************/
|
||||
void Linklayer_Destroy(L2_INST *instPtr)
|
||||
{
|
||||
ASSERT(instPtr != NULL);
|
||||
if (instPtr == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
free(instPtr->sendPktData);
|
||||
free(instPtr->recvPktData);
|
||||
// Destroy FSMs and nodeList
|
||||
@@ -1050,7 +1061,7 @@ int32_t Linklayer_Proc(L2_INST *instPtr)
|
||||
instPtr->linkLog.tuNum = instPtr->frameNum.curr;
|
||||
instPtr->linkLog.slotNum = (uint8_t)instPtr->slotNum.curr;
|
||||
instPtr->linkLog.nodeType = (L2_GetNodeType(instPtr) == L2_NODE_HEAD) ? 0xAA : 0xCC;
|
||||
instPtr->linkLog.cxnStatus = (instPtr->cxn2Net) ? 0x11 : 0x00;
|
||||
instPtr->linkLog.cxnStatus = (L2_isCxn2Net(instPtr)) ? 0x11 : 0x00;
|
||||
instPtr->linkLog.linkStage = (instPtr->mainState == L2_INIT_STATE) ? 0x11 : 0x22;
|
||||
instPtr->linkLog.recxnCnt = instPtr->log.reconnectCnt;
|
||||
instPtr->linkLog.beamNo = instPtr->scanFSM->beamNo;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "../../system_monitor.h"
|
||||
/************************** Constant Definitions *****************************/
|
||||
/***************** Macros (Inline Functions) Definitions *********************/
|
||||
#define AssertL2Event(instPtr, event) Linklayer_EventHandler(instPtr, event)
|
||||
#define AssertL2Event(instPtr, event) (Linklayer_EventHandler((instPtr), (event)))
|
||||
/**************************** Type Definitions *******************************/
|
||||
|
||||
/**
|
||||
|
||||
@@ -145,7 +145,7 @@ typedef enum
|
||||
typedef struct
|
||||
{
|
||||
L2_EVENT_TYPE event; ///< event type
|
||||
void *msg; ///< event message
|
||||
void *msg; ///< event message (MUST be a heap item)
|
||||
} L2_EVENT;
|
||||
|
||||
/**
|
||||
|
||||
@@ -44,7 +44,7 @@ inline uint32_t L2_GetNodeListLen(NODE_LIST *list)
|
||||
/**************************** Type Definitions *******************************/
|
||||
|
||||
/************************** Variable Definitions *****************************/
|
||||
static NODE_ENTRY util_entry;
|
||||
static NODE_ENTRY util_entry = { 0 };
|
||||
/************************** Function Prototypes ******************************/
|
||||
/**
|
||||
* @brief helper function to free node entry.
|
||||
|
||||
@@ -182,7 +182,7 @@ static void PendCfmAck(L2_SCAN_FSM *scanFsmPtr)
|
||||
******************************************************************************/
|
||||
static void StageUpdate(L2_SCAN_FSM *scanFsmPtr, SCAN_STAGE newStage)
|
||||
{
|
||||
ASSERT(newStage >= L2_SCAN_NONE_STAGE && newStage <= L2_SCAN_CFM_STAGE);
|
||||
ASSERT((newStage >= L2_SCAN_NONE_STAGE) && (newStage <= L2_SCAN_CFM_STAGE));
|
||||
DBG_INFO("ScanNet current stage: %" PRIu8 " -> ScanNet new stage: %" PRIu8 " \n",
|
||||
scanFsmPtr->scanStage, newStage);
|
||||
scanFsmPtr->scanStage = newStage;
|
||||
@@ -237,7 +237,6 @@ static int32_t Scan_InitScanHandler(L2_INST *instPtr)
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
* @brief Member node scan net BmAdvt stage handler.
|
||||
*
|
||||
@@ -252,6 +251,7 @@ static int32_t Scan_AdvHandler(L2_INST *instPtr)
|
||||
ASSERT(instPtr != NULL);
|
||||
L2_SCAN_FSM *scanFsmPtr = instPtr->scanFSM;
|
||||
PHY_INST *phyRef = instPtr->config.phyInstPtr;
|
||||
TMC_INST *tmcRef = instPtr->config.tmcInstPtr;
|
||||
DBG_INFO("** Net-Setup - Advertisement Procedure (Timeout: %" PRIu8 ") **\n", scanFsmPtr->advTimeout);
|
||||
|
||||
// if received a valid bm frame.
|
||||
@@ -264,7 +264,20 @@ static int32_t Scan_AdvHandler(L2_INST *instPtr)
|
||||
|
||||
// Update scan stage
|
||||
StageUpdate(scanFsmPtr, L2_SCAN_CFM_STAGE);
|
||||
DBG_INFO("Received Adv frame, skipping 10ms for turn around...\n");
|
||||
|
||||
// start a confirm frame reception if in the target slot
|
||||
if ((TimeCtrl_GetIntCnt(tmcRef) + 1) % CFM_FRAME_SLOTS == 0)
|
||||
{
|
||||
// using pull mode to receive confirm frame
|
||||
// since first time sync procedure is accomplished in ADV stage.
|
||||
(void)Phy_SetBeamWidth(phyRef, PHY_ANT_BEAM_16);
|
||||
(void)Phy_SetBeamNo(phyRef, scanFsmPtr->beamNo, PHY_ANT_BEAM_16);
|
||||
(void)Phy_SetMode(phyRef, PHY_MODE_PULL);
|
||||
(void)L2_SetupNextSlot(instPtr, L2_TOR_RX, L2_CFM_FRAME);
|
||||
scanFsmPtr->cfmTimeout++; // increase counter.
|
||||
instPtr->log.lastBeamWidth = PHY_ANT_BEAM_16;
|
||||
}
|
||||
// otherwise skip...
|
||||
return SUCCESS;
|
||||
}
|
||||
// no valid bm frame was received.
|
||||
@@ -274,17 +287,17 @@ static int32_t Scan_AdvHandler(L2_INST *instPtr)
|
||||
if (scanFsmPtr->advTimeout > ADV_LISTEN_TIMEOUT)
|
||||
{
|
||||
/* Antenna steering (reserved, automatically accomplished by physical layer) */
|
||||
Phy_SetBeamNo(phyRef, scanFsmPtr->beamNo, PHY_ANT_BEAM_16);
|
||||
L2_SetupNextSlot(instPtr, L2_TOR_RX, L2_SCAN_FRAME);
|
||||
(void)Phy_SetBeamNo(phyRef, scanFsmPtr->beamNo, PHY_ANT_BEAM_16);
|
||||
(void)L2_SetupNextSlot(instPtr, L2_TOR_RX, L2_SCAN_FRAME);
|
||||
DBG_WARNING("Adv timeout, restart net scan from L2_SCAN_INIT_STAGE.\n");
|
||||
L2_Scan_Reset(scanFsmPtr);
|
||||
(void)L2_Scan_Reset(scanFsmPtr);
|
||||
instPtr->log.lastBeamWidth = PHY_ANT_BEAM_16;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Antenna steering (reserved, automatically accomplished by physical layer) */
|
||||
Phy_SetBeamNo(phyRef, scanFsmPtr->beamNo, PHY_ANT_BEAM_16);
|
||||
L2_SetupNextSlot(instPtr, L2_TOR_RX, L2_ADV_FRAME);
|
||||
(void)Phy_SetBeamNo(phyRef, scanFsmPtr->beamNo, PHY_ANT_BEAM_16);
|
||||
(void)L2_SetupNextSlot(instPtr, L2_TOR_RX, L2_ADV_FRAME);
|
||||
scanFsmPtr->advTimeout++;
|
||||
instPtr->log.lastBeamWidth = PHY_ANT_BEAM_16;
|
||||
}
|
||||
@@ -319,10 +332,10 @@ static int32_t Scan_CfmHandler(L2_INST *instPtr)
|
||||
{
|
||||
// using pull mode to receive confirm frame
|
||||
// since first time sync procedure is accomplished in ADV stage.
|
||||
Phy_SetBeamWidth(phyRef, PHY_ANT_BEAM_16);
|
||||
Phy_SetBeamNo(phyRef, scanFsmPtr->beamNo, PHY_ANT_BEAM_16);
|
||||
Phy_SetMode(phyRef, PHY_MODE_PULL);
|
||||
L2_SetupNextSlot(instPtr, L2_TOR_RX, L2_CFM_FRAME);
|
||||
(void)Phy_SetBeamWidth(phyRef, PHY_ANT_BEAM_16);
|
||||
(void)Phy_SetBeamNo(phyRef, scanFsmPtr->beamNo, PHY_ANT_BEAM_16);
|
||||
(void)Phy_SetMode(phyRef, PHY_MODE_PULL);
|
||||
(void)L2_SetupNextSlot(instPtr, L2_TOR_RX, L2_CFM_FRAME);
|
||||
scanFsmPtr->cfmTimeout++; // increase counter.
|
||||
instPtr->log.lastBeamWidth = PHY_ANT_BEAM_16;
|
||||
}
|
||||
@@ -346,7 +359,7 @@ static int32_t ScanMsg_Packing(L2_INST *instPtr, L2_FRAME_TYPE type, uint8_t dst
|
||||
int32_t Status;
|
||||
uint32_t dataChunk;
|
||||
uint8_t *buff = instPtr->sendPktData;
|
||||
if (type < L2_ADV_FRAME || type > L2_CFM_FRAME)
|
||||
if ((type < L2_ADV_FRAME) || (type > L2_CFM_FRAME))
|
||||
{
|
||||
DBG_ERROR("Unexpected frame type: %" PRId8 ".\n", type);
|
||||
return EPARAM;
|
||||
@@ -593,9 +606,11 @@ int32_t L2_Scan_PktHandler(L2_INST *instPtr, uint8_t *msg)
|
||||
};
|
||||
newRtneConfig.rtneTable = initTable;
|
||||
newRtneConfig.rtnePrd = ARRAY_SIZE(initTable);
|
||||
AssertL2Event(instPtr, &rtneUpEvent);
|
||||
(void)AssertL2Event(instPtr, &rtneUpEvent);
|
||||
}
|
||||
PendCfmAck(instPtr->scanFSM);
|
||||
// Time sync.
|
||||
L2_TimeAdjust(instPtr, &(instPtr->log.timeDev));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -607,10 +622,8 @@ int32_t L2_Scan_PktHandler(L2_INST *instPtr, uint8_t *msg)
|
||||
L2_NODE_STATE newState = L2_NORMAL_STATE;
|
||||
l2Event.event = L2_EV_MAIN_STATE_UPDATE;
|
||||
l2Event.msg = &newState;
|
||||
AssertL2Event(instPtr, &l2Event);
|
||||
(void)AssertL2Event(instPtr, &l2Event);
|
||||
}
|
||||
// Time sync.
|
||||
L2_TimeAdjust(instPtr, &(instPtr->log.timeDev));
|
||||
}
|
||||
|
||||
// Get data payload
|
||||
@@ -783,7 +796,6 @@ int32_t L2_Scan_Routine(L2_INST *instPtr, const L2_RTNE_TABLE_ENTRY *rtneEntry)
|
||||
{
|
||||
ASSERT(instPtr != NULL);
|
||||
L2_TOR_TYPE torState;
|
||||
int32_t Status;
|
||||
const NODE_ENTRY *commNode;
|
||||
PHY_INST *phyRef = instPtr->config.phyInstPtr;
|
||||
DBG_INFO("-------- Scan Routine --------\n");
|
||||
@@ -815,7 +827,7 @@ int32_t L2_Scan_Routine(L2_INST *instPtr, const L2_RTNE_TABLE_ENTRY *rtneEntry)
|
||||
instPtr->log.lastBeamWidth = PHY_ANT_BEAM_16;
|
||||
if (commNode != NULL)
|
||||
{
|
||||
Phy_SetBeamNo(phyRef, commNode->nodeInfo.beamNo, PHY_ANT_BEAM_16);
|
||||
(void)Phy_SetBeamNo(phyRef, commNode->nodeInfo.beamNo, PHY_ANT_BEAM_16);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -833,7 +845,7 @@ int32_t L2_Scan_Routine(L2_INST *instPtr, const L2_RTNE_TABLE_ENTRY *rtneEntry)
|
||||
torState = L2_TOR_SUSPEND;
|
||||
}
|
||||
// Setup antenna beam
|
||||
Phy_SetBeamWidth(phyRef, PHY_ANT_BEAM_120);
|
||||
(void)Phy_SetBeamWidth(phyRef, PHY_ANT_BEAM_120);
|
||||
instPtr->log.lastBeamWidth = PHY_ANT_BEAM_120;
|
||||
}
|
||||
|
||||
@@ -843,10 +855,9 @@ int32_t L2_Scan_Routine(L2_INST *instPtr, const L2_RTNE_TABLE_ENTRY *rtneEntry)
|
||||
if (L2_GetNodeType(instPtr) != L2_NODE_HEAD && torState == L2_TOR_TX)
|
||||
{
|
||||
DBG_ERROR("Only head node can send init-scan Frame.\n");
|
||||
Status = FAILURE;
|
||||
goto routine_err;
|
||||
return FAILURE;
|
||||
}
|
||||
L2_SetupNextSlot(instPtr, torState, L2_SCAN_FRAME);
|
||||
(void)L2_SetupNextSlot(instPtr, torState, L2_SCAN_FRAME);
|
||||
break;
|
||||
|
||||
case L2_SLOT_ADVERTISE:
|
||||
@@ -855,18 +866,16 @@ int32_t L2_Scan_Routine(L2_INST *instPtr, const L2_RTNE_TABLE_ENTRY *rtneEntry)
|
||||
if (L2_GetNodeType(instPtr) != L2_NODE_HEAD)
|
||||
{
|
||||
DBG_ERROR("Only head node can send ADV Frame.\n");
|
||||
Status = FAILURE;
|
||||
goto routine_err;
|
||||
return FAILURE;
|
||||
}
|
||||
memset(instPtr->sendPktData, 0xAA, L2_PACK_LEN_MAX);
|
||||
if (ScanMsg_Packing(instPtr, L2_ADV_FRAME, rtneEntry->dst) != SUCCESS)
|
||||
{
|
||||
Status = FAILURE;
|
||||
goto routine_err;
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
/* Antenna setting (reserved.) */
|
||||
L2_SetupNextSlot(instPtr, torState, L2_ADV_FRAME);
|
||||
(void)L2_SetupNextSlot(instPtr, torState, L2_ADV_FRAME);
|
||||
break;
|
||||
|
||||
case L2_SLOT_CONFIRM:
|
||||
@@ -883,21 +892,17 @@ int32_t L2_Scan_Routine(L2_INST *instPtr, const L2_RTNE_TABLE_ENTRY *rtneEntry)
|
||||
memset(instPtr->sendPktData, 0xAA, L2_PACK_LEN_MAX);
|
||||
if (ScanMsg_Packing(instPtr, L2_CFM_FRAME, rtneEntry->dst) != SUCCESS)
|
||||
{
|
||||
Status = FAILURE;
|
||||
goto routine_err;
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
/* Antenna setting (reserved.) */
|
||||
L2_SetupNextSlot(instPtr, torState, L2_CFM_FRAME);
|
||||
(void)L2_SetupNextSlot(instPtr, torState, L2_CFM_FRAME);
|
||||
break;
|
||||
default:
|
||||
DBG_ERROR("Cannot start a routine for slot type [%" PRId8 "] properly.\n", rtneEntry->slotType);
|
||||
Status = FAILURE;
|
||||
goto routine_err;
|
||||
return FAILURE;
|
||||
}
|
||||
return SUCCESS;
|
||||
routine_err:
|
||||
return Status;
|
||||
}
|
||||
|
||||
/** @} LinkLayer_Scan*/
|
||||
|
||||
@@ -365,7 +365,7 @@ void L2_EventPoolHandler(L2_INST *instPtr)
|
||||
if (event->schdFrame == L2_GetCurrentFrameNum(instPtr) && event->schdSlot == L2_GetCurrentSlotNum(instPtr))
|
||||
{
|
||||
DBG_INFO("Asserting scheduled event [%" PRIu32 "].\n", event->eventId);
|
||||
AssertL2Event(instPtr, &(event->l2Event));
|
||||
(void)AssertL2Event(instPtr, &(event->l2Event));
|
||||
if (event->isVolatile == true)
|
||||
{
|
||||
DBG_INFO("Deleting scheduled event [%" PRIu32 "], since it is volatile.\n", event->eventId);
|
||||
|
||||
@@ -69,20 +69,20 @@
|
||||
// Regex: (([0-9]+, ){8})
|
||||
const uint16_t freqTable[L1_FRAME_MAX_HOPS] =
|
||||
{
|
||||
1084, 1097, 1110, 1123, 1136, 1149, 1162, 1175,
|
||||
1188, 1201, 1214, 1227, 1240, 1253, 1266, 1279,
|
||||
1292, 1305, 1318, 1331, 1344, 1357, 1370, 1383,
|
||||
1396, 1409, 1422, 1435, 1448, 1461, 1474, 1487,
|
||||
1500, 1513, 1526, 1539, 1552, 1565, 1578, 1591,
|
||||
1604, 1617, 1630, 1643, 1656, 1669, 1682, 1695,
|
||||
1708, 1721, 1734, 1747, 1760, 1773, 1786, 1799,
|
||||
1812, 1825, 1838, 1851, 1864, 1877, 1890, 1903,
|
||||
1916, 1929, 1942, 1955, 1968, 1981, 1994, 2007,
|
||||
2020, 2033, 2046, 2059, 2072, 2085, 2098, 2111,
|
||||
2124
|
||||
}
|
||||
1084U, 1097U, 1110U, 1123U, 1136U, 1149U, 1162U, 1175U,
|
||||
1188U, 1201U, 1214U, 1227U, 1240U, 1253U, 1266U, 1279U,
|
||||
1292U, 1305U, 1318U, 1331U, 1344U, 1357U, 1370U, 1383U,
|
||||
1396U, 1409U, 1422U, 1435U, 1448U, 1461U, 1474U, 1487U,
|
||||
1500U, 1513U, 1526U, 1539U, 1552U, 1565U, 1578U, 1591U,
|
||||
1604U, 1617U, 1630U, 1643U, 1656U, 1669U, 1682U, 1695U,
|
||||
1708U, 1721U, 1734U, 1747U, 1760U, 1773U, 1786U, 1799U,
|
||||
1812U, 1825U, 1838U, 1851U, 1864U, 1877U, 1890U, 1903U,
|
||||
1916U, 1929U, 1942U, 1955U, 1968U, 1981U, 1994U, 2007U,
|
||||
2020U, 2033U, 2046U, 2059U, 2072U, 2085U, 2098U, 2111U,
|
||||
2124U
|
||||
};
|
||||
|
||||
const uint16_t antCalTable[L1_FRAME_MAX_HOPS][L1_ANT_NUM_CH] =
|
||||
const int16_t antCalTable[L1_FRAME_MAX_HOPS][L1_ANT_NUM_CH] =
|
||||
//Antenna-JG01
|
||||
{
|
||||
{ 0, 2525, -7533, -6846}, { 0, 12726, -7818, -6860},
|
||||
@@ -135,55 +135,55 @@ const uint8_t hopPattern_2KBPS_20MS[L1_FRAME_2KBPS_20MS_HOPS] =
|
||||
|
||||
const uint8_t hopPattern_2KBPS_100MS[L1_FRAME_2KBPS_100MS_HOPS] =
|
||||
{
|
||||
0, 1, 2, 3, 4, 5, 6, 7,
|
||||
8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23,
|
||||
24, 25, 26, 27, 28, 29, 30, 31,
|
||||
32, 33, 34, 35, 36, 37, 38, 39,
|
||||
40, 41, 42, 43, 44, 45, 46, 47,
|
||||
48, 49, 50, 51, 52, 53, 54, 55,
|
||||
56, 57, 58, 59, 60, 61, 62, 63,
|
||||
64, 65, 66, 67, 68, 69, 70, 71,
|
||||
72, 73, 74, 75, 76, 77, 78, 79,
|
||||
80
|
||||
0U, 1U, 2U, 3U, 4U, 5U, 6U, 7U,
|
||||
8U, 9U, 10U, 11U, 12U, 13U, 14U, 15U,
|
||||
16U, 17U, 18U, 19U, 20U, 21U, 22U, 23U,
|
||||
24U, 25U, 26U, 27U, 28U, 29U, 30U, 31U,
|
||||
32U, 33U, 34U, 35U, 36U, 37U, 38U, 39U,
|
||||
40U, 41U, 42U, 43U, 44U, 45U, 46U, 47U,
|
||||
48U, 49U, 50U, 51U, 52U, 53U, 54U, 55U,
|
||||
56U, 57U, 58U, 59U, 60U, 61U, 62U, 63U,
|
||||
64U, 65U, 66U, 67U, 68U, 69U, 70U, 71U,
|
||||
72U, 73U, 74U, 75U, 76U, 77U, 78U, 79U,
|
||||
80U
|
||||
};
|
||||
|
||||
const uint8_t hopPattern_10KBPS_10MS[L1_FRAME_10KBPS_10MS_HOPS] =
|
||||
{
|
||||
0
|
||||
80U
|
||||
};
|
||||
|
||||
const uint8_t hopPattern_10KBPS_20MS[L1_FRAME_10KBPS_20MS_HOPS] =
|
||||
{
|
||||
0, 1, 2, 3, 4, 5, 6, 7,
|
||||
8, 9, 10
|
||||
80U, 1U, 2U, 3U, 4U, 5U, 6U, 7U,
|
||||
8U, 9U, 10U
|
||||
};
|
||||
|
||||
const uint8_t hopPattern_40KBPS_10MS[L1_FRAME_40KBPS_10MS_HOPS] =
|
||||
{
|
||||
0, 1, 2, 3, 4, 5, 6, 7,
|
||||
8,
|
||||
0U, 1U, 2U, 3U, 4U, 5U, 6U, 7U,
|
||||
8U,
|
||||
};
|
||||
|
||||
const uint8_t hopPattern_40KBPS_20MS[L1_FRAME_40KBPS_20MS_HOPS] =
|
||||
{
|
||||
0, 1, 2, 3, 4, 5, 6, 7,
|
||||
8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18
|
||||
0U, 1U, 2U, 3U, 4U, 5U, 6U, 7U,
|
||||
8U, 9U, 10U, 11U, 12U, 13U, 14U, 15U,
|
||||
16U, 17U, 18U
|
||||
};
|
||||
|
||||
const uint8_t hopPattern_200KBPS_5MS[L1_FRAME_200KBPS_5MS_HOPS] =
|
||||
{
|
||||
0, 1, 2, 3, 4, 5, 6, 7,
|
||||
8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19
|
||||
0U, 1U, 2U, 3U, 4U, 5U, 6U, 7U,
|
||||
8U, 9U, 10U, 11U, 12U, 13U, 14U, 15U,
|
||||
16U, 17U, 18U, 19U
|
||||
};
|
||||
|
||||
const uint8_t hopPattern_1M2BPS_5MS[L1_FRAME_1M2BPS_5MS_HOPS] =
|
||||
{
|
||||
0, 1, 2, 3, 4, 5, 6, 7,
|
||||
8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19
|
||||
0U, 1U, 2U, 3U, 4U, 5U, 6U, 7U,
|
||||
8U, 9U, 10U, 11U, 12U, 13U, 14U, 15U,
|
||||
16U, 17U, 18U, 19U
|
||||
};
|
||||
|
||||
/** @} PhysicalLayer_AntennaConfig_Constants*/
|
||||
@@ -220,7 +220,7 @@ void Phy_AntConfigInit(PHY_ANT_CONFIG *antConfig)
|
||||
// trSelect
|
||||
antConfig->trSlect = 0;
|
||||
// Antenna attenuation setting
|
||||
antConfig->antAtt = 20;
|
||||
antConfig->antAtt = 0;
|
||||
// phase setting
|
||||
antConfig->phase = 0;
|
||||
// ***********************
|
||||
@@ -317,7 +317,7 @@ void Phy_SetBeamTable(PHY_INST *instPtr, PHY_ANT_ANGLE *table, uint32_t offset)
|
||||
* FAILURE beamNo exceeds the table size
|
||||
*
|
||||
******************************************************************************/
|
||||
int32_t Phy_SetBeamNo(PHY_INST *instPtr, int32_t beamNo, PHY_ANT_BEAM_WIDTH beamWidth)
|
||||
int32_t Phy_SetBeamNo(PHY_INST *instPtr, size_t beamNo, PHY_ANT_BEAM_WIDTH beamWidth)
|
||||
{
|
||||
ASSERT(instPtr != NULL);
|
||||
|
||||
@@ -406,8 +406,8 @@ int32_t Phy_SetBeamAngle(PHY_INST *instPtr, double offAx, double rndAx)
|
||||
ASSERT(instPtr != NULL);
|
||||
uint16_t offAxDeg = 0;
|
||||
uint16_t rndAxDeg = 0;
|
||||
offAxDeg = (offAx >= 0) ? (((int32_t)(offAx * 180 / ANT_PI)) % 360) : (((int32_t)(offAx * 180 / ANT_PI)) % 360 + 360);
|
||||
rndAxDeg = (rndAx >= 0) ? (((int32_t)(rndAx * 180 / ANT_PI)) % 360) : (((int32_t)(rndAx * 180 / ANT_PI)) % 360 + 360);
|
||||
offAxDeg = (offAx >= 0) ? (((int32_t)(offAx * 180.0 / ANT_PI)) % 360) : (((int32_t)(offAx * 180.0 / ANT_PI)) % 360 + 360);
|
||||
rndAxDeg = (rndAx >= 0) ? (((int32_t)(rndAx * 180.0 / ANT_PI)) % 360) : (((int32_t)(rndAx * 180.0 / ANT_PI)) % 360 + 360);
|
||||
if (offAxDeg > 60)
|
||||
{
|
||||
DBG_ERROR("Angle out of range, off axis angle: %" PRIu16 " (should be 0~60), round axis angle: %" PRIu16 " (should be 0~360).\n",
|
||||
|
||||
@@ -63,10 +63,10 @@
|
||||
#define ATTN_DEFAULT 0
|
||||
#define ATTN_2KBPS_100MS ATTN_DEFAULT
|
||||
#define ATTN_2KBPS_20MS ATTN_DEFAULT
|
||||
#define ATTN_10KBPS_10MS 31
|
||||
#define ATTN_10KBPS_20MS 31
|
||||
#define ATTN_40KBPS_10MS 21
|
||||
#define ATTN_40KBPS_20MS 21
|
||||
#define ATTN_10KBPS_10MS 12
|
||||
#define ATTN_10KBPS_20MS 12
|
||||
#define ATTN_40KBPS_10MS 0
|
||||
#define ATTN_40KBPS_20MS 0
|
||||
#define ATTN_200KBPS_5MS ATTN_DEFAULT
|
||||
#define ATTN_1M2BPS_5MS ATTN_DEFAULT
|
||||
/** @} PhysicalLayer_Private_Constants*/
|
||||
@@ -335,7 +335,7 @@ inline L1_FRAME_TYPE Phy_GetLastRecvFrameType(PHY_INST *instPtr)
|
||||
{
|
||||
return L1_NONE_FRAME;
|
||||
}
|
||||
int32_t frame_type = (PhyRead(instPtr, COASE_FREQEST) & COASE_TYPE_MASK);
|
||||
uint32_t frame_type = (PhyRead(instPtr, COASE_FREQEST) & COASE_TYPE_MASK);
|
||||
switch (frame_type)
|
||||
{
|
||||
case COASE_TYPE_2KBPS_20MS:
|
||||
@@ -425,7 +425,7 @@ int32_t Phy_Init(PHY_INST **instPtr, PHY_CONFIG *phyConfig)
|
||||
|
||||
memset(&((*instPtr))->tor, PHY_TOR_SUSPEND, sizeof(PHY_RCD));
|
||||
memset(&((*instPtr)->frameType), L1_NONE_FRAME, sizeof(PHY_RCD));
|
||||
memset(&((*instPtr)->beamNo), (int32_t)L1_INIT_ANT_NO, sizeof(PHY_RCD));
|
||||
memset(&((*instPtr)->beamNo), (int32_t)L1_INIT_BEAM_NO, sizeof(PHY_RCD));
|
||||
memset(&((*instPtr)->beamWd), (int32_t)L1_INIT_ANT_WD, sizeof(PHY_RCD));
|
||||
memset(&((*instPtr)->hwSate), 0x00, sizeof(HWSTATE));
|
||||
memset(&((*instPtr)->phyLog), 0x00, sizeof(PHYLOG));
|
||||
@@ -439,14 +439,15 @@ int32_t Phy_Init(PHY_INST **instPtr, PHY_CONFIG *phyConfig)
|
||||
bramConfigPtr = XBram_LookupConfig(phyConfig->antBramId);
|
||||
if (bramConfigPtr == NULL)
|
||||
{
|
||||
Status = EDCONF;
|
||||
goto init_error;
|
||||
Phy_Destroy(*instPtr);
|
||||
return EDCONF;
|
||||
}
|
||||
Status = XBram_CfgInitialize(&antConfigBram, bramConfigPtr,
|
||||
bramConfigPtr->CtrlBaseAddress);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
goto init_error;
|
||||
Phy_Destroy(*instPtr);
|
||||
return Status;
|
||||
}
|
||||
/*
|
||||
* Execute the BRAM driver selftest.
|
||||
@@ -454,20 +455,22 @@ int32_t Phy_Init(PHY_INST **instPtr, PHY_CONFIG *phyConfig)
|
||||
Status = XBram_SelfTest(&antConfigBram, 0);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
goto init_error;
|
||||
Phy_Destroy(*instPtr);
|
||||
return Status;
|
||||
}
|
||||
|
||||
bramConfigPtr = XBram_LookupConfig(phyConfig->txBramId);
|
||||
if (bramConfigPtr == NULL)
|
||||
{
|
||||
Status = EDCONF;
|
||||
goto init_error;
|
||||
Phy_Destroy(*instPtr);
|
||||
return EDCONF;
|
||||
}
|
||||
Status = XBram_CfgInitialize(&txDataBram, bramConfigPtr,
|
||||
bramConfigPtr->CtrlBaseAddress);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
goto init_error;
|
||||
Phy_Destroy(*instPtr);
|
||||
return Status;
|
||||
}
|
||||
/*
|
||||
* Execute the BRAM driver selftest.
|
||||
@@ -475,20 +478,22 @@ int32_t Phy_Init(PHY_INST **instPtr, PHY_CONFIG *phyConfig)
|
||||
Status = XBram_SelfTest(&txDataBram, 0);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
goto init_error;
|
||||
Phy_Destroy(*instPtr);
|
||||
return Status;
|
||||
}
|
||||
|
||||
bramConfigPtr = XBram_LookupConfig(phyConfig->rxBramId);
|
||||
if (bramConfigPtr == NULL)
|
||||
{
|
||||
Status = EDCONF;
|
||||
goto init_error;
|
||||
Phy_Destroy(*instPtr);
|
||||
return EDCONF;
|
||||
}
|
||||
Status = XBram_CfgInitialize(&rxDataBram, bramConfigPtr,
|
||||
bramConfigPtr->CtrlBaseAddress);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
goto init_error;
|
||||
Phy_Destroy(*instPtr);
|
||||
return Status;
|
||||
}
|
||||
/*
|
||||
* Execute the BRAM driver selftest.
|
||||
@@ -496,7 +501,8 @@ int32_t Phy_Init(PHY_INST **instPtr, PHY_CONFIG *phyConfig)
|
||||
Status = XBram_SelfTest(&rxDataBram, 0);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
goto init_error;
|
||||
Phy_Destroy(*instPtr);
|
||||
return Status;
|
||||
}
|
||||
|
||||
(*instPtr)->antConfigAddr = antConfigBram.Config.MemBaseAddress;
|
||||
@@ -510,14 +516,15 @@ int32_t Phy_Init(PHY_INST **instPtr, PHY_CONFIG *phyConfig)
|
||||
bramConfigPtr = XBram_LookupConfig(phyConfig->antInfoBramId);
|
||||
if (bramConfigPtr == NULL)
|
||||
{
|
||||
Status = EDCONF;
|
||||
goto init_error;
|
||||
Phy_Destroy(*instPtr);
|
||||
return EDCONF;
|
||||
}
|
||||
Status = XBram_CfgInitialize(&antInfoBram, bramConfigPtr,
|
||||
bramConfigPtr->CtrlBaseAddress);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
goto init_error;
|
||||
Phy_Destroy(*instPtr);
|
||||
return Status;
|
||||
}
|
||||
/*
|
||||
* Execute the BRAM driver self test.
|
||||
@@ -525,7 +532,8 @@ int32_t Phy_Init(PHY_INST **instPtr, PHY_CONFIG *phyConfig)
|
||||
Status = XBram_SelfTest(&antInfoBram, 0);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
goto init_error;
|
||||
Phy_Destroy(*instPtr);
|
||||
return Status;
|
||||
}
|
||||
(*instPtr)->antInfoAddr = antInfoBram.Config.MemBaseAddress;
|
||||
uint32_t phyMainCtrl = PhyRead(*instPtr, PHY_MAIN_CTRL);
|
||||
@@ -545,8 +553,8 @@ int32_t Phy_Init(PHY_INST **instPtr, PHY_CONFIG *phyConfig)
|
||||
xadcConfigPtr = XAdcPs_LookupConfig(phyConfig->hwXadcId);
|
||||
if (xadcConfigPtr == NULL)
|
||||
{
|
||||
Status = EDCONF;
|
||||
goto init_error;
|
||||
Phy_Destroy(*instPtr);
|
||||
return EDCONF;
|
||||
}
|
||||
XAdcPs_CfgInitialize(&((*instPtr)->hwXadc), xadcConfigPtr, xadcConfigPtr->BaseAddress);
|
||||
|
||||
@@ -554,36 +562,37 @@ int32_t Phy_Init(PHY_INST **instPtr, PHY_CONFIG *phyConfig)
|
||||
Status = XAdcPs_SelfTest(&((*instPtr)->hwXadc));
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
goto init_error;
|
||||
Phy_Destroy(*instPtr);
|
||||
return Status;
|
||||
}
|
||||
|
||||
/* Disable the Channel Sequencer before configuring the Sequence registers. */
|
||||
XAdcPs_SetSequencerMode(&((*instPtr)->hwXadc), XADCPS_SEQ_MODE_SAFE);
|
||||
#else
|
||||
(*instPtr)->antConfigAddr = NULL;
|
||||
(*instPtr)->recvDataAddr = NULL;
|
||||
(*instPtr)->sendDataAddr = NULL;
|
||||
(*instPtr)->antConfigAddr = (uintptr_t)calloc(L1_ANTCONFIG_MAX_LEN / sizeof(uint64_t), sizeof(uint64_t));
|
||||
if ((*instPtr)->antConfigAddr == (uintptr_t)NULL)
|
||||
{
|
||||
Status = EDCONF;
|
||||
goto init_error;
|
||||
Phy_Destroy(*instPtr);
|
||||
return EDCONF;
|
||||
}
|
||||
(*instPtr)->recvDataAddr = (uintptr_t)calloc(L1_TXRXDATA_MAX_LEN / sizeof(uint64_t), sizeof(uint64_t));
|
||||
if ((*instPtr)->recvDataAddr == (uintptr_t)NULL)
|
||||
{
|
||||
Status = EDCONF;
|
||||
goto init_error;
|
||||
Phy_Destroy(*instPtr);
|
||||
return EDCONF;
|
||||
}
|
||||
(*instPtr)->sendDataAddr = (uintptr_t)calloc(L1_TXRXDATA_MAX_LEN / sizeof(uint64_t), sizeof(uint64_t));
|
||||
if ((*instPtr)->sendDataAddr == (uintptr_t)NULL)
|
||||
{
|
||||
Status = EDCONF;
|
||||
goto init_error;
|
||||
Phy_Destroy(*instPtr);
|
||||
return EDCONF;
|
||||
}
|
||||
#endif
|
||||
|
||||
return SUCCESS;
|
||||
init_error:
|
||||
Phy_Destroy(*instPtr);
|
||||
return Status;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
@@ -1027,7 +1036,7 @@ void Phy_RefreshHwSate(PHY_INST *instPtr)
|
||||
ASSERT(instPtr != NULL);
|
||||
uint32_t rawData;
|
||||
#ifndef EMULATION
|
||||
float evalData;
|
||||
double evalData;
|
||||
instPtr->hwSate.isSpOk = true;
|
||||
// -- Update FPGA voltage status;
|
||||
instPtr->hwSate.spFpgaVolt = 0;
|
||||
@@ -1152,7 +1161,7 @@ void Phy_RefreshHwSate(PHY_INST *instPtr)
|
||||
instPtr->hwSate.isAntOk = (instPtr->hwSate.antVolt == (VOLT_ANT_PROC_OK | VOLT_ANT_RF_OK | VOLT_ANT_NIL_OK | ANT_STATE_OK))
|
||||
&& (instPtr->hwSate.antPll == (CLK_ANT_BBPLL_LOCK | CLK_ANT_RFPLL0_LOCK | CLK_ANT_RFPLL1_LOCK));
|
||||
|
||||
instPtr->hwSate.phyId = instPtr.phyCofig.devId;
|
||||
instPtr->hwSate.phyId = instPtr->phyCofig.devId;
|
||||
|
||||
memset(instPtr->hwSate.reserve, 0x00, sizeof(instPtr->hwSate.reserve));
|
||||
|
||||
@@ -1250,7 +1259,7 @@ double Phy_GetCoarseFreqEst(PHY_INST *instPtr)
|
||||
double freqEst;
|
||||
|
||||
frameType = Phy_GetLastRecvFrameType(instPtr);
|
||||
if (frameType > L1_1M2BPS_5MS_FRAME || frameType <= L1_NONE_FRAME)
|
||||
if ((frameType > L1_1M2BPS_5MS_FRAME) || (frameType <= L1_NONE_FRAME))
|
||||
{
|
||||
return INFINITY; // FIXME
|
||||
}
|
||||
@@ -1288,14 +1297,14 @@ double Phy_GetFineFreqEst(PHY_INST *instPtr)
|
||||
double freqEst;
|
||||
L1_FRAME_TYPE frameType;
|
||||
frameType = Phy_GetLastRecvFrameType(instPtr);
|
||||
if (frameType > L1_1M2BPS_5MS_FRAME || frameType <= L1_NONE_FRAME)
|
||||
if ((frameType > L1_1M2BPS_5MS_FRAME) || (frameType <= L1_NONE_FRAME))
|
||||
{
|
||||
return INFINITY; // FIXME
|
||||
}
|
||||
|
||||
regValue = PhyRead(instPtr, FINE_FREQEST);
|
||||
estAbs = regValue & FINE_FREQEST_VAL_MASK;
|
||||
if (frameType >= L1_200KBPS_5MS_FRAME)
|
||||
if ((frameType >= L1_200KBPS_5MS_FRAME))
|
||||
{
|
||||
// 12M Rc
|
||||
freqEst = 48e6 / 2048 * ((double)estAbs) / 8192.0;
|
||||
|
||||
@@ -34,24 +34,24 @@
|
||||
* @name PhysicalLayer_Common_Constant
|
||||
* @{
|
||||
*/
|
||||
#define L1_NUM_ANT_NRRW_PATTERN 37
|
||||
#define L1_INIT_BEAM_NO 0
|
||||
#define L1_NUM_ANT_NRRW_PATTERN 37U
|
||||
#define L1_INIT_BEAM_NO 0U
|
||||
#define L1_INIT_ANT_WD PHY_ANT_BEAM_120
|
||||
#define L1_ANT_NUM_CH 4
|
||||
#define L1_ANT_NUM_CH 4U
|
||||
|
||||
#define L1_FRAME_NONE_LEN UINT32_MAX // byte
|
||||
#define L1_FRAME_NONE_COMP UINT32_MAX // *10ns(Timer_L)
|
||||
#define L1_FRAME_NONE_HOPS UINT32_MAX
|
||||
#define L1_FRAME_MAX_HOPS 81
|
||||
#define L1_FRAME_2KBPS_20MS_HOPS 1
|
||||
#define L1_FRAME_2KBPS_100MS_HOPS 81
|
||||
#define L1_FRAME_10KBPS_10MS_HOPS 1
|
||||
#define L1_FRAME_10KBPS_20MS_HOPS 11
|
||||
#define L1_FRAME_40KBPS_20MS_HOPS 19
|
||||
#define L1_FRAME_40KBPS_10MS_HOPS 9
|
||||
#define L1_FRAME_200KBPS_5MS_HOPS 20
|
||||
#define L1_FRAME_1M2BPS_5MS_HOPS 20
|
||||
#define PHY_LOG_EXPIRE 40 // 50*5ms
|
||||
#define L1_FRAME_MAX_HOPS 81U
|
||||
#define L1_FRAME_2KBPS_20MS_HOPS 1U
|
||||
#define L1_FRAME_2KBPS_100MS_HOPS 81U
|
||||
#define L1_FRAME_10KBPS_10MS_HOPS 1U
|
||||
#define L1_FRAME_10KBPS_20MS_HOPS 11U
|
||||
#define L1_FRAME_40KBPS_20MS_HOPS 19U
|
||||
#define L1_FRAME_40KBPS_10MS_HOPS 9U
|
||||
#define L1_FRAME_200KBPS_5MS_HOPS 20U
|
||||
#define L1_FRAME_1M2BPS_5MS_HOPS 20U
|
||||
#define PHY_LOG_EXPIRE 40U // 50*5ms
|
||||
/** @} */
|
||||
/***************** Macros (Inline Functions) Definitions *********************/
|
||||
/**************************** Type Definitions *******************************/
|
||||
@@ -306,7 +306,7 @@ void Phy_AntConfigInit(PHY_ANT_CONFIG *antConfig);
|
||||
void Phy_AntConfigMode(PHY_INST *instPtr, PHY_ANT_MODE mode);
|
||||
void Phy_SetBeamTable(PHY_INST *instPtr, PHY_ANT_ANGLE *table, uint32_t offset);
|
||||
int32_t Phy_SetBeamWidth(PHY_INST *instPtr, PHY_ANT_BEAM_WIDTH beamWidth);
|
||||
int32_t Phy_SetBeamNo(PHY_INST *instPtr, int32_t beamNo, PHY_ANT_BEAM_WIDTH beamWidth);
|
||||
int32_t Phy_SetBeamNo(PHY_INST *instPtr, size_t beamNo, PHY_ANT_BEAM_WIDTH beamWidth);
|
||||
int32_t Phy_SetBeamAngle(PHY_INST *phyInstPtr, double offAx, double rndAx);
|
||||
/** @} PhysicalLayer_AntennaControl*/
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
#include "util.h"
|
||||
|
||||
/***************** Macros (Inline Functions) Definitions *********************/
|
||||
#define PhyRead(instPtr, addr) IO_In32((instPtr)->phyCofig.baseAddr + addr)
|
||||
#define PhyWrite(instPtr, addr, value) IO_Out32((instPtr)->phyCofig.baseAddr + addr, value)
|
||||
#define PhyRead(instPtr, addr) IO_In32((instPtr)->phyCofig.baseAddr + (addr))
|
||||
#define PhyWrite(instPtr, addr, value) IO_Out32((instPtr)->phyCofig.baseAddr + (addr), (value))
|
||||
|
||||
/************************** Constant Definitions *****************************/
|
||||
/**
|
||||
|
||||
@@ -127,6 +127,7 @@ void SysMonitor_Destroy(void)
|
||||
*/
|
||||
void SysMonitor_UpdateSysinfo(const SYSINFO *info)
|
||||
{
|
||||
ASSERT(info != NULL);
|
||||
uint8_t buffIndx;
|
||||
buffIndx = GetWritable(sysMonitorInst->sysInfoCtrl);
|
||||
sysMonitorInst->sysInfoCtrl.wBusy = buffIndx;
|
||||
@@ -143,6 +144,7 @@ void SysMonitor_UpdateSysinfo(const SYSINFO *info)
|
||||
void SysMonitor_GetSysinfo(SYSINFO *info)
|
||||
{
|
||||
ASSERT(sysMonitorInst != NULL);
|
||||
ASSERT(info != NULL);
|
||||
uint8_t buffIndx, buffIndex_old;
|
||||
buffIndex_old = sysMonitorInst->sysInfoCtrl.rBusy;
|
||||
if (buffIndex_old != BUFF_NONE)
|
||||
@@ -201,9 +203,13 @@ void SysMonitor_GetSendPayload(uint8_t *buff, uint32_t *id, size_t len)
|
||||
uint8_t buffIndx, buffIndex_old;
|
||||
buffIndex_old = sysMonitorInst->sendCtrl.rBusy;
|
||||
if (buffIndex_old != BUFF_NONE)
|
||||
{
|
||||
buffIndx = buffIndex_old; // Keep it busy
|
||||
}
|
||||
else
|
||||
{
|
||||
buffIndx = GetReadable(sysMonitorInst->sendCtrl);
|
||||
}
|
||||
sysMonitorInst->sendCtrl.rBusy = buffIndx;
|
||||
if (sysMonitorInst->send[buffIndx].dataId != DATA_ID_NONE)
|
||||
{
|
||||
|
||||
@@ -54,12 +54,12 @@
|
||||
// #define IS_PL_VALID(x) (x <= 1.03 && x >= 0.97)
|
||||
// #define IS_PLAUX_VALID(x) (x <= 1.89 && x >= 1.71)
|
||||
// #define IS_BRAM_VALID(x) (x <= 1.03 && x >= 0.97)
|
||||
#define IS_PS_VALID(x) (x <= 1.05 && x >= 0.95)
|
||||
#define IS_PSAUX_VALID(x) (x <= 1.89 && x >= 1.71)
|
||||
#define IS_DDR_VALID(x) (x <= 1.89 && x >= 1.14)
|
||||
#define IS_PL_VALID(x) (x <= 1.03 && x >= 0.96)
|
||||
#define IS_PLAUX_VALID(x) (x <= 1.89 && x >= 1.71)
|
||||
#define IS_BRAM_VALID(x) (x <= 1.03 && x >= 0.96)
|
||||
#define IS_PS_VALID(x) ((x) <= 1.1 && (x) >= 0.9)
|
||||
#define IS_PSAUX_VALID(x) ((x) <= 2.0 && (x) >= 1.6)
|
||||
#define IS_DDR_VALID(x) ((x) <= 1.7 && (x) >= 1.3)
|
||||
#define IS_PL_VALID(x) (x <= 1.1 && (x) >= 0.9)
|
||||
#define IS_PLAUX_VALID(x) ((x) <= 2.0 && (x) >= 1.6)
|
||||
#define IS_BRAM_VALID(x) ((x) <= 1.1 && (x) >= 0.9)
|
||||
|
||||
#define CLK_SP_PLL0_LOCK BIT(0)
|
||||
#define CLK_SP_PLL1_LOCK BIT(2)
|
||||
@@ -194,17 +194,17 @@ typedef struct __attribute__((packed))
|
||||
uint8_t spFpgaVolt; ///< Signal processor voltage state indicator
|
||||
uint8_t spClkState; ///< Signal processor clock state indicator
|
||||
uint8_t spAdLockState; ///< Signal processor adc lock state indicator
|
||||
uint8_t spAdTemp_0; ///< Signal processor adc0 temperature
|
||||
uint8_t spAdTemp_1; ///< Signal processor adc1 temperature
|
||||
uint8_t spFpgaTemp; ///< Signal processor FPGA temperature
|
||||
int8_t spAdTemp_0; ///< Signal processor adc0 temperature
|
||||
int8_t spAdTemp_1; ///< Signal processor adc1 temperature
|
||||
int8_t spFpgaTemp; ///< Signal processor FPGA temperature
|
||||
// -- Antenna status
|
||||
uint8_t antVolt; ///< Antenna voltage state indicator
|
||||
uint8_t antTemp; ///< Antenna rf temperature
|
||||
int8_t antTemp; ///< Antenna rf temperature
|
||||
uint8_t antPll; ///< Antenna rf lock state indicator
|
||||
uint8_t antMgc0; ///< Antenna rf mgc0~1 indicator
|
||||
uint8_t antMgc1; ///< Antenna rf mgc2~3 indicator
|
||||
uint8_t phyId;
|
||||
uint8_t reserve;
|
||||
uint8_t reserve[1];
|
||||
} HWSTATE;
|
||||
|
||||
/**
|
||||
|
||||
@@ -658,7 +658,7 @@ int32_t SystemBus_MakeResp(SYSBUS *instPtr)
|
||||
* @param InstPtr A double pointer to System Bus instance.
|
||||
* @param config A pointer to System Bus configurations.
|
||||
*
|
||||
* @return None.
|
||||
* @return Error code.
|
||||
*
|
||||
******************************************************************************/
|
||||
int32_t SystemBus_Init(SYSBUS **instPtr, SYSBUS_CONFIG *config)
|
||||
@@ -670,7 +670,7 @@ int32_t SystemBus_Init(SYSBUS **instPtr, SYSBUS_CONFIG *config)
|
||||
(*instPtr) = malloc(sizeof(SYSBUS));
|
||||
if ((*instPtr) == NULL)
|
||||
{
|
||||
return FAILURE;
|
||||
return ENOMEM;
|
||||
}
|
||||
(*instPtr)->rxQueue = NULL;
|
||||
(*instPtr)->txQueue = NULL;
|
||||
@@ -684,29 +684,45 @@ int32_t SystemBus_Init(SYSBUS **instPtr, SYSBUS_CONFIG *config)
|
||||
Status = SysbusUart_Init(&((*instPtr)->uartInst), &uartConfig);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
Status = ENOMEM;
|
||||
goto sysbus_init_error;
|
||||
SystemBus_Destroy(*instPtr);
|
||||
return ENOMEM;
|
||||
}
|
||||
if (CircQueueCreate(&((*instPtr)->txQueue), (*instPtr)->config.txQueueMax) == false)
|
||||
{
|
||||
Status = ENOMEM;
|
||||
goto sysbus_init_error;
|
||||
SystemBus_Destroy(*instPtr);
|
||||
return ENOMEM;
|
||||
}
|
||||
if (CircQueueCreate(&((*instPtr)->rxQueue), (*instPtr)->config.rxQueueMax) == false)
|
||||
{
|
||||
Status = ENOMEM;
|
||||
goto sysbus_init_error;
|
||||
SystemBus_Destroy(*instPtr);
|
||||
return ENOMEM;
|
||||
}
|
||||
(*instPtr)->isRxDone = false; // nothing received.
|
||||
(*instPtr)->isTxDone = true; // nothing to be sent.
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
sysbus_init_error:
|
||||
free((*instPtr)->uartInst);
|
||||
free((*instPtr)->txQueue);
|
||||
free((*instPtr)->rxQueue);
|
||||
free(*instPtr);
|
||||
return Status;
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* @brief Destroy System Bus instance.
|
||||
*
|
||||
* @param InstPtr A pointer to System Bus instance.
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
******************************************************************************/
|
||||
void SystemBus_Destroy(SYSBUS *instPtr)
|
||||
{
|
||||
if (instPtr == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
free(instPtr->uartInst);
|
||||
free(instPtr->txQueue);
|
||||
free(instPtr->rxQueue);
|
||||
free(instPtr);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
@@ -748,19 +764,17 @@ int32_t SystemBus_RxIntrHandler(SYSBUS *instPtr)
|
||||
Status = SysbusUart_Recv(instPtr->uartInst, sysbusReq);
|
||||
if (Status != SUCCESS)
|
||||
{
|
||||
goto recv_error;
|
||||
free(sysbusReq);
|
||||
return Status;
|
||||
}
|
||||
if (CircQueuePush(instPtr->rxQueue, (void *)sysbusReq) == false)
|
||||
{
|
||||
DBG_ERROR("SystemBus::RX Queue overflowed!\n");
|
||||
Status = EQUEUE;
|
||||
goto recv_error;
|
||||
free(sysbusReq);
|
||||
return EQUEUE;
|
||||
}
|
||||
instPtr->isRxDone = false; // another reception is undergoing.
|
||||
return SUCCESS;
|
||||
recv_error:
|
||||
free(sysbusReq);
|
||||
return Status;
|
||||
}
|
||||
|
||||
/** @} SystemBus*/
|
||||
@@ -60,6 +60,7 @@ typedef struct
|
||||
/************************** Function Prototypes ******************************/
|
||||
|
||||
int32_t SystemBus_Init(SYSBUS **instPtr, SYSBUS_CONFIG *config);
|
||||
void SystemBus_Destroy(SYSBUS *instPtr);
|
||||
|
||||
/**
|
||||
* @defgroup SystemBus_Protocol_Routine
|
||||
|
||||
@@ -54,7 +54,7 @@ bool CircQueueCreate(CIRC_QUEUE **q, uint32_t queueCapacity)
|
||||
ASSERT(q != NULL);
|
||||
CIRC_QUEUE *queue;
|
||||
queue = malloc(sizeof(CIRC_QUEUE));
|
||||
if (!queue)
|
||||
if (queue == NULL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -65,16 +65,14 @@ bool CircQueueCreate(CIRC_QUEUE **q, uint32_t queueCapacity)
|
||||
queue->data = malloc(queueCapacity * sizeof(void *));
|
||||
if (queue->data == NULL)
|
||||
{
|
||||
goto error;
|
||||
free(queue);
|
||||
return false;
|
||||
}
|
||||
queue->bounds = queueCapacity;
|
||||
queue->nelts = 0;
|
||||
queue->in = 0;
|
||||
queue->out = 0;
|
||||
return true;
|
||||
error:
|
||||
free(queue);
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,10 +9,8 @@ PROJECT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
|
||||
echo "Creating <df_datalink_ge>..."
|
||||
cp -rL $PROJECT_DIR/df_datalink_ge/src $DST_DIR/df_datalink_ge
|
||||
cd $DST_DIR/df_datalink_ge
|
||||
sed -i'' -e "s/antConfig->rfTxMgc = 0;/antConfig->rfTxMgc = $GE_TXATT;/g" ./networking/phy_layer/phy_antenna.c
|
||||
sed -i'' -e "s/antConfig->rcvMgc = 0;/antConfig->rcvMgc = $GE_RXATT;/g" ./networking/phy_layer/phy_antenna.c
|
||||
cd $DST_DIR
|
||||
sed -i'' -e "s/antConfig->rfTxMgc = 0;/antConfig->rfTxMgc = $GE_TXATT;/g" $DST_DIR/df_datalink_ge/networking/phy_layer/phy_antenna.c
|
||||
sed -i'' -e "s/antConfig->rcvMgc = 0;/antConfig->rcvMgc = $GE_RXATT;/g" $DST_DIR/df_datalink_ge/networking/phy_layer/phy_antenna.c
|
||||
|
||||
# SP Software
|
||||
source $PROJECT_DIR/caldata
|
||||
@@ -20,19 +18,24 @@ source $PROJECT_DIR/caldata
|
||||
for key in ${!calMap[*]};do
|
||||
projName=df_datalink_$key
|
||||
id=$(echo "$key" | grep -o -E '[0-9]+')
|
||||
type=$(echo "$key" | grep -o -E '(LJ)|(JG)')
|
||||
echo "Creating <$projName>..."
|
||||
cp -rL $PROJECT_DIR/df_datalink_sp/src $DST_DIR/$projName
|
||||
cd $DST_DIR/$projName
|
||||
|
||||
# subtitite ID
|
||||
sed -i'' "s/#define PHY_DEVICE_ID 0/#define PHY_DEVICE_ID $id/g"
|
||||
|
||||
# subtitute table
|
||||
# substitute ID
|
||||
if [ $type == "LJ" ]; then
|
||||
sed -i'' "s/#define PHY_DEVICE_ID 0/#define PHY_DEVICE_ID (0x$id | 0x80)/g" $DST_DIR/$projName/config/app_config.h
|
||||
elif [ $type == "JG" ]; then
|
||||
sed -i'' "s/#define PHY_DEVICE_ID 0/#define PHY_DEVICE_ID (0x$id | 0x00)/g" $DST_DIR/$projName/config/app_config.h
|
||||
else
|
||||
echo "Unrecognized node Type [$type] ID [$id]"
|
||||
exit 1
|
||||
fi
|
||||
# substitute table
|
||||
sed -i'' "/^const uint16_t antCalTable\[L1_FRAME_MAX_HOPS\]\[L1_ANT_NUM_CH\] =/{
|
||||
:table
|
||||
N
|
||||
/\};/!b table
|
||||
s/=.*\};/=\n\/\/Antenna-$key\n$calMap[$key]/
|
||||
}" ./networking/phy_layer/phy_antenna.c
|
||||
cd $DST_DIR
|
||||
s/=.*\};/=\n\/\/Antenna-$key\n${calMap[$key]}/
|
||||
}" $DST_DIR/$projName/networking/phy_layer/phy_antenna.c
|
||||
done
|
||||
Reference in New Issue
Block a user