Commit 6ca1df64 authored by Léo-Paul Géneau's avatar Léo-Paul Géneau 👾

Use asynchronous calls to loiter and set speed

parent f37302b2
......@@ -647,8 +647,8 @@ static JSValue js_loiter(JSContext *ctx, JSValueConst thisVal,
if (JS_ToFloat64(ctx, &radius, argv[3]))
return JS_EXCEPTION;
return JS_NewInt32(ctx, loiter(la_arg_double, lo_arg_double,
(float)a_arg_double, (float)radius));
loiter(la_arg_double, lo_arg_double, (float)a_arg_double, (float)radius);
return JS_NewInt32(ctx, 0);
}
static JSValue js_setAirSpeed(JSContext *ctx, JSValueConst thisVal,
......@@ -659,7 +659,8 @@ static JSValue js_setAirSpeed(JSContext *ctx, JSValueConst thisVal,
if (JS_ToFloat64(ctx, &altitude, argv[0]))
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,
......@@ -677,9 +678,8 @@ static JSValue js_setTargetCoordinates(JSContext *ctx,
if (JS_ToFloat64(ctx, &a_arg_double, argv[2]))
return JS_EXCEPTION;
return JS_NewInt32(ctx, setTargetCoordinates(la_arg_double,
lo_arg_double,
(float)a_arg_double));
setTargetCoordinates(la_arg_double, lo_arg_double, (float)a_arg_double);
return JS_NewInt32(ctx, 0);
}
// Information functions
......@@ -745,7 +745,8 @@ static JSValue js_healthAllOk(JSContext *ctx, JSValueConst this_val,
static JSValue js_updateLogAndProjection(JSContext *ctx, JSValueConst this_val,
int argc, JSValueConst *argv)
{
return JS_NewInt32(ctx, updateLogAndProjection());
updateLogAndProjection();
return JS_NewInt32(ctx, 0);
}
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