parent
0d87acc8a4
commit
ae37c269b8
|
@ -85,7 +85,7 @@ static int getSensor(lua_State* l, SensorType type) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lua_getAuxAnalog(lua_State* l) {
|
static int lua_getAuxAnalog(lua_State* l) {
|
||||||
// todo: shall we use HUMAN_INDEX since UI goes from 1 and Lua loves going from 1?
|
// todo: shall we use HUMAN_OFFSET since UI goes from 1 and Lua loves going from 1?
|
||||||
auto zeroBasedSensorIndex = luaL_checkinteger(l, 1);
|
auto zeroBasedSensorIndex = luaL_checkinteger(l, 1);
|
||||||
|
|
||||||
auto type = static_cast<SensorType>(zeroBasedSensorIndex + static_cast<int>(SensorType::AuxAnalog1));
|
auto type = static_cast<SensorType>(zeroBasedSensorIndex + static_cast<int>(SensorType::AuxAnalog1));
|
||||||
|
|
|
@ -32,6 +32,7 @@ inline uint32_t SWAP_UINT32(uint32_t x)
|
||||||
|
|
||||||
#define BIT(n) (UINT32_C(1) << (n))
|
#define BIT(n) (UINT32_C(1) << (n))
|
||||||
|
|
||||||
|
// also known as 'HUMAN_INDEX'
|
||||||
#define HUMAN_OFFSET 1
|
#define HUMAN_OFFSET 1
|
||||||
|
|
||||||
// human-readable IDs start from 1 while computer-readable indices start from 0
|
// human-readable IDs start from 1 while computer-readable indices start from 0
|
||||||
|
|
Loading…
Reference in New Issue