Initial support of NB4+
This commit is contained in:
committed by
Malte Langermann
parent
35e8b61b7d
commit
d651b22379
@@ -73,7 +73,7 @@ static inline void check_struct()
|
||||
CHKSIZE(TimerData, 17);
|
||||
CHKSIZE(ModelHeader, 131);
|
||||
CHKSIZE(CustomScreenData, 1892);
|
||||
#if defined(PCBNV14)
|
||||
#if defined(PCBNV14) || defined(RADIO_NB4P)
|
||||
CHKTYPE(TopBarPersistentData, 704);
|
||||
#else
|
||||
CHKTYPE(TopBarPersistentData, 1048);
|
||||
@@ -107,7 +107,11 @@ static inline void check_struct()
|
||||
#elif defined(PCBNV14)
|
||||
CHKSIZE(ModelData, 26463);
|
||||
#elif defined(PCBPL18)
|
||||
CHKSIZE(ModelData, 26845);
|
||||
#if defined(RADIO_NB4P)
|
||||
CHKSIZE(ModelData, 26499);
|
||||
#else
|
||||
CHKSIZE(ModelData, 26845);
|
||||
#endif
|
||||
#elif defined(RADIO_T15)
|
||||
CHKSIZE(ModelData, 26834);
|
||||
#elif defined(PCBHORUS)
|
||||
|
||||
@@ -40,7 +40,10 @@ add_definitions(-DSOFTWARE_VOLUME)
|
||||
add_definitions(-DSPI_FLASH)
|
||||
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)
|
||||
add_definitions(-DRADIO_PL18EV)
|
||||
else()
|
||||
|
||||
@@ -639,11 +639,17 @@
|
||||
// SDRAM
|
||||
#define SDRAM_BANK1
|
||||
|
||||
#define PORTRAIT_LCD false
|
||||
#define LANDSCAPE_LCD true
|
||||
|
||||
#define LCD_W 480
|
||||
#define LCD_H 320
|
||||
#if defined(RADIO_NB4P)
|
||||
#define PORTRAIT_LCD true
|
||||
#define LANDSCAPE_LCD false
|
||||
#define LCD_W 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_H 480
|
||||
|
||||
@@ -1150,18 +1150,33 @@ void LCD_ST7796S_Init(void) {
|
||||
lcdWriteData( 0x96 );
|
||||
|
||||
lcdWriteCommand( 0x36 );
|
||||
lcdWriteData( 0x28 );
|
||||
if (LCD_W != LCD_PHYS_W) {
|
||||
lcdWriteData( 0x28 );
|
||||
|
||||
lcdWriteCommand( 0x2A );
|
||||
lcdWriteData( 0x00 );
|
||||
lcdWriteData( 0x00 );
|
||||
lcdWriteData( 0x01 );
|
||||
lcdWriteData( 0xDF );
|
||||
lcdWriteCommand( 0x2B );
|
||||
lcdWriteData( 0x00 );
|
||||
lcdWriteData( 0x00 );
|
||||
lcdWriteData( 0x01 );
|
||||
lcdWriteData( 0x3F );
|
||||
lcdWriteCommand( 0x2A );
|
||||
lcdWriteData( 0x00 );
|
||||
lcdWriteData( 0x00 );
|
||||
lcdWriteData( 0x01 );
|
||||
lcdWriteData( 0xDF );
|
||||
lcdWriteCommand( 0x2B );
|
||||
lcdWriteData( 0x00 );
|
||||
lcdWriteData( 0x00 );
|
||||
lcdWriteData( 0x01 );
|
||||
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 );
|
||||
lcdWriteData( 0x66 );
|
||||
|
||||
@@ -21,12 +21,16 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#if defined(RADIO_PL18EV)
|
||||
#define USB_NAME "FlySky PL18EV"
|
||||
#define USB_MANUFACTURER 'F', 'l', 'y', 'S', 'k', 'y', ' ', ' ' /* 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 */
|
||||
#if defined(RADIO_NB4P)
|
||||
#define USB_NAME "FlySky NB4+"
|
||||
#define USB_MANUFACTURER 'F', 'l', 'y', 'S', 'k', 'y', ' ', ' ' /* 8 bytes */
|
||||
#define USB_PRODUCT 'N', 'B', '4', '+', ' ', ' ', ' ', ' ' /* 8 Bytes */
|
||||
#elif defined(RADIO_PL18EV)
|
||||
#define USB_NAME "FlySky PL18EV"
|
||||
#define USB_MANUFACTURER 'F', 'l', 'y', 'S', 'k', 'y', ' ', ' ' /* 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
|
||||
|
||||
Reference in New Issue
Block a user