mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-22 07:44:03 -04:00
AP_Scripting: added micros()
This commit is contained in:
parent
1bc9001267
commit
d7b20c6e48
@ -35,9 +35,20 @@ static int lua_millis(lua_State *L) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// micros
|
||||
static int lua_micros(lua_State *L) {
|
||||
check_arguments(L, 0, "micros");
|
||||
|
||||
new_uint32_t(L);
|
||||
*check_uint32_t(L, -1) = AP_HAL::micros();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static const luaL_Reg global_functions[] =
|
||||
{
|
||||
{"millis", lua_millis},
|
||||
{"micros", lua_micros},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user