1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-29 07:24:13 +01:00

Fixes download being slow issue. Made some cleaning also

This commit is contained in:
zedamota 2011-04-29 19:22:21 +01:00
parent 0085256c6e
commit 3132de4e48
6 changed files with 13 additions and 62 deletions

View File

@ -1,7 +1,7 @@
/**
******************************************************************************
* @addtogroup OpenPilotBL OpenPilot BootLoader
* @brief These files contain the code to the OpenPilot MB Bootloader.
* @addtogroup CopterControlBL CopterControl BootLoader
* @brief These files contain the code to the CopterControl Bootloader.
*
* @{
* @file common.c

View File

@ -1,6 +1,7 @@
/**
******************************************************************************
* @addtogroup OpenPilotBL OpenPilot BootLoader
* @addtogroup CopterControlBL CopterControl BootLoader
* @brief These files contain the code to the CopterControl Bootloader.
* @{
* @file pios_config.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
@ -42,21 +43,6 @@
#define PIOS_INCLUDE_COM
#define PIOS_INCLUDE_GPIO
#define PIOS_NO_GPS
//#define DEBUG_SSP
/* Defaults for Logging */
#define LOG_FILENAME "PIOS.LOG"
#define STARTUP_LOG_ENABLED 1
/* COM Module */
#define GPS_BAUDRATE 19200
#define TELEM_BAUDRATE 19200
#define AUXUART_ENABLED 0
#define AUXUART_BAUDRATE 19200
/* Servos */
#define SERVOS_POSITION_MIN 800
#define SERVOS_POSITION_MAX 2200
#endif /* PIOS_CONFIG_H */
/**

View File

@ -1,7 +1,7 @@
/**
******************************************************************************
* @addtogroup OpenPilotBL OpenPilot BootLoader
* @{
* @addtogroup CopterControlBL CopterControl BootLoader
* @brief These files contain the code to the CopterControl Bootloader.
*
* @file stopwatch.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.

View File

@ -1,7 +1,7 @@
/**
******************************************************************************
* @addtogroup OpenPilotBL OpenPilot BootLoader
* @brief These files contain the code to the OpenPilot MB Bootloader.
* @addtogroup CopterControlBL CopterControl BootLoader
* @brief These files contain the code to the CopterControl Bootloader.
*
* @{
* @file main.c
@ -71,7 +71,7 @@ void jump_to_app();
#define BLUE LED1
// #define RED LED4
#define LED_PWM_TIMER TIM3
#define LED_PWM_TIMER TIM1
int main() {
/* NOTE: Do NOT modify the following start-up sequence */
/* Any new initialization functions should be added in OpenPilotInit() */

View File

@ -1,7 +1,7 @@
/**
******************************************************************************
* @addtogroup OpenPilotBL OpenPilot BootLoader
* @brief These files contain the code to the OpenPilot MB Bootloader.
* @addtogroup CopterControlBL CopterControl BootLoader
* @brief These files contain the code to the CopterControl Bootloader.
*
* @{
* @file op_dfu.c
@ -30,10 +30,6 @@
#include "pios.h"
#include "op_dfu.h"
#include "pios_bl_helper.h"
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
//programmable devices
Device devicesTable[10];
uint8_t numberOfDevices = 0;
@ -101,33 +97,9 @@ void DataDownload(DownloadAction action) {
{
DeviceState = Last_operation_failed;
}
/*
switch (currentProgrammingDestination) {
case Remote_flash_via_spi:
if (downType == Descript) {
SendBuffer[6 + (x * 4)]
= spi_dev_desc[(uint8_t) partoffset];
SendBuffer[7 + (x * 4)] = spi_dev_desc[(uint8_t) partoffset
+ 1];
SendBuffer[8 + (x * 4)] = spi_dev_desc[(uint8_t) partoffset
+ 2];
SendBuffer[9 + (x * 4)] = spi_dev_desc[(uint8_t) partoffset
+ 3];
}
break;
case Self_flash:
SendBuffer[6 + (x * 4)] = *PIOS_BL_HELPER_FLASH_If_Read(offset);
SendBuffer[7 + (x * 4)] = *PIOS_BL_HELPER_FLASH_If_Read(offset + 1);
SendBuffer[8 + (x * 4)] = *PIOS_BL_HELPER_FLASH_If_Read(offset + 2);
SendBuffer[9 + (x * 4)] = *PIOS_BL_HELPER_FLASH_If_Read(offset + 3);
break;
}
*/
}
//PIOS USB_SIL_Write(EP1_IN, (uint8_t*) SendBuffer, 64);
downPacketCurrent = downPacketCurrent + 1;
if (downPacketCurrent > downPacketTotal - 1) {
// STM_EVAL_LEDOn(LED2);
DeviceState = Last_operation_Success;
Aditionals = (uint32_t) Download;
}
@ -275,11 +247,9 @@ void processComand(uint8_t *xReceive_Buffer) {
++Next_Packet;
} else {
DeviceState = wrong_packet_received;
Aditionals = Count;
}
// FLASH_ProgramWord(MemLocations[TransferType]+4,++Next_Packet);//+Count,Data);
} else {
DeviceState = Last_operation_failed;
Aditionals = (uint32_t) Command;
@ -321,7 +291,6 @@ void processComand(uint8_t *xReceive_Buffer) {
Buffer[15] = devicesTable[Data0 - 1].devID;
}
sendData(Buffer + 1, 63);
//PIOS_COM_SendBuffer(PIOS_COM_TELEM_USB, Buffer + 1, 63);//FIX+1
break;
case JumpFW:
FLASH_Lock();
@ -350,7 +319,6 @@ void processComand(uint8_t *xReceive_Buffer) {
DeviceState = too_few_packets;
}
}
break;
case Download_Req:
#ifdef DEBUG_SSP
@ -474,7 +442,7 @@ void sendData(uint8_t * buf,uint16_t size)
{
PIOS_COM_SendBuffer(PIOS_COM_TELEM_USB, buf, size);
if(DeviceState == downloading)
PIOS_DELAY_WaitmS(10);
PIOS_DELAY_WaitmS(20);//this is an hack, we should check wtf is wrong with hid
}
bool flash_read(uint8_t * buffer, uint32_t adr, DFUProgType type) {

View File

@ -1,6 +1,6 @@
/**
******************************************************************************
* @addtogroup OpenPilotBL OpenPilot BootLoader
* @addtogroup CopterControlBL CopterControl BootLoader
* @{
*
* @file stopwatch.c
@ -35,9 +35,6 @@
// Local definitions
/////////////////////////////////////////////////////////////////////////////
//#define STOPWATCH_TIMER_BASE TIM6
//#define STOPWATCH_TIMER_RCC RCC_APB1Periph_TIM6
uint32_t STOPWATCH_Init(u32 resolution, TIM_TypeDef* TIM) {
uint32_t STOPWATCH_TIMER_RCC;
switch ((uint32_t)TIM) {