1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-15 04:15:26 +03:00

Add constants for LUA telemetry (#3990)

* Add constants for LUA telemetry

This commit added 896 bytes to flash size which is a significant size. An alternative would to just document the values in the lua telemetry function.

Shortening some of the UNIT names (e.g. UNIT_MW instead of UNIT_milliwatts) or shortening UNIT_ to U_ could save a few bytes but the

* #if 0 ... #endif constants

* horus has 2MB flash
This commit is contained in:
Arne Schwabe 2016-11-06 18:29:10 +01:00 committed by Bertrand Songis
parent 3b3b528bbf
commit 345ea0f3e8

View file

@ -1196,5 +1196,41 @@ const luaR_value_entry opentxConstants[] = {
{ "PLAY_NOW", PLAY_NOW },
{ "PLAY_BACKGROUND", PLAY_BACKGROUND },
{ "TIMEHOUR", TIMEHOUR },
#if defined(PCBHORUS)
// Adding the unit consts for the set Telemetry function adds about 1k of flash usage
{"UNIT_RAW", UNIT_RAW },
{"UNIT_VOLTS", UNIT_VOLTS },
{"UNIT_AMPS", UNIT_AMPS },
{"UNIT_MILLIAMPS", UNIT_MILLIAMPS },
{"UNIT_KTS", UNIT_KTS },
{"UNIT_METERS_PER_SECOND", UNIT_METERS_PER_SECOND },
{"UNIT_FEET_PER_SECOND", UNIT_FEET_PER_SECOND },
{"UNIT_KMH", UNIT_KMH },
{"UNIT_MPH", UNIT_MPH },
{"UNIT_METERS", UNIT_METERS },
{"UNIT_FEET", UNIT_FEET },
{"UNIT_CELSIUS", UNIT_CELSIUS },
{"UNIT_FAHRENHEIT", UNIT_FAHRENHEIT },
{"UNIT_PERCENT", UNIT_PERCENT },
{"UNIT_MAH", UNIT_MAH },
{"UNIT_WATTS", UNIT_WATTS },
{"UNIT_MILLIWATTS", UNIT_MILLIWATTS },
{"UNIT_DB", UNIT_DB },
{"UNIT_RPMS", UNIT_RPMS },
{"UNIT_G", UNIT_G },
{"UNIT_DEGREE", UNIT_DEGREE },
{"UNIT_RADIANS", UNIT_RADIANS },
{"UNIT_MILLILITERS", UNIT_MILLILITERS },
{"UNIT_FLOZ", UNIT_FLOZ },
{"UNIT_HOURS", UNIT_HOURS },
{"UNIT_MINUTES", UNIT_MINUTES },
{"UNIT_SECONDS", UNIT_SECONDS },
{"UNIT_CELLS", UNIT_CELLS},
{"UNIT_DATETIME", UNIT_DATETIME},
{"UNIT_GPS", UNIT_GPS},
{"UNIT_BITFIELD", UNIT_BITFIELD},
{"UNIT_TEXT", UNIT_TEXT},
#endif
{ NULL, 0 } /* sentinel */
};