Initial support of NB4+
This commit is contained in:
committed by
Malte Langermann
parent
35e8b61b7d
commit
d651b22379
@@ -6,6 +6,7 @@
|
|||||||
["Flysky NV14", "nv14-"],
|
["Flysky NV14", "nv14-"],
|
||||||
["Flysky PL18", "pl18-"],
|
["Flysky PL18", "pl18-"],
|
||||||
["Flysky PL18EV", "pl18ev-"],
|
["Flysky PL18EV", "pl18ev-"],
|
||||||
|
["Flysky NB4+", "nb4p-"],
|
||||||
["FrSky Horus X10", "x10-"],
|
["FrSky Horus X10", "x10-"],
|
||||||
["FrSky Horus X10 Express", "x10express-"],
|
["FrSky Horus X10 Express", "x10express-"],
|
||||||
["FrSky Horus X12s", "x12s-"],
|
["FrSky Horus X12s", "x12s-"],
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ static inline void check_struct()
|
|||||||
CHKSIZE(TimerData, 17);
|
CHKSIZE(TimerData, 17);
|
||||||
CHKSIZE(ModelHeader, 131);
|
CHKSIZE(ModelHeader, 131);
|
||||||
CHKSIZE(CustomScreenData, 1892);
|
CHKSIZE(CustomScreenData, 1892);
|
||||||
#if defined(PCBNV14)
|
#if defined(PCBNV14) || defined(RADIO_NB4P)
|
||||||
CHKTYPE(TopBarPersistentData, 704);
|
CHKTYPE(TopBarPersistentData, 704);
|
||||||
#else
|
#else
|
||||||
CHKTYPE(TopBarPersistentData, 1048);
|
CHKTYPE(TopBarPersistentData, 1048);
|
||||||
@@ -107,7 +107,11 @@ static inline void check_struct()
|
|||||||
#elif defined(PCBNV14)
|
#elif defined(PCBNV14)
|
||||||
CHKSIZE(ModelData, 26463);
|
CHKSIZE(ModelData, 26463);
|
||||||
#elif defined(PCBPL18)
|
#elif defined(PCBPL18)
|
||||||
CHKSIZE(ModelData, 26845);
|
#if defined(RADIO_NB4P)
|
||||||
|
CHKSIZE(ModelData, 26499);
|
||||||
|
#else
|
||||||
|
CHKSIZE(ModelData, 26845);
|
||||||
|
#endif
|
||||||
#elif defined(RADIO_T15)
|
#elif defined(RADIO_T15)
|
||||||
CHKSIZE(ModelData, 26834);
|
CHKSIZE(ModelData, 26834);
|
||||||
#elif defined(PCBHORUS)
|
#elif defined(PCBHORUS)
|
||||||
|
|||||||
@@ -40,7 +40,10 @@ add_definitions(-DSOFTWARE_VOLUME)
|
|||||||
add_definitions(-DSPI_FLASH)
|
add_definitions(-DSPI_FLASH)
|
||||||
add_definitions(-DSTM32_SUPPORT_32BIT_TIMERS)
|
add_definitions(-DSTM32_SUPPORT_32BIT_TIMERS)
|
||||||
|
|
||||||
if(PCBREV STREQUAL PL18EV)
|
if(PCBREV STREQUAL NB4P)
|
||||||
|
set(FLAVOUR nb4p)
|
||||||
|
add_definitions(-DRADIO_NB4P)
|
||||||
|
elseif(PCBREV STREQUAL PL18EV)
|
||||||
set(FLAVOUR pl18ev)
|
set(FLAVOUR pl18ev)
|
||||||
add_definitions(-DRADIO_PL18EV)
|
add_definitions(-DRADIO_PL18EV)
|
||||||
else()
|
else()
|
||||||
|
|||||||
@@ -639,11 +639,17 @@
|
|||||||
// SDRAM
|
// SDRAM
|
||||||
#define SDRAM_BANK1
|
#define SDRAM_BANK1
|
||||||
|
|
||||||
#define PORTRAIT_LCD false
|
#if defined(RADIO_NB4P)
|
||||||
#define LANDSCAPE_LCD true
|
#define PORTRAIT_LCD true
|
||||||
|
#define LANDSCAPE_LCD false
|
||||||
#define LCD_W 480
|
#define LCD_W 320
|
||||||
#define LCD_H 320
|
#define LCD_H 480
|
||||||
|
#else
|
||||||
|
#define PORTRAIT_LCD false
|
||||||
|
#define LANDSCAPE_LCD true
|
||||||
|
#define LCD_W 480
|
||||||
|
#define LCD_H 320
|
||||||
|
#endif
|
||||||
|
|
||||||
#define LCD_PHYS_W 320
|
#define LCD_PHYS_W 320
|
||||||
#define LCD_PHYS_H 480
|
#define LCD_PHYS_H 480
|
||||||
|
|||||||
@@ -1150,18 +1150,33 @@ void LCD_ST7796S_Init(void) {
|
|||||||
lcdWriteData( 0x96 );
|
lcdWriteData( 0x96 );
|
||||||
|
|
||||||
lcdWriteCommand( 0x36 );
|
lcdWriteCommand( 0x36 );
|
||||||
lcdWriteData( 0x28 );
|
if (LCD_W != LCD_PHYS_W) {
|
||||||
|
lcdWriteData( 0x28 );
|
||||||
|
|
||||||
lcdWriteCommand( 0x2A );
|
lcdWriteCommand( 0x2A );
|
||||||
lcdWriteData( 0x00 );
|
lcdWriteData( 0x00 );
|
||||||
lcdWriteData( 0x00 );
|
lcdWriteData( 0x00 );
|
||||||
lcdWriteData( 0x01 );
|
lcdWriteData( 0x01 );
|
||||||
lcdWriteData( 0xDF );
|
lcdWriteData( 0xDF );
|
||||||
lcdWriteCommand( 0x2B );
|
lcdWriteCommand( 0x2B );
|
||||||
lcdWriteData( 0x00 );
|
lcdWriteData( 0x00 );
|
||||||
lcdWriteData( 0x00 );
|
lcdWriteData( 0x00 );
|
||||||
lcdWriteData( 0x01 );
|
lcdWriteData( 0x01 );
|
||||||
lcdWriteData( 0x3F );
|
lcdWriteData( 0x3F );
|
||||||
|
} else {
|
||||||
|
lcdWriteData( 0x88 );
|
||||||
|
|
||||||
|
lcdWriteCommand( 0x2A );
|
||||||
|
lcdWriteData( 0x00 );
|
||||||
|
lcdWriteData( 0x00 );
|
||||||
|
lcdWriteData( 0x01 );
|
||||||
|
lcdWriteData( 0x3F );
|
||||||
|
lcdWriteCommand( 0x2B );
|
||||||
|
lcdWriteData( 0x00 );
|
||||||
|
lcdWriteData( 0x00 );
|
||||||
|
lcdWriteData( 0x01 );
|
||||||
|
lcdWriteData( 0xDF );
|
||||||
|
}
|
||||||
|
|
||||||
lcdWriteCommand( 0x3A );
|
lcdWriteCommand( 0x3A );
|
||||||
lcdWriteData( 0x66 );
|
lcdWriteData( 0x66 );
|
||||||
|
|||||||
@@ -21,12 +21,16 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if defined(RADIO_PL18EV)
|
#if defined(RADIO_NB4P)
|
||||||
#define USB_NAME "FlySky PL18EV"
|
#define USB_NAME "FlySky NB4+"
|
||||||
#define USB_MANUFACTURER 'F', 'l', 'y', 'S', 'k', 'y', ' ', ' ' /* 8 bytes */
|
#define USB_MANUFACTURER 'F', 'l', 'y', 'S', 'k', 'y', ' ', ' ' /* 8 bytes */
|
||||||
#define USB_PRODUCT 'P', 'L', '1', '8', 'E', 'V', ' ', ' ' /* 8 Bytes */
|
#define USB_PRODUCT 'N', 'B', '4', '+', ' ', ' ', ' ', ' ' /* 8 Bytes */
|
||||||
#else
|
#elif defined(RADIO_PL18EV)
|
||||||
#define USB_NAME "FlySky PL18"
|
#define USB_NAME "FlySky PL18EV"
|
||||||
#define USB_MANUFACTURER 'F', 'l', 'y', 'S', 'k', 'y', ' ', ' ' /* 8 bytes */
|
#define USB_MANUFACTURER 'F', 'l', 'y', 'S', 'k', 'y', ' ', ' ' /* 8 bytes */
|
||||||
#define USB_PRODUCT 'P', 'L', '1', '8', ' ', ' ', ' ', ' ' /* 8 Bytes */
|
#define USB_PRODUCT 'P', 'L', '1', '8', 'E', 'V', ' ', ' ' /* 8 Bytes */
|
||||||
|
#else
|
||||||
|
#define USB_NAME "FlySky PL18"
|
||||||
|
#define USB_MANUFACTURER 'F', 'l', 'y', 'S', 'k', 'y', ' ', ' ' /* 8 bytes */
|
||||||
|
#define USB_PRODUCT 'P', 'L', '1', '8', ' ', ' ', ' ', ' ' /* 8 Bytes */
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -679,6 +679,68 @@ LEGACY_NAMES = [
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"targets": {
|
||||||
|
"nb4p"
|
||||||
|
},
|
||||||
|
"inputs": {
|
||||||
|
"LH": {
|
||||||
|
"yaml": "Rud",
|
||||||
|
"lua": "rud",
|
||||||
|
"description": "Rudder"
|
||||||
|
},
|
||||||
|
"LV": {
|
||||||
|
"yaml": "Ele",
|
||||||
|
"lua": "ele",
|
||||||
|
"description": "Elevator"
|
||||||
|
},
|
||||||
|
"RV": {
|
||||||
|
"yaml": "Thr",
|
||||||
|
"lua": "thr",
|
||||||
|
"description": "Throttle"
|
||||||
|
},
|
||||||
|
"RH": {
|
||||||
|
"yaml": "Ail",
|
||||||
|
"lua": "ail",
|
||||||
|
"description": "Aileron"
|
||||||
|
},
|
||||||
|
"P1": {
|
||||||
|
"yaml": "POT1",
|
||||||
|
"lua": "s1",
|
||||||
|
"label": "S1",
|
||||||
|
"short_label": "1",
|
||||||
|
"description": "Potentiometer 1"
|
||||||
|
},
|
||||||
|
"P2": {
|
||||||
|
"yaml": "POT2",
|
||||||
|
"lua": "s2",
|
||||||
|
"label": "S2",
|
||||||
|
"short_label": "2",
|
||||||
|
"description": "Potentiometer 2"
|
||||||
|
},
|
||||||
|
"P3": {
|
||||||
|
"yaml": "POT3",
|
||||||
|
"lua": "s3",
|
||||||
|
"label": "S3",
|
||||||
|
"short_label": "3",
|
||||||
|
"description": "Potentiometer 3"
|
||||||
|
},
|
||||||
|
"SL1": {
|
||||||
|
"yaml": "LS",
|
||||||
|
"lua": "ls",
|
||||||
|
"label": "LS",
|
||||||
|
"short_label": "L",
|
||||||
|
"description": "Left slider"
|
||||||
|
},
|
||||||
|
"SL2": {
|
||||||
|
"yaml": "RS",
|
||||||
|
"lua": "rs",
|
||||||
|
"label": "RS",
|
||||||
|
"short_label": "R",
|
||||||
|
"description": "Right slider"
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"targets": {"v12", "v14"},
|
"targets": {"v12", "v14"},
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
|||||||
@@ -39,6 +39,13 @@ POT_CONFIG = {
|
|||||||
"EXT3": {"default": "MULTIPOS"},
|
"EXT3": {"default": "MULTIPOS"},
|
||||||
"EXT4": {"default": "MULTIPOS"}
|
"EXT4": {"default": "MULTIPOS"}
|
||||||
},
|
},
|
||||||
|
"nb4p": {
|
||||||
|
"P1": {"default": "POT"},
|
||||||
|
"P2": {"default": "POT"},
|
||||||
|
"P3": {"default": "POT"},
|
||||||
|
"SL1": {"default": "SLIDER"},
|
||||||
|
"SL2": {"default": "SLIDER"}
|
||||||
|
},
|
||||||
"v12": {
|
"v12": {
|
||||||
"P1": {"default": "POT_CENTER"},
|
"P1": {"default": "POT_CENTER"},
|
||||||
"P2": {"default": "POT_CENTER"},
|
"P2": {"default": "POT_CENTER"},
|
||||||
|
|||||||
@@ -65,6 +65,16 @@ SWITCH_CONFIG = {
|
|||||||
"SI": { "default": "3POS" },
|
"SI": { "default": "3POS" },
|
||||||
"SJ": { "default": "3POS" }
|
"SJ": { "default": "3POS" }
|
||||||
},
|
},
|
||||||
|
"nb4p": {
|
||||||
|
"SA": { "default": "2POS" },
|
||||||
|
"SB": { "default": "3POS" },
|
||||||
|
"SC": { "default": "2POS" },
|
||||||
|
"SD": { "default": "3POS" },
|
||||||
|
"SE": { "default": "3POS" },
|
||||||
|
"SF": { "default": "2POS" },
|
||||||
|
"SG": { "default": "3POS" },
|
||||||
|
"SH": { "default": "TOGGLE" }
|
||||||
|
},
|
||||||
"lr3pro": {
|
"lr3pro": {
|
||||||
# left side
|
# left side
|
||||||
"SA": {"default": "3POS", "display": [0, 0]},
|
"SA": {"default": "3POS", "display": [0, 0]},
|
||||||
|
|||||||
@@ -143,6 +143,9 @@ get_target_build_options() {
|
|||||||
pl18ev)
|
pl18ev)
|
||||||
BUILD_OPTIONS+="-DPCB=PL18 -DPCBREV=PL18EV"
|
BUILD_OPTIONS+="-DPCB=PL18 -DPCBREV=PL18EV"
|
||||||
;;
|
;;
|
||||||
|
nb4p)
|
||||||
|
BUILD_OPTIONS+="-DPCB=PL18 -DPCBREV=NB4P"
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Unknown target: $target_name"
|
echo "Unknown target: $target_name"
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
Reference in New Issue
Block a user