diff --git a/radio/bootloader/Makefile b/radio/bootloader/Makefile
index 9e61997ab..3b87b4ff5 100644
--- a/radio/bootloader/Makefile
+++ b/radio/bootloader/Makefile
@@ -142,13 +142,13 @@ SRC = system_stm32f2xx.c \
../src/targets/taranis/usbd_desc.c \
../src/targets/taranis/usb_bsp.c
-CPPSRC = aspi.cpp \
+CPPSRC = ../src/targets/taranis/aspi.cpp \
lcd_driver.cpp \
driversboot.cpp \
logicioboot.cpp \
ff.cpp \
x9ddiskio.cpp \
- usbd_usr.cpp \
+ ../src/targets/taranis/usbd_usr.cpp \
usbd_storage_msd.cpp \
i2c_ee.cpp \
lcdboot.cpp \
diff --git a/radio/bootloader/aspi.cpp b/radio/bootloader/aspi.cpp
deleted file mode 100644
index 8de383af0..000000000
--- a/radio/bootloader/aspi.cpp
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
- ******************************************************************************
- * @file Project/spi/spi.c
- * @author X9D Application Team
- * @Hardware version V0.2
- * @date 11-July-2012
- * @brief This file provides spi Init(Analog spi),read and write.
- driver for LCD.
- * *
- ******************************************************************************
-*/
-
-#include "radio.h"
-#include "stm32f2xx.h"
-#include "stm32f2xx_gpio.h"
-#include "stm32f2xx_rcc.h"
-#include "hal.h"
-#include "aspi.h"
-
-#define __no_operation __NOP
-
-/**
-**********send command to lcd**************
-*/
-//hardware spi
-/*u16 spiCmd(u8 addr)
-{
- u8 readValue;
-
- SPI_RS_LOW();
- SPI_NCS_LOW();
-
- SPI_WRITE_BYTE(addr);
- SPI_WAIT_DONE();
-
- readValue=SPI_READ_BYTE();
- SPI_NCS_HIGH();
- return readValue;
-}*/
-
-//Anolog spi
-void AspiCmd(uint8_t Command_Byte)
-{
- int i=8;
- LCD_A0_LOW();
-
- LCD_CLK_HIGH();
- LCD_NCS_LOW();
-
- while (i--)
- {
- LCD_CLK_LOW();
- if(Command_Byte&0x80)
- {
- LCD_MOSI_HIGH();
- }
- else LCD_MOSI_LOW();
-
- Command_Byte=Command_Byte<<1;
- LCD_CLK_HIGH();
- }
- LCD_NCS_HIGH();
- LCD_A0_HIGH();
-}
-
-/**
-
-********send data to lcd**************
-
-*/
-
-//hardware spi
-/*
-u16 spiData(u8 addr)
-{
- u16 readValue;
- OLED_RS_HIGH();
- SPI_NCS_LOW();
-
- SPI_WRITE_BYTE(addr);
- SPI_WAIT_DONE();
-
- readValue=SPI_READ_BYTE();
- SPI_NCS_HIGH();
- return readValue;
-}
-*/
-
-//Anolog spi
-void AspiData(uint8_t Para_data)
-{
- int i=8;
- LCD_CLK_HIGH();
- LCD_A0_HIGH();
- LCD_NCS_LOW();
- while (i--)
- {
- if(Para_data&0x80)
- {
- LCD_MOSI_HIGH();
- }else LCD_MOSI_LOW();
- Para_data<<=1;
- LCD_CLK_LOW();
- __no_operation();
- LCD_CLK_HIGH();
- __no_operation();
- }
- LCD_NCS_HIGH();
- LCD_A0_HIGH();
-}
-
-/***
-**********read one byte in a register*******
-*/
-
-/*
-u16 spiRegAccess(u8 addrByte, u8 writeValue)
-{
- u8 readValue;
-
- SPI_NCS_LOW();
-
- SPI_WRITE_BYTE(addrByte);
- SPI_WAIT_DONE();
-
- SPI_WRITE_BYTE(writeValue);
- SPI_WAIT_DONE();
-
- readValue=SPI_READ_BYTE();
- SPI_NCS_HIGH();
- return readValue;
-}
-
-*/
-
-
diff --git a/radio/bootloader/usbd_usr.cpp b/radio/bootloader/usbd_usr.cpp
deleted file mode 100644
index dd78aba75..000000000
--- a/radio/bootloader/usbd_usr.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-/**
- ******************************************************************************
- * @file usbd_usr.c
- * @author MCD Application Team
- * @version V1.1.0
- * @date 19-March-2012
- * @brief This file includes the user application layer
- ******************************************************************************
- * @attention
- *
- *
© COPYRIGHT 2012 STMicroelectronics
- *
- * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
- * You may not use this file except in compliance with the License.
- * You may obtain a copy of the License at:
- *
- * http://www.st.com/software_license_agreement_liberty_v2
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************************
- */
-
-/* Includes ------------------------------------------------------------------*/
-#include "radio.h"
-
-extern "C" {
-#include "usbd_usr.h"
-
-/* Points to the DEVICE_PROP structure of current device */
-/* The purpose of this register is to speed up the execution */
-
-
-USBD_Usr_cb_TypeDef USR_cb =
-{
- USBD_USR_Init,
- USBD_USR_DeviceReset,
- USBD_USR_DeviceConfigured,
- USBD_USR_DeviceSuspended,
- USBD_USR_DeviceResumed,
-
- USBD_USR_DeviceConnected,
- USBD_USR_DeviceDisconnected,
-};
-}
-
-/**
-* @brief Whatever the user application needs to do when USB is initialised
-* @param None
-* @retval None
-*/
-void USBD_USR_Init(void)
-{
-
-}
-
-/**
-* @brief Displays the message on LCD on device reset event
-* @param speed : device speed
-* @retval None
-*/
-void USBD_USR_DeviceReset (uint8_t speed)
-{
-
-}
-
-
-/**
-* @brief Displays the message on LCD on device config event
-* @param None
-* @retval Staus
-*/
-void USBD_USR_DeviceConfigured (void)
-{
-
-}
-/**
-* @brief Displays the message on LCD on device suspend event
-* @param None
-* @retval None
-*/
-void USBD_USR_DeviceSuspended(void)
-{
-
-}
-
-
-/**
-* @brief Displays the message on LCD on device resume event
-* @param None
-* @retval None
-*/
-void USBD_USR_DeviceResumed(void)
-{
-
-}
-
-/**
-* @brief USBD_USR_DeviceConnected
-* Displays the message on LCD on device connection Event
-* @param None
-* @retval Staus
-*/
-void USBD_USR_DeviceConnected (void)
-{
-
-}
-
-
-/**
-* @brief USBD_USR_DeviceDisonnected
-* Displays the message on LCD on device disconnection Event
-* @param None
-* @retval Staus
-*/
-void USBD_USR_DeviceDisconnected (void)
-{
-// NVIC_SystemReset();
-}
-
-
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/radio/src/Makefile b/radio/src/Makefile
index 41c800531..eb132116e 100644
--- a/radio/src/Makefile
+++ b/radio/src/Makefile
@@ -708,8 +708,8 @@ ifeq ($(PCB), TARANIS)
endif
ifeq ($(BOOTLOADER), YES)
- CPPDEFS += -DBOOTLOADER
CPPSRC += loadboot.cpp
+ CPPDEFS += -DBOOTLOADER
endif
endif
diff --git a/radio/src/opentx.h b/radio/src/opentx.h
index 5c86d0dd3..9534ae9e1 100644
--- a/radio/src/opentx.h
+++ b/radio/src/opentx.h
@@ -1111,7 +1111,7 @@ template void swap(t & a, t & b) { t tmp = b; b = a; a = tmp; }
uint16_t isqrt32(uint32_t n);
#endif
-#if defined(CPUARM)
+#if defined(CPUARM) && !defined(BOOT)
#if !defined(SIMU)
extern "C" {
#include
@@ -1513,7 +1513,9 @@ enum AUDIO_SOUNDS {
#include "targets/gruvin9x/somo14d.h"
#endif
+#if !defined(BOOT)
#include "translations.h"
+#endif
#if defined(HAPTIC)
#include "haptic.h"
diff --git a/radio/src/targets/taranis/aspi.cpp b/radio/src/targets/taranis/aspi.cpp
index b03d54a6d..5aa1487a6 100644
--- a/radio/src/targets/taranis/aspi.cpp
+++ b/radio/src/targets/taranis/aspi.cpp
@@ -10,7 +10,7 @@
******************************************************************************
*/
-#include "../opentx.h"
+#include "../../opentx.h"
#include "./STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_gpio.h"
/**
diff --git a/radio/src/targets/taranis/usbd_usr.cpp b/radio/src/targets/taranis/usbd_usr.cpp
index 32fedc43c..26187ef41 100644
--- a/radio/src/targets/taranis/usbd_usr.cpp
+++ b/radio/src/targets/taranis/usbd_usr.cpp
@@ -26,7 +26,7 @@
*/
/* Includes ------------------------------------------------------------------*/
-#include "../opentx.h"
+#include "../../opentx.h"
extern "C" {
#include "usbd_usr.h"
@@ -119,7 +119,9 @@ void USBD_USR_DeviceConnected (void)
*/
void USBD_USR_DeviceDisconnected (void)
{
+#if !defined(BOOT)
NVIC_SystemReset();
+#endif
}