Commit 0102bab3 authored by Léo-Paul Géneau's avatar Léo-Paul Géneau 👾

Use asynchronous calls to loiter and set speed

parent c7a17ee0
...@@ -648,8 +648,8 @@ static JSValue js_loiter(JSContext *ctx, JSValueConst thisVal, ...@@ -648,8 +648,8 @@ static JSValue js_loiter(JSContext *ctx, JSValueConst thisVal,
if (JS_ToFloat64(ctx, &radius, argv[3])) if (JS_ToFloat64(ctx, &radius, argv[3]))
return JS_EXCEPTION; return JS_EXCEPTION;
return JS_NewInt32(ctx, loiter(la_arg_double, lo_arg_double, loiter(la_arg_double, lo_arg_double, (float)a_arg_double, (float)radius);
(float)a_arg_double, (float)radius)); return JS_NewInt32(ctx, 0);
} }
static JSValue js_setAirSpeed(JSContext *ctx, JSValueConst thisVal, static JSValue js_setAirSpeed(JSContext *ctx, JSValueConst thisVal,
...@@ -660,7 +660,8 @@ static JSValue js_setAirSpeed(JSContext *ctx, JSValueConst thisVal, ...@@ -660,7 +660,8 @@ static JSValue js_setAirSpeed(JSContext *ctx, JSValueConst thisVal,
if (JS_ToFloat64(ctx, &altitude, argv[0])) if (JS_ToFloat64(ctx, &altitude, argv[0]))
return JS_EXCEPTION; return JS_EXCEPTION;
return JS_NewInt32(ctx, setAirSpeed((float)altitude)); setAirSpeed_async((float)altitude);
return JS_NewInt32(ctx, 0);
} }
static JSValue js_setTargetCoordinates(JSContext *ctx, static JSValue js_setTargetCoordinates(JSContext *ctx,
...@@ -678,9 +679,8 @@ static JSValue js_setTargetCoordinates(JSContext *ctx, ...@@ -678,9 +679,8 @@ static JSValue js_setTargetCoordinates(JSContext *ctx,
if (JS_ToFloat64(ctx, &a_arg_double, argv[2])) if (JS_ToFloat64(ctx, &a_arg_double, argv[2]))
return JS_EXCEPTION; return JS_EXCEPTION;
return JS_NewInt32(ctx, setTargetCoordinates(la_arg_double, setTargetCoordinates(la_arg_double, lo_arg_double, (float)a_arg_double);
lo_arg_double, return JS_NewInt32(ctx, 0);
(float)a_arg_double));
} }
// Information functions // Information functions
...@@ -746,7 +746,8 @@ static JSValue js_healthAllOk(JSContext *ctx, JSValueConst this_val, ...@@ -746,7 +746,8 @@ static JSValue js_healthAllOk(JSContext *ctx, JSValueConst this_val,
static JSValue js_updateLogAndProjection(JSContext *ctx, JSValueConst this_val, static JSValue js_updateLogAndProjection(JSContext *ctx, JSValueConst this_val,
int argc, JSValueConst *argv) int argc, JSValueConst *argv)
{ {
return JS_NewInt32(ctx, updateLogAndProjection()); updateLogAndProjection();
return JS_NewInt32(ctx, 0);
} }
static const JSCFunctionListEntry js_funcs[] = { static const JSCFunctionListEntry js_funcs[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment