mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-20 10:54:14 +01:00
OP-21: Cleaning up a few things.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@302 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
9b1e548550
commit
8ba2d76cd6
@ -36,9 +36,9 @@ extern uint32_t FlashDestination;
|
||||
extern uint8_t file_name[FILE_NAME_LENGTH];
|
||||
|
||||
/* Local variables */
|
||||
uint32_t BlockNbr = 0, UserMemoryMask = 0;
|
||||
bool FlashProtection = FALSE;
|
||||
uint8_t tab_1024[1024] = { 0 };
|
||||
static uint32_t BlockNbr = 0, UserMemoryMask = 0;
|
||||
static bool FlashProtection = FALSE;
|
||||
static uint8_t tab_1024[1024] = { 0 };
|
||||
|
||||
/**
|
||||
* Main bootloader function
|
||||
@ -60,13 +60,13 @@ void StartBootloader(void)
|
||||
/* Test if any page of Flash memory where program user will be loaded is write protected */
|
||||
if((FLASH_GetWriteProtectionOptionByte() & UserMemoryMask) != UserMemoryMask) {
|
||||
FlashProtection = TRUE;
|
||||
SerialPutString(" Download Image To the STM32F10x Internal Flash ------- 1\r\n");
|
||||
SerialPutString(" Execute The New Program ------------------------------ 2\r\n");
|
||||
SerialPutString(" Disable the write protection ------------------------- 3\r\n");
|
||||
SerialPutString("Download Image To the STM32F10x Internal Flash ------- 1\r\n");
|
||||
SerialPutString("Execute The New Program ------------------------------ 2\r\n");
|
||||
SerialPutString("Disable the write protection ------------------------- 3\r\n");
|
||||
} else {
|
||||
FlashProtection = FALSE;
|
||||
SerialPutString(" Download Image To the STM32F10x Internal Flash ------- 1\r\n");
|
||||
SerialPutString(" Execute The New Program ------------------------------ 2\r\n");
|
||||
SerialPutString("Download Image To the STM32F10x Internal Flash ------- 1\r\n");
|
||||
SerialPutString("Execute The New Program ------------------------------ 2\r\n");
|
||||
}
|
||||
|
||||
/* Loop through 1mS check for specified time */
|
||||
|
@ -31,7 +31,7 @@ typedef void (*pFunction)(void);
|
||||
|
||||
/* Global Defines */
|
||||
#define CMD_STRING_SIZE 128
|
||||
#define ApplicationAddress (0x8008000)
|
||||
#define ApplicationAddress (0x8006000)
|
||||
#define PAGE_SIZE (0x800)
|
||||
#define FLASH_SIZE (0x80000) /* 512K */
|
||||
|
||||
|
@ -91,8 +91,8 @@
|
||||
// PIOS_USART
|
||||
//-------------------------
|
||||
#define PIOS_USART_NUM 1
|
||||
#define PIOS_USART_RX_BUFFER_SIZE 128
|
||||
#define PIOS_USART_TX_BUFFER_SIZE 128
|
||||
#define PIOS_USART_RX_BUFFER_SIZE 64
|
||||
#define PIOS_USART_TX_BUFFER_SIZE 64
|
||||
#define PIOS_COM_DEBUG_PORT USART_1
|
||||
|
||||
//-------------------------
|
||||
|
@ -30,24 +30,14 @@
|
||||
|
||||
|
||||
/* Enable/Disable PiOS Modules */
|
||||
//#define PIOS_INCLUDE_ADC
|
||||
#define PIOS_INCLUDE_DELAY
|
||||
//#define PIOS_INCLUDE_I2C
|
||||
#define PIOS_INCLUDE_IRQ
|
||||
#define PIOS_INCLUDE_LED
|
||||
//#define PIOS_INCLUDE_PWM
|
||||
//#define PIOS_INCLUDE_SERVO
|
||||
//#define PIOS_INCLUDE_SPI
|
||||
#define PIOS_INCLUDE_SYS
|
||||
#define PIOS_INCLUDE_USART
|
||||
//#define PIOS_INCLUDE_USB_COM
|
||||
#define PIOS_INCLUDE_USB_HID
|
||||
#define PIOS_INCLUDE_USB
|
||||
//#define PIOS_INCLUDE_BMP085
|
||||
#define PIOS_INCLUDE_COM
|
||||
//#define PIOS_INCLUDE_SDCARD
|
||||
//#define PIOS_INCLUDE_SETTINGS
|
||||
//#define PIOS_INCLUDE_FREERTOS
|
||||
|
||||
#if !defined(PIOS_INCLUDE_FREERTOS)
|
||||
#define vSemaphoreCreateBinary(a) a = 0;
|
||||
|
@ -64,9 +64,6 @@
|
||||
#define CONVERTHEX_alpha(c) (IS_AF(c) ? (c - 'A'+10) : (c - 'a'+10))
|
||||
#define CONVERTHEX(c) (IS_09(c) ? (c - '0') : CONVERTHEX_alpha(c))
|
||||
|
||||
/* Global Variables */
|
||||
extern uint8_t tab_1024[1024];
|
||||
|
||||
/* Public Functions */
|
||||
extern int32_t Ymodem_Receive(uint8_t *buf);
|
||||
|
||||
|
@ -34,7 +34,6 @@ static uint32_t Str2Int(uint8_t *inputstr, int32_t *intnum);
|
||||
|
||||
/* Global variables */
|
||||
uint32_t FlashDestination = ApplicationAddress; /* Flash user program offset */
|
||||
uint8_t tab_1024[1024];
|
||||
|
||||
/* Local variables */
|
||||
static uint8_t file_name[FILE_NAME_LENGTH];
|
||||
|
@ -27,7 +27,7 @@
|
||||
# Set to YES for debugging
|
||||
DEBUG = YES
|
||||
ENABLE_DEBUG_PINS = NO
|
||||
USE_BOOTLOADER = NO
|
||||
USE_BOOTLOADER = YES
|
||||
|
||||
# Set to YES when using Code Sourcery toolchain
|
||||
CODE_SOURCERY = YES
|
||||
|
@ -206,7 +206,7 @@ TIM8 | Servo 5 | Servo 6 | Servo 7 | Servo 8
|
||||
#define PIOS_MASTER_CLOCK 72000000
|
||||
#define PIOS_PERIPHERAL_CLOCK (PIOS_MASTER_CLOCK / 2)
|
||||
#if defined(USE_BOOTLOADER)
|
||||
#define PIOS_NVIC_VECTTAB_FLASH ((uint32_t)0x08008000)
|
||||
#define PIOS_NVIC_VECTTAB_FLASH ((uint32_t)0x08006000)
|
||||
#else
|
||||
#define PIOS_NVIC_VECTTAB_FLASH ((uint32_t)0x08000000)
|
||||
#endif
|
||||
|
@ -77,6 +77,7 @@ int32_t PIOS_COM_SendBufferNonBlocking(COMPortTypeDef port, uint8_t *buffer, uin
|
||||
{
|
||||
/* Branch depending on selected port */
|
||||
switch(port) {
|
||||
#if defined(PIOS_INCLUDE_USART)
|
||||
case COM_DEBUG_USART:
|
||||
return PIOS_USART_TxBufferPutMoreNonBlocking(PIOS_COM_DEBUG_PORT, buffer, len);
|
||||
case COM_USART1:
|
||||
@ -85,6 +86,7 @@ int32_t PIOS_COM_SendBufferNonBlocking(COMPortTypeDef port, uint8_t *buffer, uin
|
||||
return PIOS_USART_TxBufferPutMoreNonBlocking(USART_2, buffer, len);
|
||||
case COM_USART3:
|
||||
return PIOS_USART_TxBufferPutMoreNonBlocking(USART_3, buffer, len);
|
||||
#endif
|
||||
case COM_USB_HID:
|
||||
return PIOS_USB_HID_TxBufferPutMoreNonBlocking(buffer, len);
|
||||
default:
|
||||
@ -106,6 +108,7 @@ int32_t PIOS_COM_SendBuffer(COMPortTypeDef port, uint8_t *buffer, uint16_t len)
|
||||
{
|
||||
/* Branch depending on selected port */
|
||||
switch(port) {
|
||||
#if defined(PIOS_INCLUDE_USART)
|
||||
case COM_DEBUG_USART:
|
||||
return PIOS_USART_TxBufferPutMore(PIOS_COM_DEBUG_PORT, buffer, len);
|
||||
case COM_USART1:
|
||||
@ -114,6 +117,7 @@ int32_t PIOS_COM_SendBuffer(COMPortTypeDef port, uint8_t *buffer, uint16_t len)
|
||||
return PIOS_USART_TxBufferPutMore(USART_2, buffer, len);
|
||||
case COM_USART3:
|
||||
return PIOS_USART_TxBufferPutMore(USART_3, buffer, len);
|
||||
#endif
|
||||
case COM_USB_HID:
|
||||
return PIOS_USB_HID_TxBufferPutMore(buffer, len);
|
||||
default:
|
||||
@ -224,6 +228,7 @@ int32_t PIOS_COM_SendFormattedString(COMPortTypeDef port, char *format, ...)
|
||||
uint8_t PIOS_COM_ReceiveBuffer(COMPortTypeDef port)
|
||||
{
|
||||
switch(port) {
|
||||
#if defined(PIOS_INCLUDE_USART)
|
||||
case COM_DEBUG_USART:
|
||||
return PIOS_USART_RxBufferGet(PIOS_COM_DEBUG_PORT);
|
||||
case COM_USART1:
|
||||
@ -232,6 +237,7 @@ uint8_t PIOS_COM_ReceiveBuffer(COMPortTypeDef port)
|
||||
return PIOS_USART_RxBufferGet(USART_2);
|
||||
case COM_USART3:
|
||||
return PIOS_USART_RxBufferGet(USART_3);
|
||||
#endif
|
||||
case COM_USB_HID:
|
||||
return PIOS_USB_HID_RxBufferGet();
|
||||
/* To suppress warnings */
|
||||
@ -248,6 +254,7 @@ uint8_t PIOS_COM_ReceiveBuffer(COMPortTypeDef port)
|
||||
int32_t PIOS_COM_ReceiveBufferUsed(COMPortTypeDef port)
|
||||
{
|
||||
switch(port) {
|
||||
#if defined(PIOS_INCLUDE_USART)
|
||||
case COM_DEBUG_USART:
|
||||
return PIOS_USART_RxBufferUsed(PIOS_COM_DEBUG_PORT);
|
||||
case COM_USART1:
|
||||
@ -256,6 +263,7 @@ int32_t PIOS_COM_ReceiveBufferUsed(COMPortTypeDef port)
|
||||
return PIOS_USART_RxBufferUsed(USART_2);
|
||||
case COM_USART3:
|
||||
return PIOS_USART_RxBufferUsed(USART_3);
|
||||
#endif
|
||||
case COM_USB_HID:
|
||||
return PIOS_USB_HID_DATA_LENGTH;
|
||||
/* To suppress warnings */
|
||||
|
@ -28,7 +28,7 @@
|
||||
MEMORY
|
||||
{
|
||||
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K
|
||||
FLASH (rx) : ORIGIN = 0x08008000, LENGTH = 480K
|
||||
FLASH (rx) : ORIGIN = 0x08006000, LENGTH = 488K
|
||||
FLASHB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
||||
EXTMEMB0 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
||||
EXTMEMB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user