Merge pull request #2696 from opentx/bsongis/issue2595_cli
Fixes #2595 and #2598: USB serial port and CLI added
This commit is contained in:
@@ -46,7 +46,7 @@
|
||||
#include "opentx.h"
|
||||
#include "telemetry/mavlink.h"
|
||||
#include "gui/9X/menus.h"
|
||||
#include "serial.h"
|
||||
#include "targets/common_avr/serial_driver.h"
|
||||
|
||||
#define APSIZE (BSS | DBLSIZE)
|
||||
|
||||
|
||||
@@ -219,9 +219,9 @@ void menuGeneralHardware(uint8_t event)
|
||||
break;
|
||||
#endif
|
||||
case ITEM_SETUP_HW_UART3_MODE:
|
||||
g_eeGeneral.uart3Mode = selectMenuItem(HW_SETTINGS_COLUMN, y, STR_UART3MODE, STR_UART3MODES, g_eeGeneral.uart3Mode, 0, UART_MODE_MAX, attr, event);
|
||||
g_eeGeneral.serial2Mode = selectMenuItem(HW_SETTINGS_COLUMN, y, STR_UART3MODE, STR_UART3MODES, g_eeGeneral.serial2Mode, 0, UART_MODE_MAX, attr, event);
|
||||
if (attr && checkIncDec_Ret) {
|
||||
uart3Init(g_eeGeneral.uart3Mode, MODEL_TELEMETRY_PROTOCOL());
|
||||
serial2Init(g_eeGeneral.serial2Mode, MODEL_TELEMETRY_PROTOCOL());
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -574,7 +574,7 @@ void menuModelTelemetry(uint8_t event)
|
||||
|
||||
switch (k) {
|
||||
case ITEM_TELEMETRY_PROTOCOL_TYPE:
|
||||
g_model.telemetryProtocol = selectMenuItem(TELEM_COL2, y, STR_TELEMETRY_TYPE, "\017FrSky S.PORT\0 FrSky D\0 FrSky D (cable)", g_model.telemetryProtocol, PROTOCOL_TELEMETRY_FIRST, g_eeGeneral.uart3Mode==UART_MODE_TELEMETRY ? PROTOCOL_FRSKY_D_SECONDARY : PROTOCOL_FRSKY_D, attr, event);
|
||||
g_model.telemetryProtocol = selectMenuItem(TELEM_COL2, y, STR_TELEMETRY_TYPE, "\017FrSky S.PORT\0 FrSky D\0 FrSky D (cable)", g_model.telemetryProtocol, PROTOCOL_TELEMETRY_FIRST, g_eeGeneral.serial2Mode==UART_MODE_TELEMETRY ? PROTOCOL_FRSKY_D_SECONDARY : PROTOCOL_FRSKY_D, attr, event);
|
||||
break;
|
||||
|
||||
case ITEM_TELEMETRY_SENSORS_LABEL:
|
||||
|
||||
@@ -98,9 +98,15 @@ void menuStatisticsView(uint8_t event)
|
||||
#define MENU_DEBUG_Y_MIXMAX (2*FH-3)
|
||||
#define MENU_DEBUG_Y_LUA (3*FH-2)
|
||||
#define MENU_DEBUG_Y_FREE_RAM (4*FH-1)
|
||||
#define MENU_DEBUG_Y_STACK (5*FH)
|
||||
#define MENU_DEBUG_Y_USB (5*FH)
|
||||
#define MENU_DEBUG_Y_RTOS (6*FH)
|
||||
|
||||
#if defined(USB_SERIAL)
|
||||
extern uint16_t usbWraps;
|
||||
extern uint16_t charsWritten;
|
||||
extern "C" volatile uint32_t APP_Rx_ptr_in;
|
||||
#endif
|
||||
|
||||
void menuStatisticsDebug(uint8_t event)
|
||||
{
|
||||
TITLE(STR_MENUDEBUG);
|
||||
@@ -172,6 +178,15 @@ void menuStatisticsDebug(uint8_t event)
|
||||
lcd_outdezAtt(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_MIXMAX, DURATION_MS_PREC2(maxMixerDuration), PREC2|LEFT);
|
||||
lcd_puts(lcdLastPos, MENU_DEBUG_Y_MIXMAX, "ms");
|
||||
|
||||
#if defined(USB_SERIAL)
|
||||
lcd_putsLeft(MENU_DEBUG_Y_USB, "Usb");
|
||||
lcd_outdezAtt(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_USB, charsWritten, LEFT);
|
||||
lcd_puts(lcdLastPos, MENU_DEBUG_Y_USB, " ");
|
||||
lcd_outdezAtt(lcdLastPos, MENU_DEBUG_Y_USB, APP_Rx_ptr_in, LEFT);
|
||||
lcd_puts(lcdLastPos, MENU_DEBUG_Y_USB, " ");
|
||||
lcd_outdezAtt(lcdLastPos, MENU_DEBUG_Y_USB, usbWraps, LEFT);
|
||||
#endif
|
||||
|
||||
lcd_putsLeft(MENU_DEBUG_Y_RTOS, STR_FREESTACKMINB);
|
||||
lcd_putsAtt(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_RTOS+1, "[M]", SMLSIZE);
|
||||
lcd_outdezAtt(lcdLastPos, MENU_DEBUG_Y_RTOS, stack_free(0), UNSIGN|LEFT);
|
||||
|
||||
Reference in New Issue
Block a user