diff --git a/.github/actions/define-firmware-ver-action/action.yml b/.github/actions/define-firmware-ver-action/action.yml new file mode 100644 index 000000000..078ef6b6d --- /dev/null +++ b/.github/actions/define-firmware-ver-action/action.yml @@ -0,0 +1,14 @@ +name: Define the firmware version + +outputs: + firmware_ver: + description: the firmware version number 0x000N + value: ${{ steps.define_firmware_ver.outputs.firmware_ver }} + +runs: + using: "composite" + steps: + - name: define firmware_ver + id: define_firmware_ver + run: echo "firmware_ver=0x0007" >> $GITHUB_OUTPUT + shell: bash diff --git a/.github/actions/download-firmware-action/action.yml b/.github/actions/download-firmware-action/action.yml new file mode 100644 index 000000000..72a839c82 --- /dev/null +++ b/.github/actions/download-firmware-action/action.yml @@ -0,0 +1,63 @@ +name: Download the firmware + +inputs: + FIRMWARE_VARIANT: + required: true + type: string + FIRMWARE_RUN_ID: + required: false + type: string + +runs: + using: "composite" + steps: +# when the build is NOT part of a continuous release, the firware hex from the most recent continuous release will be packaged with the desktop interface + - name: Determine download url for the firmware from the most recent continuous release + if: github.event.workflow != '.github/workflows/continuous.yml' + id: run_query + run: | + HEX_URL=$(gh api graphql -f query='query {repository ( owner : "brentfpage", name: "Labrador") {release ( tagName: "continuous" ) {releaseAssets(first:10) {nodes {downloadUrl}}}}}' | jq -r '.data.repository.release.releaseAssets.nodes[] | select(.downloadUrl| test("${{ inputs.FIRMWARE_VARIANT }}.hex")) | .[]') + echo "firmware_url=${HEX_URL}" >> $GITHUB_OUTPUT + env: + GH_TOKEN: ${{ github.token }} + shell: bash + +# query description: get at most 10 assets from the most recent continuous release (assume there are fewer than 10), find the one that includes FIRMWARE_VARIANT.hex in the download url +# prettified (ish) query: +# query {\ +# repository ( owner : "espotek-org", name: "Labrador") {\ +# release ( tagName: "continuous" ) {\ +# releaseAssets(first:10) {\ +# nodes {\ +# downloadUrl\ +# }\ +# }\ +# }\ +# }\ +# }\ +# ' | jq -r '.data.repository.release.releaseAssets.nodes[] | select(.downloadUrl| test("${{ inputs.FIRMWARE_VARIANT }}.hex")) | .[]' + + - name: Download firmware from most recent continuous release + if: github.event.workflow != '.github/workflows/continuous.yml' + run: | + mkdir asset-hex + wget --directory-prefix=asset-hex ${{ steps.run_query.outputs.firmware_url }} + shell: bash + +# when the build is part of a continuous release, the release's firmware hex will be packaged with the desktop interface + - name: Download firmware from in-process continuous release + if: github.event.workflow == '.github/workflows/continuous.yml' + uses: actions/download-artifact@v4 + with: + run-id: ${{ inputs.FIRMWARE_RUN_ID }} + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: move firmware to appropriate directory + run: | + mv asset-hex/*${{ inputs.FIRMWARE_VARIANT }}.hex Desktop_Interface/resources/firmware + shell: bash + + + + + diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index b2c58e7c2..a8d3df409 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -7,6 +7,10 @@ permissions: on: workflow_dispatch: workflow_call: + inputs: + FIRMWARE_RUN_ID: + required: true + type: string push: branches: @@ -31,6 +35,17 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Define firmware version + id: define_firmware_version + uses: ./.github/actions/define-firmware-ver-action + + - name: Download firmware + id: download_firmware + uses: ./.github/actions/download-firmware-action + with: + FIRMWARE_VARIANT: '02' + FIRMWARE_RUN_ID: ${{ github.event.workflow == './github/workflows/continuous.yml' && inputs.FIRMWARE_RUN_ID || ''}} # for grabbing the firmware from an in-process continuous release + - name: Install Qt uses: jurplel/install-qt-action@v4 with: @@ -74,13 +89,13 @@ jobs: export ANDROID_NDK_ROOT="${ANDROID_SDK_ROOT}/ndk/21.3.6528147" APK_BASENAME="Labrador-$(git rev-parse --short HEAD)" if [ -e cert.cer ] && [ -e cert.p8 ]; then - qmake -config release + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver }} make -j$(nproc) make INSTALL_ROOT=android-build install JAVA_HOME=${JAVA_HOME_8_X64} androiddeployqt --input android-Labrador-deployment-settings.json --output android-build --aab --android-platform android-31 --verbose --gradle --release ${ANDROID_SDK_ROOT}/build-tools/31.0.0/apksigner sign --in android-build/build/outputs/apk/release/android-build-release-unsigned.apk --out ${APK_BASENAME}-release-signed.apk --key cert.p8 --cert cert.cer --verbose else - qmake -config debug + qmake -config debug EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver }} make -j$(nproc) make INSTALL_ROOT=android-build install JAVA_HOME=${JAVA_HOME_8_X64} androiddeployqt --input android-Labrador-deployment-settings.json --output android-build --aab --android-platform android-31 --verbose --gradle diff --git a/.github/workflows/continuous.yml b/.github/workflows/continuous.yml index 18c3a4094..692bac055 100644 --- a/.github/workflows/continuous.yml +++ b/.github/workflows/continuous.yml @@ -8,27 +8,48 @@ on: workflow_dispatch: jobs: + build-firmware: + uses: ./.github/workflows/firmware.yml + secrets: inherit build-android: + needs: + - build-firmware uses: ./.github/workflows/android.yml + with: + FIRMWARE_RUN_ID: ${{ needs.build-firmware.outputs.run_id }} secrets: inherit build-linux: + needs: + - build-firmware uses: ./.github/workflows/linux.yml + with: + FIRMWARE_RUN_ID: ${{ needs.build-firmware.outputs.run_id }} secrets: inherit build-mac: + needs: + - build-firmware uses: ./.github/workflows/mac.yml + with: + FIRMWARE_RUN_ID: ${{ needs.build-firmware.outputs.run_id }} secrets: inherit - build-windows: - uses: ./.github/workflows/windows.yml - secrets: inherit + +# build-windows: +# needs: +# - build-firmware +# uses: ./.github/workflows/windows.yml +# with: +# FIRMWARE_RUN_ID: ${{ needs.build-firmware.outputs.run_id }} +# secrets: inherit release: permissions: contents: write needs: + - build-firmware - build-android - build-linux - build-mac - - build-windows +# - build-windows if: github.ref == 'refs/heads/master' runs-on: ubuntu-latest steps: diff --git a/.github/workflows/firmware.yml b/.github/workflows/firmware.yml new file mode 100644 index 000000000..3750d582d --- /dev/null +++ b/.github/workflows/firmware.yml @@ -0,0 +1,62 @@ +name: Build firmware + +permissions: + contents: read + pull-requests: write + +on: + workflow_call: + outputs: + run_id: + description: the run-id of the workflow run + value: ${{ jobs.build-hex.outputs.run_id }} + workflow_dispatch: + push: + + +jobs: + build-hex: + runs-on: ubuntu-latest + outputs: + run_id: ${{ steps.step_get_run_id.outputs.RUN_ID }} + steps: + - name : Checkout repository + uses: actions/checkout@v4 + + - name: Define firmware version + id: define_firmware_version + uses: ./.github/actions/define-firmware-ver-action + + - name : make 01 + uses: bazhenov/action-avr-make@v1.1 + with: + dir: AVR_Code + target: '01' + env: + FIRMWARE_VERSION_ID: ${{ steps.define_firmware_version.outputs.firmware_ver }} + + - name : make clean + uses: bazhenov/action-avr-make@v1.1 + with: + dir: AVR_Code + target: clean_o_d + + - name : make 02 + uses: bazhenov/action-avr-make@v1.1 + with: + dir: AVR_Code + target: '02' + env: + FIRMWARE_VERSION_ID: ${{ steps.define_firmware_version.outputs.firmware_ver }} + + - name: Upload hex artifacts + uses: actions/upload-artifact@v4 + with: + name: asset-hex + path: AVR_Code/labrafirm*.hex + compression-level: 0 + if-no-files-found: error + + - name: Prepare workflow run ID output + id: step_get_run_id + run: echo "RUN_ID=${{ github.run_id }}" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index ce0c12ac0..cba1541a0 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -7,6 +7,10 @@ permissions: on: workflow_dispatch: workflow_call: + inputs: + FIRMWARE_RUN_ID: + required: true + type: string push: branches: @@ -37,6 +41,17 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Define firmware version + id: define_firmware_version + uses: ./.github/actions/define-firmware-ver-action + + - name: Download firmware + id: download_firmware + uses: ./.github/actions/download-firmware-action + with: + FIRMWARE_VARIANT: '02' + FIRMWARE_RUN_ID: ${{ github.event.workflow == './github/workflows/continuous.yml' && inputs.FIRMWARE_RUN_ID || ''}} # for grabbing the firmware from an in-process continuous release + - name: Install dependencies run: | sudo apt-get update @@ -46,24 +61,25 @@ jobs: - name: Build librador working-directory: Librador_API/___librador/librador run: | - qmake -config release + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver }} make -j$(nproc) - name: Build librademo working-directory: Librador_API/___librador/librademo run: | - qmake -config release + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver }} make -j$(nproc) - name: Build basicdemo working-directory: Librador_API/___librador/basicdemo run: | - qmake -config release + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver }} make -j$(nproc) - name: Build AppImage working-directory: Desktop_Interface run: | + export EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver }} ./make_appimage - name: Upload artifacts @@ -88,6 +104,17 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Define firmware version + id: define_firmware_version + uses: ./.github/actions/define-firmware-ver-action + + - name: Download firmware + id: download_firmware + uses: ./.github/actions/download-firmware-action + with: + FIRMWARE_VARIANT: '02' +# FIRMWARE_RUN_ID: ${{ inputs.FIRMWARE_RUN_ID }} # for grabbing the firmware from an in-process continuous release + - name: Install dependencies run: | sudo apt-get update @@ -97,24 +124,25 @@ jobs: - name: Build librador working-directory: Librador_API/___librador/librador run: | - qmake -config release + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver }} make -j$(nproc) - name: Build librademo working-directory: Librador_API/___librador/librademo run: | - qmake -config release + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver }} make -j$(nproc) - name: Build basicdemo working-directory: Librador_API/___librador/basicdemo run: | - qmake -config release + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver }} make -j$(nproc) - name: Build Debian package working-directory: Desktop_Interface run: | + export EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver }} DEB_BUILD_OPTIONS=nostrip dpkg-buildpackage -b mv ../espotek-labrador*.deb ../Labrador-$(git rev-parse --short HEAD)-${{ matrix.arch }}.deb diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index e8c21199e..fbc103669 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -7,7 +7,10 @@ permissions: on: workflow_dispatch: workflow_call: - + inputs: + FIRMWARE_RUN_ID: + required: true + type: string push: branches: - master @@ -30,6 +33,17 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Define firmware version + id: define_firmware_version + uses: ./.github/actions/define-firmware-ver-action + + - name: Download firmware + id: download_firmware + uses: ./.github/actions/download-firmware-action + with: + FIRMWARE_VARIANT: '02' + FIRMWARE_RUN_ID: ${{ github.event.workflow == './github/workflows/continuous.yml' && inputs.FIRMWARE_RUN_ID || ''}} # for grabbing the firmware from an in-process continuous release + - name: Setup Homebrew dependencies run: | brew update @@ -40,19 +54,19 @@ jobs: - name: Build librador working-directory: Librador_API/___librador/librador run: | - qmake -config release + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver }} make -j$(sysctl -n hw.ncpu) - name: Build librademo working-directory: Librador_API/___librador/librademo run: | - qmake -config release + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver}} make -j$(sysctl -n hw.ncpu) - name: Build basicdemo working-directory: Librador_API/___librador/basicdemo run: | - qmake -config release + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver}} make -j$(sysctl -n hw.ncpu) - name: Import code signing certificate @@ -80,10 +94,10 @@ jobs: working-directory: Desktop_Interface run: | if ( env.MACOS_CERTIFICATE != '' && env.MACOS_CERTIFICATE_PWD != '' ); then - qmake -config release + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver}} else # for debugging - qmake -config debug + qmake -config debug EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver}} fi make -j$(sysctl -n hw.ncpu) macdeployqt Labrador.app -verbose=2 -libpath=build_mac/libdfuprog/lib/ diff --git a/AVR_Code/Makefile b/AVR_Code/Makefile new file mode 100755 index 000000000..72bba7866 --- /dev/null +++ b/AVR_Code/Makefile @@ -0,0 +1,249 @@ +# see https://github.com/espotek-org/Labrador/wiki/Building-from-source#building-the-firmware +# Usage : +# make 01 +# build a version of the firmware compatible with Windows x64 OSs +# make 02 +# build a version of the firmware compatible with all other OSs +# Here, OS refers to that of the machine with which the Labrador board will interface. +# After running 'make 01', to switch to building variant 02 instead, first run 'make clean'. +# The same goes for switching from building the 02 variant to building the 01 variant. +# Some details: +# In the build process for variant 01, the macro SINGLE_ENDPOINT_INTERFACE +# is undefined, while in the build process for variant 02, +# SINGLE_ENDPOINT_INTERFACE is defined. In several regions of the source +# code, the undefined/defined status of this macro determines which of two +# possible code blocks are compiled into the firmware. The collective effect +# of having SINGLE_ENDPOINT_INTERFACE defined is to "change the headers so +# that it uses 1x 1023-byte isochronous endpoint, rather than 6x 128-byte +# endpoints to send the scope/logic analyzer data" (from +# https://github.com/espotek-org/Labrador/issues/260) +# *NOTE* : there is a commented-out line defining SINGLE_ENDPOINT_INTERFACE in +# globals.h. If it is uncommented, both 'make 01' and 'make 02' will +# produce variant 02. Further, 'make 01' will mislabel the firmware with +# the suffix 01. It is recommended that this line in globals.h be left +# commented-out, which ensures that `make 01` and `make 02` work as +# expected. +LIB_DEP := +LIBS := +USER_OBJS := +OUTPUT_FILE_PATH := +OUTPUT_FILE_PATH =$(NAME).elf +OUTPUT_FILE_PATH_AS_ARGS +=$(NAME).elf +AVR_APP_PATH :=$$$AVR_APP_PATH$$$ + +CC=avr-gcc +SRC_DIR=./USB_BULK_TEST/src + +INCLUDES=-I"$(SRC_DIR)/ASF/common/services/usb/class/vendor/device/example/atxmega256a3bu_xmega_a3bu_xplained" -I"$(SRC_DIR)/ASF/common/services/usb/class/vendor/device/example" -I"$(SRC_DIR)/ASF/common/services/usb/udc" -I"$(SRC_DIR)/ASF/xmega/drivers/nvm" -I"$(SRC_DIR)/ASF/common/services/sleepmgr" -I"$(SRC_DIR)/ASF/common/services/clock" -I"$(SRC_DIR)/ASF/xmega/drivers/sleep" -I"$(SRC_DIR)/ASF/xmega/drivers/usb" -I"$(SRC_DIR)/ASF/xmega/drivers/cpu" -I"$(SRC_DIR)/ASF/common/services/usb/class/vendor" -I"$(SRC_DIR)/ASF/common/services/usb/class/vendor/device" -I"$(SRC_DIR)/ASF/common/services/usb" -I"$(SRC_DIR)mon/applications/user_application/user_board/config" -I"$(SRC_DIR)/ASF/xmega/utils" -I"$(SRC_DIR)/config" -I"$(SRC_DIR)/ASF/common/boards" -I"$(SRC_DIR)/ASF/xmega/utils/preprocessor" -I"$(SRC_DIR)/ASF/common/utils" -I"$(SRC_DIR)" -I"$(SRC_DIR)/ASF/common/boards/user_board" -I"$(SRC_DIR)/ASF/common/services/ioport" + +CFLAGS=-std=gnu99 -ffunction-sections -mmcu=atxmega32a4u -fsigned-char -funsigned-bitfields -fdata-sections -fshort-enums -fno-strict-aliasing -fno-jump-tables -fpack-struct -Wall -O2 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -DFIRMWARE_VERSION_ID=$(FIRMWARE_VERSION_ID) + +SHORT_FIRMWARE_VERSION_ID := $(shell fv='$(FIRMWARE_VERSION_ID)'; echo "$${fv:2:4}") +NAME=labrafirm_$(SHORT_FIRMWARE_VERSION_ID)_$(SUFFIX) + +OBJS += \ +$(SRC_DIR)/tiny_calibration.o \ +$(SRC_DIR)/tiny_dig.o \ +$(SRC_DIR)/tiny_eeprom.o \ +$(SRC_DIR)/ASF/common/boards/user_board/init.o \ +$(SRC_DIR)/ASF/common/services/ioport/xmega/ioport_compat.o \ +$(SRC_DIR)/main.o \ +$(SRC_DIR)/tiny_adc.o \ +$(SRC_DIR)/tiny_dac.o \ +$(SRC_DIR)/tiny_dma.o \ +$(SRC_DIR)/tiny_timer.o \ +$(SRC_DIR)/tiny_uart.o \ +$(SRC_DIR)/ASF/common/services/usb/class/vendor/device/example/atxmega256a3bu_xmega_a3bu_xplained/ui.o \ +$(SRC_DIR)/ASF/common/services/clock/xmega/sysclk.o \ +$(SRC_DIR)/ASF/common/services/sleepmgr/xmega/sleepmgr.o \ +$(SRC_DIR)/ASF/common/services/usb/class/vendor/device/udi_vendor.o \ +$(SRC_DIR)/ASF/common/services/usb/class/vendor/device/udi_vendor_desc.o \ +$(SRC_DIR)/ASF/common/services/usb/udc/udc.o \ +$(SRC_DIR)/ASF/xmega/drivers/nvm/nvm.o \ +$(SRC_DIR)/ASF/xmega/drivers/nvm/nvm_asm.o \ +$(SRC_DIR)/ASF/xmega/drivers/cpu/ccp.o \ +$(SRC_DIR)/ASF/xmega/drivers/usb/usb_device.o + +C_DEPS_AS_ARGS += \ +$(SRC_DIR)/tiny_calibration.d \ +$(SRC_DIR)/tiny_dig.d \ +$(SRC_DIR)/tiny_eeprom.d \ +$(SRC_DIR)/ASF/common/boards/user_board/init.d \ +$(SRC_DIR)/ASF/common/services/ioport/xmega/ioport_compat.d \ +$(SRC_DIR)/main.d \ +$(SRC_DIR)/tiny_adc.d \ +$(SRC_DIR)/tiny_dac.d \ +$(SRC_DIR)/tiny_dma.d \ +$(SRC_DIR)/tiny_timer.d \ +$(SRC_DIR)/tiny_uart.d \ +$(SRC_DIR)/ASF/common/services/usb/class/vendor/device/example/atxmega256a3bu_xmega_a3bu_xplained/ui.d \ +$(SRC_DIR)/ASF/common/services/clock/xmega/sysclk.d \ +$(SRC_DIR)/ASF/common/services/sleepmgr/xmega/sleepmgr.d \ +$(SRC_DIR)/ASF/common/services/usb/class/vendor/device/udi_vendor.d \ +$(SRC_DIR)/ASF/common/services/usb/class/vendor/device/udi_vendor_desc.d \ +$(SRC_DIR)/ASF/common/services/usb/udc/udc.d \ +$(SRC_DIR)/ASF/xmega/drivers/nvm/nvm.d \ +$(SRC_DIR)/ASF/xmega/drivers/nvm/nvm_asm.d \ +$(SRC_DIR)/ASF/xmega/drivers/cpu/ccp.d \ +$(SRC_DIR)/ASF/xmega/drivers/usb/usb_device.d + +OBJS_AS_ARGS += \ +$(SRC_DIR)/tiny_calibration.o \ +$(SRC_DIR)/tiny_dig.o \ +$(SRC_DIR)/tiny_eeprom.o \ +$(SRC_DIR)/ASF/common/boards/user_board/init.o \ +$(SRC_DIR)/ASF/common/services/ioport/xmega/ioport_compat.o \ +$(SRC_DIR)/main.o \ +$(SRC_DIR)/tiny_adc.o \ +$(SRC_DIR)/tiny_dac.o \ +$(SRC_DIR)/tiny_dma.o \ +$(SRC_DIR)/tiny_timer.o \ +$(SRC_DIR)/tiny_uart.o \ +$(SRC_DIR)/ASF/common/services/usb/class/vendor/device/example/atxmega256a3bu_xmega_a3bu_xplained/ui.o \ +$(SRC_DIR)/ASF/common/services/clock/xmega/sysclk.o \ +$(SRC_DIR)/ASF/common/services/sleepmgr/xmega/sleepmgr.o \ +$(SRC_DIR)/ASF/common/services/usb/class/vendor/device/udi_vendor.o \ +$(SRC_DIR)/ASF/common/services/usb/class/vendor/device/udi_vendor_desc.o \ +$(SRC_DIR)/ASF/common/services/usb/udc/udc.o \ +$(SRC_DIR)/ASF/xmega/drivers/nvm/nvm.o \ +$(SRC_DIR)/ASF/xmega/drivers/nvm/nvm_asm.o \ +$(SRC_DIR)/ASF/xmega/drivers/cpu/ccp.o \ +$(SRC_DIR)/ASF/xmega/drivers/usb/usb_device.o + +01: SUFFIX=01 +01: $(OUTPUT_FILE_PATH) + @echo NAME:$(NAME) + @echo CFLAGS:$(CFLAGS) + +02: CFLAGS+=-DSINGLE_ENDPOINT_INTERFACE +02: SUFFIX=02 +02: $(OUTPUT_FILE_PATH) + @echo NAME:$(NAME) + @echo CFLAGS:$(CFLAGS) + +$(SRC_DIR)/tiny_calibration.o: $(SRC_DIR)/tiny_calibration.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/tiny_dig.o: $(SRC_DIR)/tiny_dig.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/tiny_eeprom.o: $(SRC_DIR)/tiny_eeprom.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/ASF/common/boards/user_board/init.o: $(SRC_DIR)/ASF/common/boards/user_board/init.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/ASF/common/services/ioport/xmega/ioport_compat.o: $(SRC_DIR)/ASF/common/services/ioport/xmega/ioport_compat.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/main.o: $(SRC_DIR)/main.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/tiny_adc.o: $(SRC_DIR)/tiny_adc.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/tiny_dac.o: $(SRC_DIR)/tiny_dac.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/tiny_dma.o: $(SRC_DIR)/tiny_dma.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/tiny_timer.o: $(SRC_DIR)/tiny_timer.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/tiny_uart.o: $(SRC_DIR)/tiny_uart.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/ASF/common/services/usb/class/vendor/device/example/atxmega256a3bu_xmega_a3bu_xplained/ui.o: $(SRC_DIR)/ASF/common/services/usb/class/vendor/device/example/atxmega256a3bu_xmega_a3bu_xplained/ui.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/ASF/common/services/clock/xmega/sysclk.o: $(SRC_DIR)/ASF/common/services/clock/xmega/sysclk.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/ASF/common/services/sleepmgr/xmega/sleepmgr.o: $(SRC_DIR)/ASF/common/services/sleepmgr/xmega/sleepmgr.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/ASF/common/services/usb/class/vendor/device/udi_vendor.o: $(SRC_DIR)/ASF/common/services/usb/class/vendor/device/udi_vendor.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/ASF/common/services/usb/class/vendor/device/udi_vendor_desc.o: $(SRC_DIR)/ASF/common/services/usb/class/vendor/device/udi_vendor_desc.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/ASF/common/services/usb/udc/udc.o: $(SRC_DIR)/ASF/common/services/usb/udc/udc.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/ASF/xmega/drivers/cpu/ccp.o: $(SRC_DIR)/ASF/xmega/drivers/cpu/ccp.s + @echo Building file: $< + @$(CC) -x assembler-with-cpp -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/ASF/xmega/drivers/nvm/nvm.o: $(SRC_DIR)/ASF/xmega/drivers/nvm/nvm.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/ASF/xmega/drivers/nvm/nvm_asm.o: $(SRC_DIR)/ASF/xmega/drivers/nvm/nvm_asm.s + @echo Building file: $< + @$(CC) -x assembler-with-cpp -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/ASF/xmega/drivers/usb/usb_device.o: $(SRC_DIR)/ASF/xmega/drivers/usb/usb_device.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(OUTPUT_FILE_PATH): $(OBJS) $(USER_OBJS) $(OUTPUT_FILE_DEP) $(LIB_DEP) $(LINKER_SCRIPT_DEP) + @echo Building target: $@ + $(CC) -o$(OUTPUT_FILE_PATH_AS_ARGS) $(OBJS_AS_ARGS) $(USER_OBJS) $(LIBS) -Wl,-Map=$(NAME)".map" -Wl,-lm -mmcu=atxmega32a4u -Wl,--gc-sections -Wl,--relax + avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature $(NAME)".elf" $(NAME)".hex" + avr-objdump -h -S $(NAME)".elf" > $(NAME)".lss" + avr-objcopy -j .eeprom --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O binary $(NAME)".elf" $(NAME)".eep" || exit 0 + avr-objcopy -O srec -R .eeprom -R .fuse -R .lock -R .signature $(NAME)".elf" $(NAME)".srec" + avr-size $(NAME)".elf" + @echo Finished successfully: $(NAME) + +clean_o_d : + -rm -rf $(OBJS_AS_ARGS) + -rm -rf $(C_DEPS_AS_ARGS) +VARIANTS = 01 02 +clean : clean_o_d + $(foreach SUFFIX,$(VARIANTS), \ + rm -rf $(NAME).hex ; \ + rm -rf $(NAME).lss ; \ + rm -rf $(NAME).eep ; \ + rm -rf $(NAME).srec ; \ + rm -rf $(NAME).elf $(NAME).a $(NAME).map) diff --git a/AVR_Code/USB_BULK_TEST/Makefile b/AVR_Code/USB_BULK_TEST/Makefile deleted file mode 100755 index d14e3a548..000000000 --- a/AVR_Code/USB_BULK_TEST/Makefile +++ /dev/null @@ -1,242 +0,0 @@ -# see https://github.com/espotek-org/Labrador/wiki/Building-from-source#building-the-firmware -# Usage : -# make 0x01 -# build a version of the firmware compatible with Windows x64 OSs -# make 0x02 -# build a version of the firmware compatible with all other OSs -# Here, OS refers to that of the machine with which the Labrador board will interface. -# After running 'make 0x01', to switch to building variant 0x02 instead, first run 'make clean'. -# The same goes for switching from building the 0x02 variant to building the 0x01 variant. -# Some details: -# In the build process for variant 0x01, the macro SINGLE_ENDPOINT_INTERFACE -# is undefined, while in the build process for variant 0x02, -# SINGLE_ENDPOINT_INTERFACE is defined. In several regions of the source -# code, the undefined/defined status of this macro determines which of two -# possible code blocks are compiled into the firmware. The collective effect -# of having SINGLE_ENDPOINT_INTERFACE defined is to "change the headers so -# that it uses 1x 1023-byte isochronous endpoint, rather than 6x 128-byte -# endpoints to send the scope/logic analyzer data" (from -# https://github.com/espotek-org/Labrador/issues/260) -# *NOTE* : there is a commented-out line defining SINGLE_ENDPOINT_INTERFACE in -# globals.h. If it is uncommented, both 'make 0x01' and 'make 0x02' will -# produce variant 0x02. Further, 'make 0x01' will mislabel the firmware with -# the suffix 0x01. It is recommended that this line in globals.h be left -# commented-out, which ensures that `make 0x01` and `make 0x02` work as -# expected. -EXECUTABLES := -LIB_DEP := -LIBS := -USER_OBJS := -OUTPUT_FILE_PATH := -OUTPUT_FILE_PATH =$(NAME).elf -OUTPUT_FILE_PATH_AS_ARGS +=$(NAME).elf -AVR_APP_PATH :=$$$AVR_APP_PATH$$$ - -AVRDIR= -CC=$(AVRDIR)/bin/avr-gcc -INCLUDES=-I"./common/services/usb/class/vendor/device/example/atxmega256a3bu_xmega_a3bu_xplained" -I"./common/services/usb/class/vendor/device/example" -I"./src/ASF/common/services/usb/udc" -I"./src/ASF/xmega/drivers/nvm" -I"./src/ASF/common/services/sleepmgr" -I"./src/ASF/common/services/clock" -I"./src/ASF/xmega/drivers/sleep" -I"./src/ASF/xmega/drivers/usb" -I"./src/ASF/xmega/drivers/cpu" -I"./src/ASF/common/services/usb/class/vendor" -I"./src/ASF/common/services/usb/class/vendor/device" -I"./src/ASF/common/services/usb" -I"./common/applications/user_application/user_board/config" -I"./src/ASF/xmega/utils" -I"./src/config" -I"./src/ASF/common/boards" -I"./src/ASF/xmega/utils/preprocessor" -I"./src/ASF/common/utils" -I"./src" -I"./src/ASF/common/boards/user_board" -I"./src/ASF/common/services/ioport" - -CFLAGS=-std=gnu99 -ffunction-sections -mmcu=atxmega32a4u -fsigned-char -funsigned-bitfields -fdata-sections -fshort-enums -fno-strict-aliasing -fno-jump-tables -fpack-struct -Wall -O2 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -NAME=labrafirm_$(SUFFIX) - -OBJS += \ -./src/tiny_calibration.o \ -./src/tiny_dig.o \ -./src/tiny_eeprom.o \ -./src/ASF/common/boards/user_board/init.o \ -./src/ASF/common/services/ioport/xmega/ioport_compat.o \ -./src/main.o \ -./src/tiny_adc.o \ -./src/tiny_dac.o \ -./src/tiny_dma.o \ -./src/tiny_timer.o \ -./src/tiny_uart.o \ -./src/ASF/common/services/usb/class/vendor/device/example/atxmega256a3bu_xmega_a3bu_xplained/ui.o \ -./src/ASF/common/services/clock/xmega/sysclk.o \ -./src/ASF/common/services/sleepmgr/xmega/sleepmgr.o \ -./src/ASF/common/services/usb/class/vendor/device/udi_vendor.o \ -./src/ASF/common/services/usb/class/vendor/device/udi_vendor_desc.o \ -./src/ASF/common/services/usb/udc/udc.o \ -./src/ASF/xmega/drivers/nvm/nvm.o \ -./src/ASF/xmega/drivers/nvm/nvm_asm.o \ -./src/ASF/xmega/drivers/cpu/ccp.o \ -./src/ASF/xmega/drivers/usb/usb_device.o - -C_DEPS_AS_ARGS += \ -./src/tiny_calibration.d \ -./src/tiny_dig.d \ -./src/tiny_eeprom.d \ -./src/ASF/common/boards/user_board/init.d \ -./src/ASF/common/services/ioport/xmega/ioport_compat.d \ -./src/main.d \ -./src/tiny_adc.d \ -./src/tiny_dac.d \ -./src/tiny_dma.d \ -./src/tiny_timer.d \ -./src/tiny_uart.d \ -./src/ASF/common/services/usb/class/vendor/device/example/atxmega256a3bu_xmega_a3bu_xplained/ui.d \ -./src/ASF/common/services/clock/xmega/sysclk.d \ -./src/ASF/common/services/sleepmgr/xmega/sleepmgr.d \ -./src/ASF/common/services/usb/class/vendor/device/udi_vendor.d \ -./src/ASF/common/services/usb/class/vendor/device/udi_vendor_desc.d \ -./src/ASF/common/services/usb/udc/udc.d \ -./src/ASF/xmega/drivers/nvm/nvm.d \ -./src/ASF/xmega/drivers/nvm/nvm_asm.d \ -./src/ASF/xmega/drivers/cpu/ccp.d \ -./src/ASF/xmega/drivers/usb/usb_device.d - -OBJS_AS_ARGS += \ -./src/tiny_calibration.o \ -./src/tiny_dig.o \ -./src/tiny_eeprom.o \ -./src/ASF/common/boards/user_board/init.o \ -./src/ASF/common/services/ioport/xmega/ioport_compat.o \ -./src/main.o \ -./src/tiny_adc.o \ -./src/tiny_dac.o \ -./src/tiny_dma.o \ -./src/tiny_timer.o \ -./src/tiny_uart.o \ -./src/ASF/common/services/usb/class/vendor/device/example/atxmega256a3bu_xmega_a3bu_xplained/ui.o \ -./src/ASF/common/services/clock/xmega/sysclk.o \ -./src/ASF/common/services/sleepmgr/xmega/sleepmgr.o \ -./src/ASF/common/services/usb/class/vendor/device/udi_vendor.o \ -./src/ASF/common/services/usb/class/vendor/device/udi_vendor_desc.o \ -./src/ASF/common/services/usb/udc/udc.o \ -./src/ASF/xmega/drivers/nvm/nvm.o \ -./src/ASF/xmega/drivers/nvm/nvm_asm.o \ -./src/ASF/xmega/drivers/cpu/ccp.o \ -./src/ASF/xmega/drivers/usb/usb_device.o - -./src/tiny_calibration.o: ./src/tiny_calibration.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/tiny_dig.o: ./src/tiny_dig.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/tiny_eeprom.o: ./src/tiny_eeprom.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/ASF/common/boards/user_board/init.o: ./src/ASF/common/boards/user_board/init.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/ASF/common/services/ioport/xmega/ioport_compat.o: ./src/ASF/common/services/ioport/xmega/ioport_compat.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/main.o: ./src/main.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/tiny_adc.o: ./src/tiny_adc.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/tiny_dac.o: ./src/tiny_dac.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/tiny_dma.o: ./src/tiny_dma.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/tiny_timer.o: ./src/tiny_timer.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/tiny_uart.o: ./src/tiny_uart.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/ASF/common/services/usb/class/vendor/device/example/atxmega256a3bu_xmega_a3bu_xplained/ui.o: ./src/ASF/common/services/usb/class/vendor/device/example/atxmega256a3bu_xmega_a3bu_xplained/ui.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/ASF/common/services/clock/xmega/sysclk.o: ./src/ASF/common/services/clock/xmega/sysclk.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/ASF/common/services/sleepmgr/xmega/sleepmgr.o: ./src/ASF/common/services/sleepmgr/xmega/sleepmgr.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/ASF/common/services/usb/class/vendor/device/udi_vendor.o: ./src/ASF/common/services/usb/class/vendor/device/udi_vendor.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/ASF/common/services/usb/class/vendor/device/udi_vendor_desc.o: ./src/ASF/common/services/usb/class/vendor/device/udi_vendor_desc.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/ASF/common/services/usb/udc/udc.o: ./src/ASF/common/services/usb/udc/udc.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/ASF/xmega/drivers/cpu/ccp.o: ./src/ASF/xmega/drivers/cpu/ccp.s - @echo Building file: $< - @$(CC) -x assembler-with-cpp -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/ASF/xmega/drivers/nvm/nvm.o: ./src/ASF/xmega/drivers/nvm/nvm.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/ASF/xmega/drivers/nvm/nvm_asm.o: ./src/ASF/xmega/drivers/nvm/nvm_asm.s - @echo Building file: $< - @$(CC) -x assembler-with-cpp -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/ASF/xmega/drivers/usb/usb_device.o: ./src/ASF/xmega/drivers/usb/usb_device.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -0x01: SUFFIX=0x01 -0x01: $(OUTPUT_FILE_PATH) - -0x02: CFLAGS+=-DSINGLE_ENDPOINT_INTERFACE -0x02: SUFFIX=0x02 -0x02: $(OUTPUT_FILE_PATH) - -$(OUTPUT_FILE_PATH): $(OBJS) $(USER_OBJS) $(OUTPUT_FILE_DEP) $(LIB_DEP) $(LINKER_SCRIPT_DEP) - @echo Building target: $@ - $(CC) -o$(OUTPUT_FILE_PATH_AS_ARGS) $(OBJS_AS_ARGS) $(USER_OBJS) $(LIBS) -Wl,-Map=$(NAME)".map" -Wl,-lm -mmcu=atxmega32a4u -Wl,--gc-sections -Wl,--relax - $(AVRDIR)/bin/avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature $(NAME)".elf" $(NAME)".hex" - $(AVRDIR)/bin/avr-objdump -h -S $(NAME)".elf" > $(NAME)".lss" - $(AVRDIR)/bin/avr-objcopy -j .eeprom --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O binary $(NAME)".elf" $(NAME)".eep" || exit 0 - $(AVRDIR)/bin/avr-objcopy -O srec -R .eeprom -R .fuse -R .lock -R .signature $(NAME)".elf" $(NAME)".srec" - $(AVRDIR)/bin/avr-size $(NAME)".elf" - @echo Finished successfully: $(NAME) - -VARIANTS = 0x01 0x02 -clean : - -rm -rf $(OBJS_AS_ARGS) $(EXECUTABLES) - -rm -rf $(C_DEPS_AS_ARGS) - $(foreach SUFFIX,$(VARIANTS), \ - rm -rf $(NAME).hex ; \ - rm -rf $(NAME).lss ; \ - rm -rf $(NAME).eep ; \ - rm -rf $(NAME).srec ; \ - rm -rf $(NAME).elf $(NAME).a $(NAME).map) diff --git a/AVR_Code/USB_BULK_TEST/src/globals.h b/AVR_Code/USB_BULK_TEST/src/globals.h index e85cc0b87..f2c00e808 100644 --- a/AVR_Code/USB_BULK_TEST/src/globals.h +++ b/AVR_Code/USB_BULK_TEST/src/globals.h @@ -13,7 +13,7 @@ //#define VERO #define OVERCLOCK 48 -#define FIRMWARE_VERSION_ID 0x0007 +// #define FIRMWARE_VERSION_ID 0x0007 #define ATMEL_DFU_OFFSET 0x01fc #define TC_SPISLAVE TCD0 @@ -71,4 +71,4 @@ extern const unsigned char variant; #include "unified_debug_structure.h" extern unified_debug uds; -#endif /* GLOBALS_H_ */ \ No newline at end of file +#endif /* GLOBALS_H_ */ diff --git a/Desktop_Interface/Labrador.pro b/Desktop_Interface/Labrador.pro index efe0bab66..75fb2338a 100644 --- a/Desktop_Interface/Labrador.pro +++ b/Desktop_Interface/Labrador.pro @@ -32,6 +32,8 @@ equals(QCP_VER,"2"){ message("Using QCP2 with OpenGL support") } +DEFINES += "EXPECTED_FIRMWARE_VERSION=$${EXPECTED_FIRMWARE_VERSION}" + include(ui_elements.pri) MOC_DIR = moc diff --git a/Desktop_Interface/debian/rules b/Desktop_Interface/debian/rules index 0e5fbef48..1a130c5f3 100755 --- a/Desktop_Interface/debian/rules +++ b/Desktop_Interface/debian/rules @@ -18,7 +18,7 @@ export QT_SELECT = qt5 dh $@ override_dh_auto_configure: - dh_auto_configure -- -config release + dh_auto_configure -- -config release EXPECTED_FIRMWARE_VERSION=$(EXPECTED_FIRMWARE_VERSION) # Changelog is intentionally empty for rolling release, don't install it. override_dh_installchangelogs: diff --git a/Desktop_Interface/genericusbdriver.h b/Desktop_Interface/genericusbdriver.h index 95dcc7a57..3407a9344 100644 --- a/Desktop_Interface/genericusbdriver.h +++ b/Desktop_Interface/genericusbdriver.h @@ -16,7 +16,7 @@ //#include "buffercontrol.h" #include "unified_debug_structure.h" -#define EXPECTED_FIRMWARE_VERSION 0x0007 +//#define EXPECTED_FIRMWARE_VERSION 0x0007 #ifdef WINDOWS_64_BIT #define DEFINED_EXPECTED_VARIANT 1 diff --git a/Desktop_Interface/make_appimage b/Desktop_Interface/make_appimage index 2b254b3cd..4e9efbb06 100755 --- a/Desktop_Interface/make_appimage +++ b/Desktop_Interface/make_appimage @@ -4,7 +4,7 @@ set -e rm -rf AppDir export QT_SELECT=qt5 -qmake -config release PREFIX=/usr +qmake -config release PREFIX=/usr EXPECTED_FIRMWARE_VERSION=$EXPECTED_FIRMWARE_VERSION make -j$(nproc) make INSTALL_ROOT=AppDir install ; find AppDir/ cp -r build_linux/apprun-hooks AppDir/