Merge branch '2.3' into 2.4

# Conflicts:
#	radio/src/fonts/480x272/font_dblsize.png
#	radio/src/fonts/480x272/font_xxlsize.png
#	radio/src/gui/128x64/model_setup.cpp
#	radio/src/gui/128x64/radio_setup.cpp
#	radio/src/gui/480x272/model_receiver_options.cpp
#	radio/src/gui/480x272/model_setup.cpp
#	radio/src/gui/480x272/radio_calibration.cpp
#	radio/src/gui/480x272/radio_hardware.cpp
#	radio/src/gui/common/stdlcd/draw_functions.cpp
#	radio/src/gui/gui_common.cpp
#	radio/src/keys.h
#	radio/src/lua/interface.cpp
#	radio/src/pulses/afhds3.h
#	radio/src/rtos.h
#	radio/src/switches.cpp
#	radio/src/targets/common/arm/stm32/aux_serial_driver.cpp
#	radio/src/targets/horus/CMakeLists.txt
#	radio/src/targets/horus/lcd_driver.cpp
#	radio/src/targets/horus/startup_stm32f42_43xxx.s
#	radio/src/targets/taranis/CMakeLists.txt
#	radio/src/telemetry/crossfire.h
#	radio/src/telemetry/multi.cpp
#	radio/src/translations.cpp
#	radio/src/translations/it.h.txt
#	radio/src/translations/untranslated.h
#	radio/util/font2png.py
#	tools/commit-tests.sh
This commit is contained in:
3djc
2021-04-08 11:42:28 +02:00
270 changed files with 10874 additions and 6174 deletions
+53 -15
View File
@@ -40,8 +40,12 @@
#include "lua/lua_exports_x7.inc"
#elif defined(RADIO_T12)
#include "lua/lua_exports_t12.inc"
#elif defined(RADIO_TLITE)
#include "lua/lua_exports_tlite.inc"
#elif defined(RADIO_TX12)
#include "lua/lua_exports_tx12.inc"
#elif defined(RADIO_T8)
#include "lua/lua_exports_t8.inc"
#elif defined(PCBX9LITES)
#include "lua/lua_exports_x9lites.inc"
#elif defined(PCBX9LITE)
@@ -50,6 +54,8 @@
#include "lua/lua_exports_xlites.inc"
#elif defined(PCBXLITE)
#include "lua/lua_exports_xlite.inc"
#elif defined(RADIO_X9DP2019)
#include "lua/lua_exports_x9d+2019.inc"
#elif defined(PCBTARANIS)
#include "lua/lua_exports_x9d.inc"
#endif
@@ -1405,7 +1411,10 @@ Get RSSI value as well as low and critical RSSI alarm levels (in dB)
*/
static int luaGetRSSI(lua_State * L)
{
lua_pushunsigned(L, min((uint8_t)99, TELEMETRY_RSSI()));
if (TELEMETRY_STREAMING())
lua_pushunsigned(L, min((uint8_t)99, TELEMETRY_RSSI()));
else
lua_pushunsigned(L, 0);
lua_pushunsigned(L, g_model.rssiAlarms.getWarningRssi());
lua_pushunsigned(L, g_model.rssiAlarms.getCriticalRssi());
return 3;
@@ -1596,13 +1605,42 @@ static int luaMultiBuffer(lua_State * L)
}
#endif
/*luadoc
@function setSerialBaudrate(baudrate)
@param baudrate Desired baurate
Set baudrate for serial port(s) affected to LUA
@status current Introduced in 2.3.12
*/
static int luaSetSerialBaudrate(lua_State * L)
{
#if defined(AUX_SERIAL) || defined(AUX2_SERIAL)
unsigned int baudrate = luaL_checkunsigned(L, 1);
#endif
#if defined(AUX_SERIAL)
if (auxSerialMode == UART_MODE_LUA) {
auxSerialStop();
auxSerialSetup(baudrate, false);
}
#endif
#if defined(AUX2_SERIAL)
if (aux2SerialMode == UART_MODE_LUA) {
aux2SerialStop();
aux2SerialSetup(baudrate, false);
}
#endif
return 1;
}
/*luadoc
@function serialWrite(str)
@param str (string) String to be written to the serial port.
Writes a string to the serial port. The string is allowed to contain any character, including 0.
@status current Introduced in TODO
@status current Introduced in 2.3.10
*/
static int luaSerialWrite(lua_State * L)
{
@@ -1612,21 +1650,22 @@ static int luaSerialWrite(lua_State * L)
if (!str || len < 1)
return 0;
#if !defined(SIMU)
#if defined(USB_SERIAL)
#if defined(USB_SERIAL)
if (getSelectedUsbMode() == USB_SERIAL_MODE) {
size_t wr_len = len;
const char* p = str;
while(wr_len--) usbSerialPutc(*p++);
}
#endif
#if defined(AUX_SERIAL)
#endif
#if defined(AUX_SERIAL)
if (auxSerialMode == UART_MODE_LUA) {
size_t wr_len = len;
const char* p = str;
while(wr_len--) auxSerialPutc(*p++);
}
#endif
#endif
#if defined(AUX2_SERIAL)
if (aux2SerialMode == UART_MODE_LUA) {
size_t wr_len = len;
@@ -1634,9 +1673,6 @@ static int luaSerialWrite(lua_State * L)
while(wr_len--) aux2SerialPutc(*p++);
}
#endif
#else
debugPrintf("luaSerialWrite: %.*s",len,str);
#endif
return 0;
}
@@ -1740,6 +1776,7 @@ const luaL_Reg opentxLib[] = {
#if defined(MULTIMODULE)
{ "multiBuffer", luaMultiBuffer },
#endif
{ "setSerialBaudrate", luaSetSerialBaudrate },
{ "serialWrite", luaSerialWrite },
{ "serialRead", luaSerialRead },
{ nullptr, nullptr } /* sentinel */
@@ -1788,11 +1825,11 @@ const luaR_value_entry opentxConstants[] = {
{ "MIXSRC_SE", MIXSRC_SE },
{ "MIXSRC_SG", MIXSRC_SG },
#endif
#if !defined(PCBXLITE) && !defined(PCBX9LITE)
#if defined(HARDWARE_SWITCH_F)
{ "MIXSRC_SF", MIXSRC_SF },
#if !defined(RADIO_TX12)
{ "MIXSRC_SH", MIXSRC_SH },
#endif
#if defined(HARDWARE_SWITCH_H)
{ "MIXSRC_SH", MIXSRC_SH },
#endif
{ "MIXSRC_CH1", MIXSRC_CH1 },
{ "SWSRC_LAST", SWSRC_LAST_LOGICAL_SWITCH },
@@ -1843,7 +1880,7 @@ const luaR_value_entry opentxConstants[] = {
{ "ROTENC_LOWSPEED", ROTENC_LOWSPEED },
{ "ROTENC_MIDSPEED", ROTENC_MIDSPEED },
{ "ROTENC_HIGHSPEED", ROTENC_HIGHSPEED },
#elif defined(PCBX9D) || defined(PCBX9DP) // key reverted between field nav and value change
#elif defined(PCBX9D) || defined(PCBX9DP) || defined(RADIO_T8) // key reverted between field nav and value change
{ "EVT_VIRTUAL_PREV", EVT_KEY_FIRST(KEY_PLUS) },
{ "EVT_VIRTUAL_PREV_REPT", EVT_KEY_REPT(KEY_PLUS) },
{ "EVT_VIRTUAL_NEXT", EVT_KEY_FIRST(KEY_MINUS) },
@@ -1880,7 +1917,7 @@ const luaR_value_entry opentxConstants[] = {
{ "EVT_VIRTUAL_ENTER_LONG", EVT_KEY_LONG(KEY_ENTER) },
{ "EVT_VIRTUAL_EXIT", EVT_KEY_BREAK(KEY_EXIT) },
#elif defined(NAVIGATION_X7) || defined(NAVIGATION_X9D)
#if defined(RADIO_TX12)
#if defined(RADIO_TX12) || defined(RADIO_T8)
{ "EVT_VIRTUAL_PREV_PAGE", EVT_KEY_BREAK(KEY_PAGEUP) },
{ "EVT_VIRTUAL_NEXT_PAGE", EVT_KEY_BREAK(KEY_PAGEDN) },
{ "EVT_VIRTUAL_MENU", EVT_KEY_BREAK(KEY_MODEL) },
@@ -2002,6 +2039,7 @@ const luaR_value_entry opentxConstants[] = {
{"UNIT_KMH", UNIT_KMH },
{"UNIT_MPH", UNIT_MPH },
{"UNIT_METERS", UNIT_METERS },
{"UNIT_KM", UNIT_KM },
{"UNIT_FEET", UNIT_FEET },
{"UNIT_CELSIUS", UNIT_CELSIUS },
{"UNIT_FAHRENHEIT", UNIT_FAHRENHEIT },