From 87f8ea516b3d508a332f9c0e043eaa79ca03f1aa Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Fri, 8 Jan 2016 23:34:57 +0100 Subject: [PATCH] Compilation fix --- radio/src/gui/horus/menu_general_calib.cpp | 20 +++++------ radio/src/myeeprom.h | 2 +- radio/src/switches.cpp | 42 +++++++++++----------- radio/src/tasks_arm.cpp | 1 + 4 files changed, 33 insertions(+), 32 deletions(-) diff --git a/radio/src/gui/horus/menu_general_calib.cpp b/radio/src/gui/horus/menu_general_calib.cpp index 6e3040c9f..dd2c2c6b6 100644 --- a/radio/src/gui/horus/menu_general_calib.cpp +++ b/radio/src/gui/horus/menu_general_calib.cpp @@ -22,10 +22,10 @@ #define XPOT_DELTA 10 #define XPOT_DELAY 10 /* cycles */ -#define BAR_WIDTH 7 -#define BAR_HEIGHT (BOX_WIDTH-9) -#define BAR_INTERVAL 20 -#define BAR_BOTTOM 200 +#define POT_BAR_WIDTH 7 +#define POT_BAR_HEIGHT (BOX_WIDTH-9) +#define POT_BAR_INTERVAL 20 +#define POT_BAR_BOTTOM 200 #define LBOX_CENTERX (BOX_WIDTH/2 + 17) #define RBOX_CENTERX (LCD_W-LBOX_CENTERX) @@ -33,12 +33,12 @@ void drawPotsBars() { // Optimization by Mike Blandford unsigned int x, i, len ; // declare temporary variables - for (x=LCD_W/2-(BAR_INTERVAL*NUM_POTS/2), i=NUM_STICKS; icount + 1; } if (steps > 0 && steps <= XPOTS_MULTIPOS_COUNT) { - lcdDrawNumber(LCD_W/2-(BAR_INTERVAL*NUM_POTS/2)+(BAR_INTERVAL*(i-POT1)), BAR_BOTTOM+15, steps, TEXT_COLOR|TINSIZE, 0, "[", "]"); + lcdDrawNumber(LCD_W/2-(POT_BAR_INTERVAL*NUM_POTS/2)+(POT_BAR_INTERVAL*(i-POT1)), POT_BAR_BOTTOM+15, steps, TEXT_COLOR|TINSIZE, 0, "[", "]"); } } diff --git a/radio/src/myeeprom.h b/radio/src/myeeprom.h index 7f0339ec7..499a007d2 100644 --- a/radio/src/myeeprom.h +++ b/radio/src/myeeprom.h @@ -97,7 +97,7 @@ #define MAX_FLIGHT_MODES 9 #define MAX_MIXERS 64 #define MAX_EXPOS 64 - #define NUM_LOGICAL_SWITCH 32 // number of custom switches + #define NUM_LOGICAL_SWITCH 64 // number of custom switches #define NUM_CFN 64 // number of functions assigned to switches #define MAX_SCRIPTS 9 #define MAX_INPUTS 32 diff --git a/radio/src/switches.cpp b/radio/src/switches.cpp index 43d911079..56d070ad7 100644 --- a/radio/src/switches.cpp +++ b/radio/src/switches.cpp @@ -1,23 +1,23 @@ -/* - * Copyright (C) OpenTX - * - * Based on code named - * th9x - http://code.google.com/p/th9x - * er9x - http://code.google.com/p/er9x - * gruvin9x - http://code.google.com/p/gruvin9x - * - * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - +/* + * Copyright (C) OpenTX + * + * Based on code named + * th9x - http://code.google.com/p/th9x + * er9x - http://code.google.com/p/er9x + * gruvin9x - http://code.google.com/p/gruvin9x + * + * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + #include "opentx.h" #define CS_LAST_VALUE_INIT -32768 @@ -554,7 +554,7 @@ bool getSwitch(swsrc_t swtch) result = true; } else if (cs_idx <= SWSRC_LAST_SWITCH) { -#if defined(PCBTARANIS) // TODO || defined(PCBFLAMENCO) +#if defined(PCBTARANIS) || defined(PCBHORUS) // TODO || defined(PCBFLAMENCO) if (flags & GETSWITCH_MIDPOS_DELAY) result = SWITCH_POSITION(cs_idx-SWSRC_FIRST_SWITCH); else diff --git a/radio/src/tasks_arm.cpp b/radio/src/tasks_arm.cpp index 1fa164752..cfa5a0f83 100644 --- a/radio/src/tasks_arm.cpp +++ b/radio/src/tasks_arm.cpp @@ -136,6 +136,7 @@ void menusTask(void * pdata) break; } else if (pwr_check == e_power_press) { + CoTickDelay(MENU_TASK_PERIOD_TICKS); continue; } #else