Merge branch 'next-upstream'
This commit is contained in:
@@ -508,3 +508,6 @@ Thos. O'Meara Photography
|
|||||||
Spis Ltd/TurboNote
|
Spis Ltd/TurboNote
|
||||||
Patricia Cox
|
Patricia Cox
|
||||||
Matthew Lukes
|
Matthew Lukes
|
||||||
|
Sabine Witte
|
||||||
|
Phillip Perry
|
||||||
|
Beat Zurflueh
|
||||||
|
|||||||
@@ -457,22 +457,27 @@ int InputsPanel::gm_moveExpo(int idx, bool dir) //true=inc=down false=dec=up
|
|||||||
if (!dir && tdx<0 && src.chn>0) {
|
if (!dir && tdx<0 && src.chn>0) {
|
||||||
src.chn--;
|
src.chn--;
|
||||||
return idx;
|
return idx;
|
||||||
} else if (!dir && tdx<0) {
|
}
|
||||||
|
else if (!dir && tdx<0) {
|
||||||
return idx;
|
return idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(memcmp(&src,&temp,sizeof(ExpoData))==0) return idx;
|
if (memcmp(&src, &temp, sizeof(ExpoData)) == 0) {
|
||||||
bool tgtempty=(memcmp(&tgt,&temp,sizeof(ExpoData))==0 ? 1:0);
|
return idx;
|
||||||
if(tgt.chn!=src.chn || tgtempty) {
|
|
||||||
if ((dir) && (src.chn<(inputsCount-1))) src.chn++;
|
|
||||||
if ((!dir) && (src.chn>0)) src.chn--;
|
|
||||||
return idx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//flip between idx and tgt
|
bool tgtempty = (memcmp(&tgt, &temp, sizeof(ExpoData)) == 0);
|
||||||
memcpy(&temp,&src,sizeof(ExpoData));
|
|
||||||
memcpy(&src,&tgt,sizeof(ExpoData));
|
if (tgt.chn!=src.chn || tgtempty) {
|
||||||
memcpy(&tgt,&temp,sizeof(ExpoData));
|
if ((dir) && (src.chn<unsigned(inputsCount-1))) src.chn++;
|
||||||
|
if ((!dir) && (src.chn>0)) src.chn--;
|
||||||
|
return idx;
|
||||||
|
}
|
||||||
|
|
||||||
|
// flip between idx and tgt
|
||||||
|
memcpy(&temp, &src, sizeof(ExpoData));
|
||||||
|
memcpy(&src, &tgt, sizeof(ExpoData));
|
||||||
|
memcpy(&tgt, &temp, sizeof(ExpoData));
|
||||||
return tdx;
|
return tdx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
/*.bin.*
|
/*.bin.*
|
||||||
/*.hex
|
/*.hex
|
||||||
/*.lst
|
/*.lst
|
||||||
|
/*.lss
|
||||||
/SCRIPTS
|
/SCRIPTS
|
||||||
/TEMPLATES
|
/TEMPLATES
|
||||||
/SOUNDS
|
/SOUNDS
|
||||||
|
|||||||
@@ -47,22 +47,6 @@
|
|||||||
bar_threshold_t barsThresholds[THLD_MAX];
|
bar_threshold_t barsThresholds[THLD_MAX];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum FrskyViews {
|
|
||||||
CASE_LUA(TELEMETRY_LUA_SCREEN_1)
|
|
||||||
CASE_LUA(TELEMETRY_LUA_SCREEN_2)
|
|
||||||
CASE_LUA(TELEMETRY_LUA_SCREEN_3)
|
|
||||||
CASE_LUA(TELEMETRY_LUA_SCREEN_4)
|
|
||||||
CASE_LUA(TELEMETRY_LUA_SCREEN_5)
|
|
||||||
CASE_LUA(TELEMETRY_LUA_SCREEN_6)
|
|
||||||
CASE_LUA(TELEMETRY_LUA_SCREEN_7)
|
|
||||||
TELEMETRY_CUSTOM_SCREEN_1,
|
|
||||||
TELEMETRY_CUSTOM_SCREEN_2,
|
|
||||||
CASE_CPUARM(TELEMETRY_CUSTOM_SCREEN_3)
|
|
||||||
TELEMETRY_VOLTAGES_SCREEN,
|
|
||||||
TELEMETRY_AFTER_FLIGHT_SCREEN,
|
|
||||||
FRSKY_VIEW_MAX = TELEMETRY_AFTER_FLIGHT_SCREEN
|
|
||||||
};
|
|
||||||
|
|
||||||
uint8_t s_frsky_view = 0;
|
uint8_t s_frsky_view = 0;
|
||||||
|
|
||||||
#if LCD_W >= 212
|
#if LCD_W >= 212
|
||||||
|
|||||||
+30
-12
@@ -1137,6 +1137,7 @@ void luaInit()
|
|||||||
|
|
||||||
// Push OpenTX constants
|
// Push OpenTX constants
|
||||||
lua_registerint(L, "FULLSCALE", RESX);
|
lua_registerint(L, "FULLSCALE", RESX);
|
||||||
|
lua_registerint(L, "XXLSIZE", XXLSIZE);
|
||||||
lua_registerint(L, "DBLSIZE", DBLSIZE);
|
lua_registerint(L, "DBLSIZE", DBLSIZE);
|
||||||
lua_registerint(L, "MIDSIZE", MIDSIZE);
|
lua_registerint(L, "MIDSIZE", MIDSIZE);
|
||||||
lua_registerint(L, "SMLSIZE", SMLSIZE);
|
lua_registerint(L, "SMLSIZE", SMLSIZE);
|
||||||
@@ -1293,8 +1294,16 @@ void getTelemetryScriptPath(char * path, uint8_t index)
|
|||||||
{
|
{
|
||||||
strcpy(path, SCRIPTS_PATH "/");
|
strcpy(path, SCRIPTS_PATH "/");
|
||||||
char * curs = strcat_modelname(path+sizeof(SCRIPTS_PATH), g_eeGeneral.currModel);
|
char * curs = strcat_modelname(path+sizeof(SCRIPTS_PATH), g_eeGeneral.currModel);
|
||||||
strcpy(curs, "/telemX.lua");
|
if (index == TELEMETRY_VOLTAGES_SCREEN) {
|
||||||
curs[6] = '0' + index;
|
strcpy(curs, "/telempw.lua");
|
||||||
|
}
|
||||||
|
else if (index == TELEMETRY_AFTER_FLIGHT_SCREEN) {
|
||||||
|
strcpy(curs, "/telemaf.lua");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
strcpy(curs, "/telemX.lua");
|
||||||
|
curs[6] = '1' + index;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool luaLoadTelemetryScript(uint8_t index)
|
bool luaLoadTelemetryScript(uint8_t index)
|
||||||
@@ -1319,7 +1328,7 @@ bool isTelemetryScriptAvailable(uint8_t index)
|
|||||||
{
|
{
|
||||||
for (int i=0; i<luaScriptsCount; i++) {
|
for (int i=0; i<luaScriptsCount; i++) {
|
||||||
ScriptInternalData & sid = scriptInternalData[i];
|
ScriptInternalData & sid = scriptInternalData[i];
|
||||||
if (sid.reference == SCRIPT_TELEMETRY_FIRST+index+1) {
|
if (sid.reference == SCRIPT_TELEMETRY_FIRST+index) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1340,18 +1349,26 @@ void luaLoadPermanentScripts()
|
|||||||
// Load custom function scripts
|
// Load custom function scripts
|
||||||
for (int i=0; i<NUM_CFN; i++) {
|
for (int i=0; i<NUM_CFN; i++) {
|
||||||
if (!luaLoadFunctionScript(i)) {
|
if (!luaLoadFunctionScript(i)) {
|
||||||
POPUP_WARNING("Too many Lua scripts!"); // TODO translation
|
POPUP_WARNING(STR_TOO_MANY_LUA_SCRIPTS);
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load telemetry scripts
|
// Load custom telemetry scripts
|
||||||
for (int i=0; i<MAX_SCRIPTS+1; i++) {
|
for (int i=0; i<MAX_SCRIPTS; i++) {
|
||||||
if (!luaLoadTelemetryScript(i)) {
|
if (!luaLoadTelemetryScript(i)) {
|
||||||
POPUP_WARNING("Too many Lua scripts!"); // TODO translation
|
POPUP_WARNING(STR_TOO_MANY_LUA_SCRIPTS);
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!luaLoadTelemetryScript(TELEMETRY_VOLTAGES_SCREEN)) {
|
||||||
|
POPUP_WARNING(STR_TOO_MANY_LUA_SCRIPTS);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!luaLoadTelemetryScript(TELEMETRY_AFTER_FLIGHT_SCREEN)) {
|
||||||
|
POPUP_WARNING(STR_TOO_MANY_LUA_SCRIPTS);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
char lua_warning_str[WARNING_LINE_LEN+1];
|
char lua_warning_str[WARNING_LINE_LEN+1];
|
||||||
@@ -1405,8 +1422,6 @@ void luaExec(const char *filename)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extern uint8_t s_frsky_view;
|
|
||||||
|
|
||||||
void luaTask(uint8_t evt)
|
void luaTask(uint8_t evt)
|
||||||
{
|
{
|
||||||
lcd_locked = false;
|
lcd_locked = false;
|
||||||
@@ -1532,7 +1547,7 @@ void luaTask(uint8_t evt)
|
|||||||
#if defined(SIMU) || defined(DEBUG)
|
#if defined(SIMU) || defined(DEBUG)
|
||||||
filename = "[telem]";
|
filename = "[telem]";
|
||||||
#endif
|
#endif
|
||||||
if (g_menuStack[0]==menuTelemetryFrsky && sid.reference==SCRIPT_TELEMETRY_FIRST+s_frsky_view+1) {
|
if (g_menuStack[0]==menuTelemetryFrsky && sid.reference==SCRIPT_TELEMETRY_FIRST+s_frsky_view) {
|
||||||
lua_rawgeti(L, LUA_REGISTRYINDEX, sid.run);
|
lua_rawgeti(L, LUA_REGISTRYINDEX, sid.run);
|
||||||
lua_pushinteger(L, evt);
|
lua_pushinteger(L, evt);
|
||||||
inputsCount = 1;
|
inputsCount = 1;
|
||||||
@@ -1540,6 +1555,9 @@ void luaTask(uint8_t evt)
|
|||||||
else if (sid.background) {
|
else if (sid.background) {
|
||||||
lua_rawgeti(L, LUA_REGISTRYINDEX, sid.background);
|
lua_rawgeti(L, LUA_REGISTRYINDEX, sid.background);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (lua_pcall(L, inputsCount, sio ? sio->outputsCount : 0, 0) == 0) {
|
if (lua_pcall(L, inputsCount, sio ? sio->outputsCount : 0, 0) == 0) {
|
||||||
if (sio) {
|
if (sio) {
|
||||||
|
|||||||
@@ -1640,7 +1640,7 @@ FORCEINLINE void evalTrims()
|
|||||||
if (i==THR_STICK && g_model.thrTrim) {
|
if (i==THR_STICK && g_model.thrTrim) {
|
||||||
if (g_model.throttleReversed)
|
if (g_model.throttleReversed)
|
||||||
trim = -trim;
|
trim = -trim;
|
||||||
int16_t v = anas[i];
|
int16_t v = getValue(MIXSRC_Thr);
|
||||||
int32_t vv = ((int32_t)trim-TRIM_MIN)*(RESX-v)>>(RESX_SHIFT+1);
|
int32_t vv = ((int32_t)trim-TRIM_MIN)*(RESX-v)>>(RESX_SHIFT+1);
|
||||||
trim = vv;
|
trim = vv;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1654,6 +1654,25 @@ extern const pm_uint8_t bchunit_ar[];
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define IS_BARS_SCREEN(screenIndex) (g_model.frsky.screensType & (1<<(screenIndex)))
|
#define IS_BARS_SCREEN(screenIndex) (g_model.frsky.screensType & (1<<(screenIndex)))
|
||||||
|
|
||||||
|
enum FrskyViews {
|
||||||
|
CASE_LUA(TELEMETRY_LUA_SCREEN_1)
|
||||||
|
CASE_LUA(TELEMETRY_LUA_SCREEN_2)
|
||||||
|
CASE_LUA(TELEMETRY_LUA_SCREEN_3)
|
||||||
|
CASE_LUA(TELEMETRY_LUA_SCREEN_4)
|
||||||
|
CASE_LUA(TELEMETRY_LUA_SCREEN_5)
|
||||||
|
CASE_LUA(TELEMETRY_LUA_SCREEN_6)
|
||||||
|
CASE_LUA(TELEMETRY_LUA_SCREEN_7)
|
||||||
|
TELEMETRY_CUSTOM_SCREEN_1,
|
||||||
|
TELEMETRY_CUSTOM_SCREEN_2,
|
||||||
|
CASE_CPUARM(TELEMETRY_CUSTOM_SCREEN_3)
|
||||||
|
TELEMETRY_VOLTAGES_SCREEN,
|
||||||
|
TELEMETRY_AFTER_FLIGHT_SCREEN,
|
||||||
|
FRSKY_VIEW_MAX = TELEMETRY_AFTER_FLIGHT_SCREEN
|
||||||
|
};
|
||||||
|
|
||||||
|
extern uint8_t s_frsky_view;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define EARTH_RADIUSKM ((uint32_t)6371)
|
#define EARTH_RADIUSKM ((uint32_t)6371)
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ void setupPulsesDSM2(unsigned int port)
|
|||||||
*dsm2StreamPtr++ = dsm2Value;
|
*dsm2StreamPtr++ = dsm2Value;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch(s_current_protocol[port]) {
|
switch (s_current_protocol[port]) {
|
||||||
case PROTO_DSM2_LP45:
|
case PROTO_DSM2_LP45:
|
||||||
dsmDat[0] = 0x00;
|
dsmDat[0] = 0x00;
|
||||||
break;
|
break;
|
||||||
@@ -155,7 +155,7 @@ void setupPulsesDSM2(unsigned int port)
|
|||||||
dsmDat[0] = 0x10;
|
dsmDat[0] = 0x10;
|
||||||
break;
|
break;
|
||||||
default: // DSMX
|
default: // DSMX
|
||||||
dsmDat[0] = 0x18;
|
dsmDat[0] = 0x10 | DSMX_BIT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,49 +15,61 @@
|
|||||||
#define WriteCommand(x) AspiCmd(x)
|
#define WriteCommand(x) AspiCmd(x)
|
||||||
|
|
||||||
#if defined(REVPLUS)
|
#if defined(REVPLUS)
|
||||||
#define CONTRAST_OFS 120
|
#define CONTRAST_OFS 160
|
||||||
#else
|
#else
|
||||||
#define CONTRAST_OFS 5
|
#define CONTRAST_OFS 5
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//275us
|
||||||
|
void Delay(volatile unsigned int ms)
|
||||||
|
{
|
||||||
|
volatile u8 i;
|
||||||
|
while(ms != 0) {
|
||||||
|
for(i=0;i<250;i++) {}
|
||||||
|
for(i=0;i<75;i++) {}
|
||||||
|
ms--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(REVPLUS)
|
#if defined(REVPLUS)
|
||||||
static void LCD_Init()
|
static void LCD_Init()
|
||||||
{
|
{
|
||||||
AspiCmd(0x25); //(5) Temperature compensation curve definition: 0x25 = -0.05%/oC
|
WriteCommand(0x2F); //Internal pump control
|
||||||
AspiCmd(0x2b); //(6) Panel loading set ,Internal VLCD.
|
Delay(20);
|
||||||
AspiCmd(0xEA); //(27) set bias=1/10
|
WriteCommand(0x24); //Temperature compensation
|
||||||
AspiCmd(0x81); //(11) Set Vop + next byte
|
WriteCommand(0xE9); //set bias=1/10
|
||||||
|
WriteCommand(0x81); //Set Vop
|
||||||
#if defined(BOOT)
|
#if defined(BOOT)
|
||||||
AspiCmd(CONTRAST_OFS+25);
|
AspiCmd(CONTRAST_OFS+25);
|
||||||
#else
|
#else
|
||||||
AspiCmd(CONTRAST_OFS+g_eeGeneral.contrast);
|
AspiCmd(CONTRAST_OFS+g_eeGeneral.contrast);
|
||||||
#endif
|
#endif
|
||||||
AspiCmd(0xA6); //inverse display off
|
WriteCommand(0xA2); //set line rate:28KLPS
|
||||||
AspiCmd(0xA1); //line rates,24 Klps
|
WriteCommand(0x28); //set pannel loading
|
||||||
AspiCmd(0x84); //Disable Partial Display
|
WriteCommand(0x40); //scroll line LSB
|
||||||
AspiCmd(0xC8); //SET N-LINE INVERSION
|
WriteCommand(0x50); //SCROLL LINE MSB
|
||||||
AspiCmd(0x00); //Disable NIV
|
WriteCommand(0x89); //ram address control
|
||||||
AspiCmd(0xF1); //Set CEN
|
WriteCommand(0xC0); //LCD mapping control
|
||||||
AspiCmd(0x3F); // 1/64DUTY
|
WriteCommand(0x04); //MX=0,MY=1
|
||||||
AspiCmd(0xC0); //(21) Set mapping
|
WriteCommand(0xD0); //DISPLAY PATTERN = 16-SCALE GRAY
|
||||||
AspiCmd(0x05); // MY=1, MX=0, MSF=0
|
WriteCommand(0xF1); //SET COM end
|
||||||
AspiCmd(0x89); //(15) WA=1,column (CA) increment (+1) first until CA reaches CA boundary, then RA will increment by (+1).
|
WriteCommand(0x3F); //64
|
||||||
AspiCmd(0xF8); //Set Window Program Enable ,inside modle
|
|
||||||
AspiCmd(0xD0); //(23) SET 4 bits/pixel, pattern 0
|
WriteCommand(0xF8); //Set Window Program Disable.
|
||||||
AspiCmd(0xF4); //starting column address of RAM program window.
|
|
||||||
AspiCmd(0x00);
|
WriteCommand(0xF5); //starting row address of RAM program window.PAGE1
|
||||||
AspiCmd(0xF5); //starting row address of RAM program window.
|
WriteCommand(0x00);
|
||||||
AspiCmd(0x00);
|
WriteCommand(0xF7); //end row address of RAM program window.PAGE32
|
||||||
AspiCmd(0xF6); //ending column address of RAM program window.
|
WriteCommand(0x1F);
|
||||||
AspiCmd(0xD3);
|
WriteCommand(0xF4); //start column address of RAM program window.
|
||||||
AspiCmd(0xF7); //ending row address of RAM program window.
|
WriteCommand(0x00);
|
||||||
AspiCmd(0x3F);
|
WriteCommand(0xF6); //end column address of RAM program window.SEG212
|
||||||
AspiCmd(0xAF); // Active and 16-grey scale
|
WriteCommand(0xD3);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static void LCD_Init()
|
static void LCD_Init()
|
||||||
{
|
{
|
||||||
AspiCmd(0x2b); //Panel loading set ,Internal VLCD.
|
AspiCmd(0x2B); //Panel loading set ,Internal VLCD.
|
||||||
AspiCmd(0x25); //Temperature compensation curve definition: 0x25 = -0.05%/oC
|
AspiCmd(0x25); //Temperature compensation curve definition: 0x25 = -0.05%/oC
|
||||||
AspiCmd(0xEA); //set bias=1/10 :Command table NO.27
|
AspiCmd(0xEA); //set bias=1/10 :Command table NO.27
|
||||||
AspiCmd(0x81); //Set Vop
|
AspiCmd(0x81); //Set Vop
|
||||||
@@ -117,6 +129,7 @@ void lcdRefresh()
|
|||||||
for (uint32_t y=0; y<LCD_H; y+=2) {
|
for (uint32_t y=0; y<LCD_H; y+=2) {
|
||||||
uint8_t *p = &displayBuf[(y>>3)*LCD_W];
|
uint8_t *p = &displayBuf[(y>>3)*LCD_W];
|
||||||
uint8_t mask = (1 << (y%8));
|
uint8_t mask = (1 << (y%8));
|
||||||
|
uint8_t mask2 = (1 << (1+(y%8)));
|
||||||
|
|
||||||
Set_Address(0, y/2);
|
Set_Address(0, y/2);
|
||||||
AspiCmd(0xAF);
|
AspiCmd(0xAF);
|
||||||
@@ -126,49 +139,18 @@ void lcdRefresh()
|
|||||||
LCD_NCS_LOW();
|
LCD_NCS_LOW();
|
||||||
|
|
||||||
for (uint32_t x=0; x<LCD_W; x++) {
|
for (uint32_t x=0; x<LCD_W; x++) {
|
||||||
uint8_t a, b, c ;
|
uint8_t a = p[3*DISPLAY_PLAN_SIZE+x] ;
|
||||||
uint8_t val = 0 ;
|
uint8_t b = p[2*DISPLAY_PLAN_SIZE+x] ;
|
||||||
|
uint8_t c = p[DISPLAY_PLAN_SIZE+x] ;
|
||||||
a = p[3*DISPLAY_PLAN_SIZE+x] ;
|
uint8_t d = p[x] ;
|
||||||
if ( a & mask ) {
|
LCD_WRITE_BIT(a & mask2);
|
||||||
val |= 1 ;
|
LCD_WRITE_BIT(b & mask2);
|
||||||
}
|
LCD_WRITE_BIT(c & mask2);
|
||||||
if ( (a>>1) & mask ) {
|
LCD_WRITE_BIT(d & mask2);
|
||||||
val |= 0x10 ;
|
LCD_WRITE_BIT(a & mask);
|
||||||
}
|
LCD_WRITE_BIT(b & mask);
|
||||||
|
LCD_WRITE_BIT(c & mask);
|
||||||
b = p[2*DISPLAY_PLAN_SIZE+x] ;
|
LCD_WRITE_BIT(d & mask);
|
||||||
if ( b & mask ) {
|
|
||||||
val |= 2 ;
|
|
||||||
}
|
|
||||||
if ( (b>>1) & mask ) {
|
|
||||||
val |= 0x20 ;
|
|
||||||
}
|
|
||||||
|
|
||||||
c = p[DISPLAY_PLAN_SIZE+x] ;
|
|
||||||
if ( c & mask ) {
|
|
||||||
val |= 4 ;
|
|
||||||
}
|
|
||||||
if ( (c>>1) & mask ) {
|
|
||||||
val |= 0x40 ;
|
|
||||||
}
|
|
||||||
|
|
||||||
c = p[x] ;
|
|
||||||
if ( c & mask ) {
|
|
||||||
val |= 8 ;
|
|
||||||
}
|
|
||||||
if ( (c>>1) & mask ) {
|
|
||||||
val |= 0x80 ;
|
|
||||||
}
|
|
||||||
|
|
||||||
LCD_WRITE_BIT(val & 1);
|
|
||||||
LCD_WRITE_BIT(val & 2);
|
|
||||||
LCD_WRITE_BIT(val & 4);
|
|
||||||
LCD_WRITE_BIT(val & 8);
|
|
||||||
LCD_WRITE_BIT(val & 0x10);
|
|
||||||
LCD_WRITE_BIT(val & 0x20);
|
|
||||||
LCD_WRITE_BIT(val & 0x40);
|
|
||||||
LCD_WRITE_BIT(val & 0x80);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LCD_NCS_HIGH();
|
LCD_NCS_HIGH();
|
||||||
@@ -284,18 +266,6 @@ static void LCD_Hardware_Init()
|
|||||||
GPIO_Init(GPIO_LCD_RST, &GPIO_InitStructure);
|
GPIO_Init(GPIO_LCD_RST, &GPIO_InitStructure);
|
||||||
}
|
}
|
||||||
|
|
||||||
//275us
|
|
||||||
void Delay(volatile unsigned int ms)
|
|
||||||
{
|
|
||||||
volatile u8 i;
|
|
||||||
while(ms != 0)
|
|
||||||
{
|
|
||||||
for(i=0;i<250;i++) {}
|
|
||||||
for(i=0;i<75;i++) {}
|
|
||||||
ms--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void LCD_OFF()
|
void LCD_OFF()
|
||||||
{
|
{
|
||||||
AspiCmd(0xE2);
|
AspiCmd(0xE2);
|
||||||
|
|||||||
@@ -334,6 +334,36 @@ TEST(FrSkySPORT, checkCrc)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(FRSKY) && defined(CPUARM)
|
||||||
|
TEST(FrSky, FrskyValueWithMinAveraging)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
The following expected[] array is filled
|
||||||
|
with values that correspond to 4 elements
|
||||||
|
long averaging buffer.
|
||||||
|
If length of averaging buffer is changed, this
|
||||||
|
values must be adjusted
|
||||||
|
*/
|
||||||
|
uint8_t expected[] = { 10, 12, 17, 25, 35, 45, 55, 65, 75, 85, 92, 97, 100, 100, 100, 100, 100};
|
||||||
|
int testPos = 0;
|
||||||
|
//test of averaging
|
||||||
|
FrskyValueWithMin testVal;
|
||||||
|
testVal.value = 0;
|
||||||
|
testVal.set(10);
|
||||||
|
EXPECT_EQ(testVal.value, expected[testPos++]);
|
||||||
|
for(int n=2; n<10; ++n) {
|
||||||
|
testVal.set(n*10);
|
||||||
|
EXPECT_EQ(testVal.value, expected[testPos++]);
|
||||||
|
}
|
||||||
|
for(int n=2; n<10; ++n) {
|
||||||
|
testVal.set(100);
|
||||||
|
EXPECT_EQ(testVal.value, expected[testPos++]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if !defined(PCBTARANIS)
|
#if !defined(PCBTARANIS)
|
||||||
TEST(getSwitch, undefCSW)
|
TEST(getSwitch, undefCSW)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -474,6 +474,7 @@ const pm_char STR_FLASH_BOOTLOADER[] PROGMEM = TR_FLASH_BOOTLOADER;
|
|||||||
const pm_char STR_WRITING[] PROGMEM = TR_WRITING;
|
const pm_char STR_WRITING[] PROGMEM = TR_WRITING;
|
||||||
const pm_char STR_CONFIRM_FORMAT[] PROGMEM = TR_CONFIRM_FORMAT;
|
const pm_char STR_CONFIRM_FORMAT[] PROGMEM = TR_CONFIRM_FORMAT;
|
||||||
const pm_char STR_EEBACKUP[] PROGMEM = TR_EEBACKUP;
|
const pm_char STR_EEBACKUP[] PROGMEM = TR_EEBACKUP;
|
||||||
|
const pm_char STR_TOO_MANY_LUA_SCRIPTS[] PROGMEM = TR_TO_MANY_LUA_SCRIPTS;
|
||||||
const pm_char STR_BLCOLOR[] PROGMEM = TR_BLCOLOR;
|
const pm_char STR_BLCOLOR[] PROGMEM = TR_BLCOLOR;
|
||||||
|
|
||||||
#if LCD_W >= 212
|
#if LCD_W >= 212
|
||||||
|
|||||||
@@ -626,6 +626,7 @@ extern const pm_char STR_FLASH_BOOTLOADER[];
|
|||||||
extern const pm_char STR_WRITING[];
|
extern const pm_char STR_WRITING[];
|
||||||
extern const pm_char STR_CONFIRM_FORMAT[];
|
extern const pm_char STR_CONFIRM_FORMAT[];
|
||||||
extern const pm_char STR_EEBACKUP[];
|
extern const pm_char STR_EEBACKUP[];
|
||||||
|
extern const pm_char STR_TOO_MANY_LUA_SCRIPTS[];
|
||||||
extern const pm_char STR_BLCOLOR[];
|
extern const pm_char STR_BLCOLOR[];
|
||||||
|
|
||||||
#if defined(VOICE) && defined(CPUARM)
|
#if defined(VOICE) && defined(CPUARM)
|
||||||
|
|||||||
@@ -814,6 +814,7 @@
|
|||||||
#define TR_INPUTS "Vstupy"
|
#define TR_INPUTS "Vstupy"
|
||||||
#define TR_OUTPUTS "Výstupy"
|
#define TR_OUTPUTS "Výstupy"
|
||||||
#define TR_EEBACKUP "\010[dlouze ENTER] zálohuje EEPROM"
|
#define TR_EEBACKUP "\010[dlouze ENTER] zálohuje EEPROM"
|
||||||
|
#define TR_TO_MANY_LUA_SCRIPTS "Too many Lua scripts!"
|
||||||
|
|
||||||
#if defined(MAVLINK)
|
#if defined(MAVLINK)
|
||||||
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
||||||
|
|||||||
@@ -814,6 +814,7 @@
|
|||||||
#define TR_INPUTS "Inputs"
|
#define TR_INPUTS "Inputs"
|
||||||
#define TR_OUTPUTS "Outputs"
|
#define TR_OUTPUTS "Outputs"
|
||||||
#define TR_EEBACKUP "\004[ENTER Long] to backup the EEPROM"
|
#define TR_EEBACKUP "\004[ENTER Long] to backup the EEPROM"
|
||||||
|
#define TR_TO_MANY_LUA_SCRIPTS "Too many Lua scripts!"
|
||||||
|
|
||||||
#if defined(MAVLINK)
|
#if defined(MAVLINK)
|
||||||
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
||||||
|
|||||||
@@ -814,6 +814,7 @@
|
|||||||
#define TR_INPUTS "Inputs"
|
#define TR_INPUTS "Inputs"
|
||||||
#define TR_OUTPUTS "Outputs"
|
#define TR_OUTPUTS "Outputs"
|
||||||
#define TR_EEBACKUP "\004[ENTER Long] to backup the EEPROM"
|
#define TR_EEBACKUP "\004[ENTER Long] to backup the EEPROM"
|
||||||
|
#define TR_TO_MANY_LUA_SCRIPTS "Too many Lua scripts!"
|
||||||
|
|
||||||
#if defined(MAVLINK)
|
#if defined(MAVLINK)
|
||||||
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
||||||
|
|||||||
@@ -814,6 +814,7 @@
|
|||||||
#define TR_INPUTS "Inputs"
|
#define TR_INPUTS "Inputs"
|
||||||
#define TR_OUTPUTS "Outputs"
|
#define TR_OUTPUTS "Outputs"
|
||||||
#define TR_EEBACKUP "\004[ENTER Long] to backup the EEPROM"
|
#define TR_EEBACKUP "\004[ENTER Long] to backup the EEPROM"
|
||||||
|
#define TR_TO_MANY_LUA_SCRIPTS "Too many Lua scripts!"
|
||||||
|
|
||||||
#if defined(MAVLINK)
|
#if defined(MAVLINK)
|
||||||
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
||||||
|
|||||||
@@ -814,6 +814,7 @@
|
|||||||
#define TR_INPUTS "Inputs"
|
#define TR_INPUTS "Inputs"
|
||||||
#define TR_OUTPUTS "Outputs"
|
#define TR_OUTPUTS "Outputs"
|
||||||
#define TR_EEBACKUP "\004[ENTER Long] to backup the EEPROM"
|
#define TR_EEBACKUP "\004[ENTER Long] to backup the EEPROM"
|
||||||
|
#define TR_TO_MANY_LUA_SCRIPTS "Too many Lua scripts!"
|
||||||
|
|
||||||
#if defined(MAVLINK)
|
#if defined(MAVLINK)
|
||||||
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
||||||
|
|||||||
@@ -814,6 +814,7 @@
|
|||||||
#define TR_INPUTS "Entrées"
|
#define TR_INPUTS "Entrées"
|
||||||
#define TR_OUTPUTS "Sorties"
|
#define TR_OUTPUTS "Sorties"
|
||||||
#define TR_EEBACKUP "\004[ENTER Long]: Sauvegarder l'EEPROM"
|
#define TR_EEBACKUP "\004[ENTER Long]: Sauvegarder l'EEPROM"
|
||||||
|
#define TR_TO_MANY_LUA_SCRIPTS "Too many Lua scripts!"
|
||||||
|
|
||||||
#if defined(MAVLINK)
|
#if defined(MAVLINK)
|
||||||
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "RSSI Max"
|
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "RSSI Max"
|
||||||
|
|||||||
@@ -814,6 +814,7 @@
|
|||||||
#define TR_INPUTS "Ingresso"
|
#define TR_INPUTS "Ingresso"
|
||||||
#define TR_OUTPUTS "Uscita"
|
#define TR_OUTPUTS "Uscita"
|
||||||
#define TR_EEBACKUP "\004[ENTER Lungo] per copiare la EEPROM"
|
#define TR_EEBACKUP "\004[ENTER Lungo] per copiare la EEPROM"
|
||||||
|
#define TR_TO_MANY_LUA_SCRIPTS "Too many Lua scripts!"
|
||||||
|
|
||||||
#if defined(MAVLINK)
|
#if defined(MAVLINK)
|
||||||
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
||||||
|
|||||||
@@ -814,6 +814,7 @@
|
|||||||
#define TR_INPUTS "Wejścia"
|
#define TR_INPUTS "Wejścia"
|
||||||
#define TR_OUTPUTS "Wyjścia"
|
#define TR_OUTPUTS "Wyjścia"
|
||||||
#define TR_EEBACKUP "\004[ENTER Long] to backup the EEPROM"
|
#define TR_EEBACKUP "\004[ENTER Long] to backup the EEPROM"
|
||||||
|
#define TR_TO_MANY_LUA_SCRIPTS "Too many Lua scripts!"
|
||||||
|
|
||||||
#if defined(MAVLINK)
|
#if defined(MAVLINK)
|
||||||
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "MaksRSSI"
|
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "MaksRSSI"
|
||||||
|
|||||||
@@ -814,6 +814,7 @@
|
|||||||
#define TR_INPUTS "Inputs"
|
#define TR_INPUTS "Inputs"
|
||||||
#define TR_OUTPUTS "Outputs"
|
#define TR_OUTPUTS "Outputs"
|
||||||
#define TR_EEBACKUP "\004[ENTER Long] to backup the EEPROM"
|
#define TR_EEBACKUP "\004[ENTER Long] to backup the EEPROM"
|
||||||
|
#define TR_TO_MANY_LUA_SCRIPTS "Too many Lua scripts!"
|
||||||
|
|
||||||
#if defined(MAVLINK)
|
#if defined(MAVLINK)
|
||||||
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
||||||
|
|||||||
@@ -814,6 +814,7 @@
|
|||||||
#define TR_INPUTS "Input"
|
#define TR_INPUTS "Input"
|
||||||
#define TR_OUTPUTS "Outputs"
|
#define TR_OUTPUTS "Outputs"
|
||||||
#define TR_EEBACKUP "\004[ENTER Lång] säkerhetskopiera EEPROM"
|
#define TR_EEBACKUP "\004[ENTER Lång] säkerhetskopiera EEPROM"
|
||||||
|
#define TR_TO_MANY_LUA_SCRIPTS "Too many Lua scripts!"
|
||||||
|
|
||||||
#if defined(MAVLINK)
|
#if defined(MAVLINK)
|
||||||
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
||||||
|
|||||||
Reference in New Issue
Block a user