From cc4be69e76709579c80efcc24801004461011c46 Mon Sep 17 00:00:00 2001
From: yy1717 <fctom1215@outlook.com>
Date: 星期二, 14 一月 2020 11:17:09 +0800
Subject: [PATCH] s
---
lib/src/main/cpp/master/comm_if.cpp | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/lib/src/main/cpp/master/comm_if.cpp b/lib/src/main/cpp/master/comm_if.cpp
index 360227d..578b2e5 100644
--- a/lib/src/main/cpp/master/comm_if.cpp
+++ b/lib/src/main/cpp/master/comm_if.cpp
@@ -21,6 +21,7 @@
using namespace std;
#define ID_SM_NDK_START 0x0001
+#define ID_MS_NDK_ACK 0x8001
#define ID_SM_REQ_RTK_PLAT_CFG 0x0002
#define ID_MS_RTK_PLAT_CFG 0x8002
#define ID_SM_RTK_PLAT_CONN 0x0003
@@ -41,7 +42,7 @@
#define ID_SM_ENTER_MAP 0x000D
#define ID_SM_CAR 0x000E
-static int OnOff = 0;
+static int OnOff = 0xFFFF;
void MA_NdkStart(void)
{
@@ -374,7 +375,9 @@
if (map_index == 0) {
int i = 0, j = 0;
pointNum = s2.Size()/2;
- map = new double[pointNum][2];
+ map = (double (*)[2]) new double[pointNum][2];
+// map = (double (*)[2]) malloc(pointNum * 2 * sizeof(double));
+
for (Value::ConstValueIterator itr3 = s2.Begin();
itr3 != s2.End(); ++itr3) {
map[i][j] = (*itr3).GetDouble();
@@ -386,7 +389,9 @@
} else if (map_index == 1) {
int i = 0, j = 0;
point2Num = s2.Size()/2;
- map2 = new double[s2.Size()][2];
+ map2 = (double (*)[2]) new double[s2.Size()][2];
+// map2 = (double (*)[2]) malloc(point2Num * 2 * sizeof(double));
+
for (Value::ConstValueIterator itr3 = s2.Begin();
itr3 != s2.End(); ++itr3) {
map2[i][j] = (*itr3).GetDouble();
@@ -484,7 +489,8 @@
if (s.IsArray()) {
int i = 0, j = 0;
pointNum = s.Size()/2;
- point = new double[pointNum][2];
+ point = (double (*)[2]) new double[pointNum][2];
+// point = (double (*)[2])malloc(pointNum * 2 * sizeof(double));
for(Value::ConstValueIterator itr = s.Begin(); itr != s.End(); ++itr) {
point[i][j] = itr->GetDouble();
@@ -512,7 +518,7 @@
if (a.IsArray() && a.Size() > 0) {
int n = a.Size();
int i = 0;
- int (*sensor)[2] = new int[n][2];
+ int (*sensor)[2] = (int (*)[2]) new int[n][2];
for (Value::ConstValueIterator itr = a.Begin(); itr != a.End(); ++itr) {
// a gpio mapping
--
Gitblit v1.8.0