AP_Scripting: removed old servo output binding

This commit is contained in:
Andrew Tridgell committed 2020-04-28 11:14:26 +10:00
1 parent d214e379a2
commit b1977ca43d
2 files changed
+1 -29

No files matched your search

-28
View File
@@ -24,24 +24,6 @@ int check_arguments(lua_State *L, int expected_arguments, const char *fn_name) {
return 0;
}
// servo binding
static int lua_servo_set_output_pwm(lua_State *L) {
check_arguments(L, 2, "set_output_pwm");
const SRV_Channel::Aux_servo_function_t servo_function = (SRV_Channel::Aux_servo_function_t)luaL_checkinteger(L, -2);
luaL_argcheck(L, ((servo_function >= SRV_Channel::Aux_servo_function_t::k_scripting1) &&
(servo_function <= SRV_Channel::Aux_servo_function_t::k_scripting16)),
2, "function out of range");
const int output = luaL_checknumber(L, -1);
luaL_argcheck(L, ((output >= 0) && (output <= UINT16_MAX)), 2, "output out of range");
SRV_Channels::set_output_pwm((SRV_Channel::Aux_servo_function_t)servo_function, output);
return 0;
}
// millis
static int lua_millis(lua_State *L) {
check_arguments(L, 0, "millis");
@@ -58,17 +40,7 @@ static const luaL_Reg global_functions[] =
{NULL, NULL}
};
static const luaL_Reg servo_functions[] =
{
{"set_output_pwm", lua_servo_set_output_pwm},
{NULL, NULL}
};
void load_lua_bindings(lua_State *L) {
lua_pushstring(L, "servo");
luaL_newlib(L, servo_functions);
lua_settable(L, -3);
luaL_setfuncs(L, global_functions, 0);
}