1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

OP-268/PipX Bootloader - Changed Timers for MD device, auto memory space fetching (as per people request ;)). Stripped unused functions to reduce size.

TESTED WORKS.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2431 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
zedamota 2011-01-14 15:33:24 +00:00 committed by zedamota
parent 3d8edce5ee
commit ad0b3e911d
6 changed files with 20 additions and 25 deletions

View File

@ -38,9 +38,9 @@
#define PIOS_INCLUDE_LED
//#define PIOS_INCLUDE_SPI
#define PIOS_INCLUDE_SYS
#define PIOS_INCLUDE_USART
//#define PIOS_INCLUDE_USART
#define PIOS_INCLUDE_USB_HID
#define PIOS_INCLUDE_OPAHRS
//#define PIOS_INCLUDE_OPAHRS
#define PIOS_INCLUDE_COM
#define PIOS_INCLUDE_GPIO
#define PIOS_NO_GPS

View File

@ -70,8 +70,8 @@ uint8_t processRX();
void jump_to_app();
#define BLUE LED1
#define RED LED2
#define LED_PWM_TIMER TIM6
#define RED LED4
#define LED_PWM_TIMER TIM3
int main() {
/* NOTE: Do NOT modify the following start-up sequence */
/* Any new initialization functions should be added in OpenPilotInit() */
@ -103,6 +103,7 @@ int main() {
JumpToApp = TRUE;
STOPWATCH_Reset(LED_PWM_TIMER);
while (TRUE) {
if (JumpToApp == TRUE)
jump_to_app();

View File

@ -324,12 +324,8 @@ extern const struct pios_com_driver pios_usart_com_driver;
extern const struct pios_com_driver pios_usb_com_driver;
#endif
struct pios_com_dev pios_com_devs[] =
{
{
.id = PIOS_USART_SERIAL,
.driver = &pios_usart_com_driver,
},
struct pios_com_dev pios_com_devs[] = { { .id = 0,
.driver = &pios_usb_com_driver, },
#if defined(PIOS_INCLUDE_USB_HID)
{
.id = 0,

View File

@ -41,14 +41,12 @@
uint32_t STOPWATCH_Init(u32 resolution, TIM_TypeDef* TIM) {
uint32_t STOPWATCH_TIMER_RCC;
switch ((uint32_t)TIM) {
case (uint32_t)TIM6:
STOPWATCH_TIMER_RCC = RCC_APB1Periph_TIM6;
break;
case (uint32_t)TIM7:
STOPWATCH_TIMER_RCC = RCC_APB1Periph_TIM7;
break;
case (uint32_t)TIM1: STOPWATCH_TIMER_RCC = RCC_APB2Periph_TIM1;break;
case (uint32_t)TIM2: STOPWATCH_TIMER_RCC = RCC_APB1Periph_TIM2; break;
case (uint32_t)TIM3: STOPWATCH_TIMER_RCC = RCC_APB1Periph_TIM3; break;
case (uint32_t)TIM4: STOPWATCH_TIMER_RCC = RCC_APB1Periph_TIM4; break;
default:
STOPWATCH_TIMER_RCC = RCC_APB1Periph_TIM6;
STOPWATCH_TIMER_RCC = RCC_APB2Periph_TIM1;
}
// enable timer clock

View File

@ -65,9 +65,9 @@ TIM8 | | | |
#define FUNC_ID 3
#define HW_VERSION 21
#define BOOTLOADER_VERSION 0
#define MEM_SIZE 0x20000 //128K
#define MEM_SIZE ((uint32_t)(*((volatile uint16_t *)(0x1FFFF7E0))) * 1024 - 1024) //128K
#define SIZE_OF_DESCRIPTION 100
#define START_OF_USER_CODE (uint32_t)0x08002000
#define START_OF_USER_CODE (uint32_t)0x08003000
#define SIZE_OF_CODE (uint32_t)(MEM_SIZE-(START_OF_USER_CODE-0x08000000)-SIZE_OF_DESCRIPTION)
#ifdef STM32F10X_HD
#define HW_TYPE 0 //0=high_density 1=medium_density;

View File

@ -1,6 +1,6 @@
MEMORY
{
FLASH (rx) : ORIGIN = 0x08004000, LENGTH = 112K
FLASH (rx) : ORIGIN = 0x08003000, LENGTH = 116K
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00005000
}