From a8d4297abe89040987ce273b9188b903e956a6f1 Mon Sep 17 00:00:00 2001 From: gussy Date: Sun, 14 Mar 2010 12:01:13 +0000 Subject: [PATCH] Small optimisations in bootloader code. git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@313 ebee16cc-31ac-478f-84a7-5cbb03baadba --- flight/Bootloaders/OpenPilot/bootloader.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/flight/Bootloaders/OpenPilot/bootloader.c b/flight/Bootloaders/OpenPilot/bootloader.c index 912cc358a..137282edf 100644 --- a/flight/Bootloaders/OpenPilot/bootloader.c +++ b/flight/Bootloaders/OpenPilot/bootloader.c @@ -36,9 +36,7 @@ extern uint32_t FlashDestination; extern uint8_t file_name[FILE_NAME_LENGTH]; /* Local variables */ -static uint32_t BlockNbr = 0, UserMemoryMask = 0; -static bool FlashProtection = FALSE; -static uint8_t tab_1024[1024] = { 0 }; +static uint32_t UserMemoryMask = 0; /** * Main bootloader function @@ -46,6 +44,8 @@ static uint8_t tab_1024[1024] = { 0 }; void StartBootloader(void) { uint8_t key = 0; + uint32_t BlockNbr = 0; + bool FlashProtection = FALSE; /* Get the number of block (4 or 2 pages) from where the user program will be loaded */ BlockNbr = (FlashDestination - 0x08000000) >> 12; @@ -190,12 +190,13 @@ static void FLASH_DisableWriteProtectionPages(void) */ static void SerialDownload(void) { + uint8_t tab_1024[1024] = { 0 }; int32_t Size = 0; SerialPutString("Waiting for the file to be sent ... (press 'a' to abort)\n\r"); Size = Ymodem_Receive(&tab_1024[0]); if(Size > 0) { - SerialPutString("\n\n\r Programming Completed Successfully!\n\r--------------------------------\r\n Name: "); + SerialPutString("\n\n\rProgramming Completed Successfully!\n\r"); } else if(Size == -1) { SerialPutString("\n\n\rThe image size is higher than the allowed space memory!\n\r"); } else if(Size == -2) {