More cleaning in bootloader
This commit is contained in:
@@ -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 \
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@@ -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
|
||||
*
|
||||
* <h2><center>© COPYRIGHT 2012 STMicroelectronics</center></h2>
|
||||
*
|
||||
* 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****/
|
||||
+1
-1
@@ -708,8 +708,8 @@ ifeq ($(PCB), TARANIS)
|
||||
endif
|
||||
|
||||
ifeq ($(BOOTLOADER), YES)
|
||||
CPPDEFS += -DBOOTLOADER
|
||||
CPPSRC += loadboot.cpp
|
||||
CPPDEFS += -DBOOTLOADER
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
+3
-1
@@ -1111,7 +1111,7 @@ template<class t> 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 <CoOS.h>
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user