1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-30 15:52:12 +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_LED
//#define PIOS_INCLUDE_SPI //#define PIOS_INCLUDE_SPI
#define PIOS_INCLUDE_SYS #define PIOS_INCLUDE_SYS
#define PIOS_INCLUDE_USART //#define PIOS_INCLUDE_USART
#define PIOS_INCLUDE_USB_HID #define PIOS_INCLUDE_USB_HID
#define PIOS_INCLUDE_OPAHRS //#define PIOS_INCLUDE_OPAHRS
#define PIOS_INCLUDE_COM #define PIOS_INCLUDE_COM
#define PIOS_INCLUDE_GPIO #define PIOS_INCLUDE_GPIO
#define PIOS_NO_GPS #define PIOS_NO_GPS

View File

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

View File

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

View File

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

View File

@ -65,9 +65,9 @@ TIM8 | | | |
#define FUNC_ID 3 #define FUNC_ID 3
#define HW_VERSION 21 #define HW_VERSION 21
#define BOOTLOADER_VERSION 0 #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 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) #define SIZE_OF_CODE (uint32_t)(MEM_SIZE-(START_OF_USER_CODE-0x08000000)-SIZE_OF_DESCRIPTION)
#ifdef STM32F10X_HD #ifdef STM32F10X_HD
#define HW_TYPE 0 //0=high_density 1=medium_density; #define HW_TYPE 0 //0=high_density 1=medium_density;

View File

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