feat(lua): Port of NodeMCU Lua53 read-only tables (#2994)

* chore(lua): revert useless c light function change

This change was part of the eLua LTR patches (based on 5.1), whereby this feature was already integrated in Lua 5.2.

* feat(lua): port of NodeMCU Lua53 read-only tables

# Conflicts:
#	radio/src/lua/CMakeLists.txt
#	radio/src/lua/api_general.cpp

* fix(nv14): missing SDRAM definition

* fix: l_mathop

* fix: use float functions in drawPower()

* fix: ltable resize

* fix: correct name is "bit32"

* fix: first Lua context must be closed last

As the lookup cache is attached to that one

* Revert to Lua using double

* Ensure byte-code compatibility

* Fix possible compatibility issue with `lua_typename`/`luaL_typename`

* Fix Bitmap symbol table

* Re-add table lib for COLORLCD
This commit is contained in:
Raphael Coeffic
2023-02-09 20:29:56 +10:00
committed by GitHub
parent 72193eda82
commit be3f8d74a8
43 changed files with 1387 additions and 2211 deletions
@@ -325,18 +325,18 @@ bool isSwitchAvailableInCustomFunctions(int swtch)
void drawPower(coord_t x, coord_t y, int8_t dBm, LcdFlags att)
{
float power_W_PREC1 = pow(10.0, (dBm - 30.0) / 10.0) * 10;
float power_W_PREC1 = powf(10.0, (dBm - 30.0) / 10.0) * 10;
if (dBm >= 30) {
lcdDrawNumber(x, y, power_W_PREC1, PREC1 | att);
lcdDrawText(lcdNextPos, y, "W", att);
}
else if (dBm < 10) {
uint16_t power_MW_PREC1 = round(power_W_PREC1 * 1000);
uint16_t power_MW_PREC1 = roundf(power_W_PREC1 * 1000);
lcdDrawNumber(x, y, power_MW_PREC1, PREC1 | att);
lcdDrawText(lcdNextPos, y, "mW", att);
}
else {
uint16_t power_MW = round(power_W_PREC1 * 100);
uint16_t power_MW = roundf(power_W_PREC1 * 100);
if (power_MW >= 50) {
power_MW = (power_MW / 5) * 5;
lcdDrawNumber(x, y, power_MW, att);