From c80f0da4ac3fd56507158505857f7c1d9eca68d2 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Thu, 5 Jul 2018 11:32:47 +0200 Subject: [PATCH] Remove various references of AVR from script and referenced files --- .travis.yml | 16 +- radio/src/CMakeLists.txt | 6 +- .../gui/128x64/model_curve_simple_edit.cpp | 139 ------------ radio/src/gui/128x64/model_outputs_avr.cpp | 203 ------------------ radio/src/gui/CMakeLists.txt | 9 +- radio/src/gui/common/stdlcd/CMakeLists.txt | 33 ++- radio/src/pgmtypes.h | 61 ------ radio/util/build-firmware.py | 49 +---- 8 files changed, 19 insertions(+), 497 deletions(-) delete mode 100644 radio/src/gui/128x64/model_curve_simple_edit.cpp delete mode 100644 radio/src/gui/128x64/model_outputs_avr.cpp delete mode 100644 radio/src/pgmtypes.h diff --git a/.travis.yml b/.travis.yml index 73d294b54..e931e5386 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,6 @@ env: # - QT_BASE=56 - QT_BASE=57 # - GCC_ARM=/opt/gcc-arm-none-eabi/bin - - AVR_FLAVORS="AVR9X 9X GRUVIN9X MEGA2560" - PYTHONPATH=${PYTHONPATH}:/usr/lib/python3/dist-packages matrix: # @@ -20,10 +19,6 @@ env: # # - FLAVOR=ALL - FLAVOR=DEFAULT - # - FLAVOR=AVR9X - # - FLAVOR=9X - # - FLAVOR=GRUVIN9X - # - FLAVOR=MEGA2560 - FLAVOR=ARM9X # - FLAVOR=AR9X # - FLAVOR=SKY9X @@ -54,20 +49,11 @@ before_install: install: - sudo apt-get --yes --force-yes install curl libmpfr4 libmpc3 libfox-1.6-dev libgtest-dev - - | - if [[ " ${AVR_FLAVORS} " =~ " ${FLAVOR} " || ${FLAVOR} == "ALL" ]]; then - wget --quiet https://launchpad.net/ubuntu/+source/gcc-avr/1:4.9.2+Atmel3.5.0-1/+build/8403710/+files/gcc-avr_4.9.2+Atmel3.5.0-1_amd64.deb - wget --quiet https://launchpad.net/ubuntu/+source/avr-libc/1:1.8.0+Atmel3.5.0-1/+build/8435473/+files/avr-libc_1.8.0+Atmel3.5.0-1_all.deb - wget --quiet https://launchpad.net/ubuntu/+source/binutils-avr/2.25+Atmel3.5.0-2/+build/8435474/+files/binutils-avr_2.25+Atmel3.5.0-2_amd64.deb - sudo dpkg --install gcc-avr_4.9.2+Atmel3.5.0-1_amd64.deb avr-libc_1.8.0+Atmel3.5.0-1_all.deb binutils-avr_2.25+Atmel3.5.0-2_amd64.deb - fi - if [[ ! " ${AVR_FLAVORS} " =~ " ${FLAVOR} " || ${FLAVOR} == "ALL" ]]; then - sudo apt-get --yes --force-yes install gcc-arm-none-eabi + - sudo apt-get --yes --force-yes install gcc-arm-none-eabi # Trying to build with gcc-arm 4.7 isn't working because it can't find the compiler, despite adding to PATH (in commit-tests.sh) by defining GCC_ARM above # - wget --quiet https://launchpad.net/gcc-arm-embedded/4.7/4.7-2013-q3-update/+download/gcc-arm-none-eabi-4_7-2013q3-20130916-linux.tar.bz2 # - tar xjf gcc-arm-none-eabi-4_7-2013q3-20130916-linux.tar.bz2 # - mv gcc-arm-none-eabi-4_7-2013q3 /opt/gcc-arm-none-eabi - fi - sudo apt-get install --yes --force-yes -qq qt${QT_BASE}base qt${QT_BASE}multimedia qt${QT_BASE}svg qt${QT_BASE}tools; source /opt/qt${QT_BASE}/bin/qt${QT_BASE}-env.sh script: diff --git a/radio/src/CMakeLists.txt b/radio/src/CMakeLists.txt index 10b78b451..f3fe9bbaa 100644 --- a/radio/src/CMakeLists.txt +++ b/radio/src/CMakeLists.txt @@ -341,12 +341,8 @@ if(GUI) foreach(FILE ${GUI_SRC}) set(SRC ${SRC} gui/${GUI_DIR}/${FILE}) endforeach() - if(ARCH STREQUAL ARM) - set(SRC - ${SRC} - gui/gui_common_arm.cpp + set(SRC ${SRC} gui/gui_common_arm.cpp ) - endif() endif() foreach(FILE ${TARGET_SRC}) diff --git a/radio/src/gui/128x64/model_curve_simple_edit.cpp b/radio/src/gui/128x64/model_curve_simple_edit.cpp deleted file mode 100644 index d2afd61c4..000000000 --- a/radio/src/gui/128x64/model_curve_simple_edit.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/* - * 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" - -void menuModelCurveOne(event_t event) -{ - TITLE(STR_MENUCURVE); - lcdDrawNumber(PSIZE(TR_MENUCURVE)*FW+1, 0, s_curveChan+1, INVERS|LEFT); - DISPLAY_PROGRESS_BAR(20*FW+1); - - CurveInfo crv = curveInfo(s_curveChan); - - switch (event) { - case EVT_ENTRY: - s_editMode = 1; - break; - - CASE_EVT_ROTARY_BREAK - case EVT_KEY_BREAK(KEY_ENTER): - if (s_editMode <= 0) - menuHorizontalPosition = 0; - if (s_editMode == 1 && crv.custom) - s_editMode = 2; - else - s_editMode = 1; - break; - - case EVT_KEY_LONG(KEY_ENTER): - if (s_editMode <= 0) { - if (int8_t(++menuHorizontalPosition) > 4) - menuHorizontalPosition = -4; - for (uint8_t i=0; i 0) { - if (--s_editMode == 0) - menuHorizontalPosition = 0; - } - else { - popMenu(); - } - break; - - /* CASE_EVT_ROTARY_LEFT */ - case EVT_KEY_REPT(KEY_LEFT): - case EVT_KEY_FIRST(KEY_LEFT): - if (s_editMode==1 && menuHorizontalPosition>0) menuHorizontalPosition--; - if (s_editMode <= 0) { - if (crv.custom) { - moveCurve(s_curveChan, -crv.points+2); - } - else if (crv.points > MIN_POINTS_PER_CURVE) { - moveCurve(s_curveChan, -1, (crv.points+1)/2); - } - else { - AUDIO_WARNING2(); - } - return; - } - break; - - /* CASE_EVT_ROTARY_RIGHT */ - case EVT_KEY_REPT(KEY_RIGHT): - case EVT_KEY_FIRST(KEY_RIGHT): - if (s_editMode==1 && menuHorizontalPosition<(crv.points-1)) menuHorizontalPosition++; - if (s_editMode <= 0) { - if (!crv.custom) { - moveCurve(s_curveChan, crv.points-2, crv.points); - } - else if (crv.points < MAX_POINTS_PER_CURVE) { - if (moveCurve(s_curveChan, 1)) { - for (int8_t i=crv.points+crv.points-2; i>=0; i--) { - if (i%2) - crv.crv[i] = (crv.crv[i/2] + crv.crv[1+i/2]) / 2; - else - crv.crv[i] = crv.crv[i/2]; - } - } - } - else { - AUDIO_WARNING2(); - } - } - break; - } - - lcdDrawTextAlignedLeft(7*FH, STR_TYPE); - uint8_t attr = (s_editMode <= 0 ? INVERS : 0); - lcdDrawNumber(5*FW-2, 7*FH, crv.points, LEFT|attr); - lcdDrawText(lcdLastRightPos, 7*FH, crv.custom ? PSTR("pt'") : PSTR("pt"), attr); - - drawCurve(); - - if (s_editMode>0) { - uint8_t i = menuHorizontalPosition; - point_t point = getPoint(i); - - if (s_editMode==1 || !BLINK_ON_PHASE) { - // do selection square - lcdDrawFilledRect(point.x-1, point.y-2, 5, 5, SOLID, FORCE); - lcdDrawFilledRect(point.x, point.y-1, 3, 3, SOLID); - } - - int8_t x = -100 + 200*i/(crv.points-1); - if (crv.custom && i>0 && irevert = !ld->revert; - storageDirty(EE_MODEL); - } - - for (uint8_t i=0; irevert) ? -LIMIT_OFS(ld) : LIMIT_OFS(ld); - char swVal = '-'; // '-', '<', '>' - if ((channelOutputs[k] - v) > 50) swVal = (ld->revert ? 127 : 126); // Switch to raw inputs? - remove trim! - if ((channelOutputs[k] - v) < -50) swVal = (ld->revert ? 126 : 127); - putsChn(0, y, k+1, 0); - lcdDrawChar(LIMITS_DIRECTION_POS, y, swVal); -#endif - - limit_min_max_t limit = (g_model.extendedLimits ? LIMIT_EXT_MAX : 100); - - putsChn(0, y, k+1, IS_LINE_SELECTED(sub, k) ? INVERS : 0); - - for (uint8_t j=0; j0) ? BLINK|INVERS : INVERS) : 0); - uint8_t active = (attr && (s_editMode>0 || p1valdiff)) ; - if (active) STICK_SCROLL_DISABLE(); - switch (j) { - case ITEM_OUTPUTS_OFFSET: -#if defined(PPM_UNIT_US) - lcdDrawNumber(LIMITS_OFFSET_POS, y, ((int32_t)ld->offset*128) / 25, attr|PREC1|RIGHT); -#else - lcdDrawNumber(LIMITS_OFFSET_POS, y, ld->offset, attr|PREC1|RIGHT); -#endif - if (active) { - ld->offset = checkIncDec(event, ld->offset, -1000, 1000, EE_MODEL|NO_INCDEC_MARKS); - } - else if (attr && event==EVT_KEY_LONG(KEY_MENU)) { - copySticksToOffset(k); - s_editMode = 0; - } - break; - - case ITEM_OUTPUTS_MIN: - lcdDrawNumber(LIMITS_MIN_POS, y, MIN_MAX_DISPLAY(ld->min-LIMITS_MIN_MAX_OFFSET), MIN_MAX_ATTR|RIGHT); - if (active) { - ld->min = LIMITS_MIN_MAX_OFFSET + checkIncDec(event, ld->min-LIMITS_MIN_MAX_OFFSET, -limit, 0, EE_MODEL); - } - break; - - case ITEM_OUTPUTS_MAX: - lcdDrawNumber(LIMITS_MAX_POS, y, MIN_MAX_DISPLAY(ld->max+LIMITS_MIN_MAX_OFFSET), MIN_MAX_ATTR|RIGHT); - if (active) { - ld->max = -LIMITS_MIN_MAX_OFFSET + checkIncDec(event, ld->max+LIMITS_MIN_MAX_OFFSET, 0, +limit, EE_MODEL); - } - break; - - case ITEM_OUTPUTS_DIRECTION: - { -#if defined(PPM_CENTER_ADJUSTABLE) - lcdDrawChar(LIMITS_REVERT_POS, y, ld->revert ? 127 : 126, attr); -#else - lcdDrawTextAtIndex(LIMITS_REVERT_POS, y, STR_MMMINV, ld->revert, attr); -#endif - if (active) { - CHECK_INCDEC_MODELVAR_ZERO(event, ld->revert, 1); - } - break; - } - -#if defined(PPM_CENTER_ADJUSTABLE) - case ITEM_OUTPUTS_PPM_CENTER: - lcdDrawNumber(LIMITS_PPM_CENTER_POS, y, PPM_CENTER+ld->ppmCenter, RIGHT|attr); - if (active) { - CHECK_INCDEC_MODELVAR(event, ld->ppmCenter, -PPM_CENTER_MAX, +PPM_CENTER_MAX); - } - break; -#endif - -#if defined(PPM_LIMITS_SYMETRICAL) - case ITEM_OUTPUTS_SYMETRICAL: - lcdDrawChar(LCD_W-FW, y, ld->symetrical ? '=' : '^', attr); - if (active) { - CHECK_INCDEC_MODELVAR_ZERO(event, ld->symetrical, 1); - } - break; -#endif - } - } - } -} diff --git a/radio/src/gui/CMakeLists.txt b/radio/src/gui/CMakeLists.txt index 5c3ad1cf9..288b10a36 100644 --- a/radio/src/gui/CMakeLists.txt +++ b/radio/src/gui/CMakeLists.txt @@ -23,17 +23,10 @@ set(GUI_SRC ) if(GUI_DIR STREQUAL 128x64) - if (ARCH STREQUAL ARM) - set(GUI_SRC + set(GUI_SRC ${GUI_SRC} model_outputs_arm.cpp ) - else() - set(GUI_SRC - ${GUI_SRC} - model_outputs_avr.cpp - ) - endif() else() set(GUI_SRC ${GUI_SRC} diff --git a/radio/src/gui/common/stdlcd/CMakeLists.txt b/radio/src/gui/common/stdlcd/CMakeLists.txt index 32683c307..a9056719f 100644 --- a/radio/src/gui/common/stdlcd/CMakeLists.txt +++ b/radio/src/gui/common/stdlcd/CMakeLists.txt @@ -8,26 +8,21 @@ if(HELI) set(GUI_SRC ${GUI_SRC} ../common/stdlcd/model_heli.cpp) endif() -if(ARCH STREQUAL ARM) - add_definitions(-DGRAPHICS) - set(GUI_SRC - ${GUI_SRC} - ../common/stdlcd/model_inputs.cpp - ../common/stdlcd/model_mixes.cpp - ../common/stdlcd/view_text.cpp - ) - set(CURVE_EDIT_SRC model_curve_edit.cpp) -else() - set(CURVE_EDIT_SRC model_curve_simple_edit.cpp) -endif() +add_definitions(-DGRAPHICS) +set(GUI_SRC + ${GUI_SRC} + ../common/stdlcd/model_inputs.cpp + ../common/stdlcd/model_mixes.cpp + ../common/stdlcd/view_text.cpp +) +set(CURVE_EDIT_SRC ) -if(CURVES) - set(GUI_SRC - ${GUI_SRC} - ../common/stdlcd/model_curves.cpp - ${CURVE_EDIT_SRC} - ) -endif() + +set(GUI_SRC + ${GUI_SRC} + ../common/stdlcd/model_curves.cpp + model_curve_edit.cpp + ) if(SDCARD) set(GUI_SRC diff --git a/radio/src/pgmtypes.h b/radio/src/pgmtypes.h deleted file mode 100644 index b9da5383d..000000000 --- a/radio/src/pgmtypes.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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. - */ - -#ifndef _PGMTYPES_H_ -#define _PGMTYPES_H_ - -/* this is workaround for g++ bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34734 */ -#if (((__GNUC__ * 1000) + __GNUC_MINOR__) * 1000 + __GNUC_PATCHLEVEL__) < 4006002 -# ifdef __cplusplus -# undef PROGMEM -# define PROGMEM __attribute__(( section(".progmem.data") )) -# undef PSTR -# endif -#endif - -/* old (pre 1.8.0) avr-libc does not have progmem macros compatible with new gcc - * note: even for old gcc, definition was wrong. Old gcc was just more tolerant. */ -#if (((__AVR_LIBC_MAJOR__ * 1000) + __AVR_LIBC_MINOR__) * 1000 + __AVR_LIBC_REVISION__) < 1008000 -# ifndef __PGMSPACE_H_ -# warning "This file should be included after " -# endif -# undef PSTR -# undef PGM_P -# undef PGM_VOID_P -# define PGM_P const char * -# define PGM_VOID_P const void * -#endif - -#ifndef PSTR -# define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s);&__c[0];})) -#endif - -typedef void pm_void; -typedef char pm_char; -typedef unsigned char pm_uchar; -typedef int8_t pm_int8_t; -typedef uint8_t pm_uint8_t; -typedef int16_t pm_int16_t; -typedef uint16_t pm_uint16_t; -typedef int32_t pm_int32_t; -typedef uint32_t pm_uint32_t; - -#endif // _PGMTYPES_H_ - diff --git a/radio/util/build-firmware.py b/radio/util/build-firmware.py index e6528f692..846bb865e 100755 --- a/radio/util/build-firmware.py +++ b/radio/util/build-firmware.py @@ -16,14 +16,11 @@ INVALID_BOARD = 6 INVALID_LANGUAGE = 7 # Board types -BOARD_9X = 0 -BOARD_GRUVIN9X = 1 BOARD_SKY9X = 2 BOARD_TARANIS = 3 BOARD_HORUS = 4 # Board families -BOARD_FAMILY_AVR = 0 BOARD_FAMILY_ARM = 1 if len(sys.argv) != 3: @@ -40,47 +37,8 @@ if len(options) < 2 or options[0] != "opentx": optcount = 1 command_options = {} -if options[optcount] == "9x": - command_options["PCB"] = "9X" - firmware_options = options_9x - maxsize = 65536 - board = BOARD_9X - board_family = BOARD_FAMILY_AVR -elif options[optcount] == "9xr": - command_options["PCB"] = "9XR" - firmware_options = options_9x - maxsize = 65536 - board = BOARD_9X - board_family = BOARD_FAMILY_AVR -elif options[optcount] == "9x128": - command_options["PCB"] = "9X128" - command_options["FRSKY_STICKS"] = "YES" - firmware_options = options_9x128 - maxsize = 65536 * 2 - board = BOARD_9X - board_family = BOARD_FAMILY_AVR -elif options[optcount] == "9xr128": - command_options["PCB"] = "9XR128" - command_options["FRSKY_STICKS"] = "YES" - firmware_options = options_9x128 - maxsize = 65536 * 2 - board = BOARD_9X - board_family = BOARD_FAMILY_AVR -elif options[optcount] == "gruvin9x": - command_options["PCB"] = "GRUVIN9X" - command_options["TELEMETRY"] = "FRSKY" - firmware_options = options_gruvin9x - maxsize = 65536 * 4 - board = BOARD_GRUVIN9X - board_family = BOARD_FAMILY_AVR -elif options[optcount] == "mega2560": - command_options["PCB"] = "MEGA2560" - command_options["TELEMETRY"] = "FRSKY" - firmware_options = options_mega2560 - maxsize = 65536 * 4 - board = BOARD_GRUVIN9X - board_family = BOARD_FAMILY_AVR -elif options[optcount] == "sky9x": + +if options[optcount] == "sky9x": command_options["PCB"] = "SKY9X" firmware_options = options_sky9x maxsize = 65536 * 4 @@ -234,9 +192,6 @@ def build_firmware(path): # Check binary size if board_family == BOARD_FAMILY_ARM: size = os.stat(target).st_size - else: - size = subprocess.check_output('avr-size -A %s | grep Total | cut -f2- -d " "' % target, shell=True) - size = int(size.strip()) if size > maxsize: exit(FIRMWARE_SIZE_TOO_BIG)