add LUA access to serial port (serial2 and USB)
This commit is contained in:
@@ -4,6 +4,8 @@ set(LUA_SCRIPT_LOAD_MODE "" CACHE STRING "Script loading mode and compilation fl
|
||||
option(LUA_COMPILER "Pre-compile and save Lua scripts" OFF)
|
||||
option(LUA_ALLOCATOR_TRACER "Trace Lua memory (de)allocations to debug port (also needs DEBUG=YES NANO=NO)" OFF)
|
||||
|
||||
option(USB_SERIAL "Enable USB serial (CDC)" OFF)
|
||||
|
||||
set(ARCH ARM)
|
||||
set(STM32USB_DIR ${THIRDPARTY_DIR}/STM32_USB-Host-Device_Lib_V2.2.0/Libraries)
|
||||
add_definitions(-DSTM32 -DLUA_INPUTS -DVARIO -DCROSSFIRE)
|
||||
@@ -39,7 +41,7 @@ set(FIRMWARE_TARGET_SRC
|
||||
../common/arm/stm32/flash_driver.cpp
|
||||
)
|
||||
|
||||
if(DEBUG OR CLI)
|
||||
if(DEBUG OR CLI OR USB_SERIAL)
|
||||
set(STM32USB_SRC
|
||||
${STM32USB_SRC}
|
||||
STM32_USB_Device_Library/Class/cdc/src/usbd_cdc_core.c
|
||||
|
||||
@@ -101,6 +101,8 @@ void serial2Init(unsigned int mode, unsigned int protocol)
|
||||
uart3Setup(FRSKY_D_BAUDRATE, true);
|
||||
}
|
||||
break;
|
||||
case UART_MODE_LUA:
|
||||
uart3Setup(DEBUG_BAUDRATE, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user