mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-29 14:52:12 +01:00
Merge remote-tracking branch 'origin/next' into Brian-PipXtreme-V2
This commit is contained in:
commit
84a19ebeab
8
Makefile
8
Makefile
@ -461,14 +461,6 @@ BU_BOARDS := $(ALL_BOARDS)
|
|||||||
BL_BOARDS := $(filter-out ins, $(BL_BOARDS))
|
BL_BOARDS := $(filter-out ins, $(BL_BOARDS))
|
||||||
BU_BOARDS := $(filter-out ins, $(BU_BOARDS))
|
BU_BOARDS := $(filter-out ins, $(BU_BOARDS))
|
||||||
|
|
||||||
# FIXME: The CC bootloader updaters don't work anymore due to
|
|
||||||
# differences between CC and CC3D
|
|
||||||
BU_BOARDS := $(filter-out coptercontrol, $(BU_BOARDS))
|
|
||||||
|
|
||||||
# FIXME: PipXtreme bootloader updater doesn't work due to missing
|
|
||||||
# definitions for LEDs
|
|
||||||
BU_BOARDS := $(filter-out pipxtreme, $(BU_BOARDS))
|
|
||||||
|
|
||||||
# Generate the targets for whatever boards are left in each list
|
# Generate the targets for whatever boards are left in each list
|
||||||
FW_TARGETS := $(addprefix fw_, $(FW_BOARDS))
|
FW_TARGETS := $(addprefix fw_, $(FW_BOARDS))
|
||||||
BL_TARGETS := $(addprefix bl_, $(BL_BOARDS))
|
BL_TARGETS := $(addprefix bl_, $(BL_BOARDS))
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
/* Prototype of PIOS_Board_Init() function */
|
/* Prototype of PIOS_Board_Init() function */
|
||||||
extern void PIOS_Board_Init(void);
|
extern void PIOS_Board_Init(void);
|
||||||
extern void FLASH_Download();
|
extern void FLASH_Download();
|
||||||
void error(int);
|
void error(void);
|
||||||
|
|
||||||
/* The ADDRESSES of the _binary_* symbols are the important
|
/* The ADDRESSES of the _binary_* symbols are the important
|
||||||
* data. This is non-intuitive for _binary_size where you
|
* data. This is non-intuitive for _binary_size where you
|
||||||
@ -50,14 +50,11 @@ int main() {
|
|||||||
|
|
||||||
PIOS_SYS_Init();
|
PIOS_SYS_Init();
|
||||||
PIOS_Board_Init();
|
PIOS_Board_Init();
|
||||||
PIOS_LED_On(PIOS_LED_HEARTBEAT);
|
|
||||||
PIOS_DELAY_WaitmS(3000);
|
|
||||||
PIOS_LED_Off(PIOS_LED_HEARTBEAT);
|
|
||||||
|
|
||||||
/// Self overwrite check
|
/// Self overwrite check
|
||||||
uint32_t base_address = SCB->VTOR;
|
uint32_t base_address = SCB->VTOR;
|
||||||
if ((0x08000000 + embedded_image_size) > base_address)
|
if ((0x08000000 + embedded_image_size) > base_address)
|
||||||
error(PIOS_LED_HEARTBEAT);
|
error();
|
||||||
///
|
///
|
||||||
FLASH_Unlock();
|
FLASH_Unlock();
|
||||||
|
|
||||||
@ -82,7 +79,7 @@ int main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (fail == true)
|
if (fail == true)
|
||||||
error(PIOS_LED_HEARTBEAT);
|
error();
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
@ -90,7 +87,6 @@ int main() {
|
|||||||
/// Bootloader programing
|
/// Bootloader programing
|
||||||
for (uint32_t offset = 0; offset < embedded_image_size/sizeof(uint32_t); ++offset) {
|
for (uint32_t offset = 0; offset < embedded_image_size/sizeof(uint32_t); ++offset) {
|
||||||
bool result = false;
|
bool result = false;
|
||||||
PIOS_LED_Toggle(PIOS_LED_HEARTBEAT);
|
|
||||||
for (uint8_t retry = 0; retry < MAX_WRI_RETRYS; ++retry) {
|
for (uint8_t retry = 0; retry < MAX_WRI_RETRYS; ++retry) {
|
||||||
if (result == false) {
|
if (result == false) {
|
||||||
result = (FLASH_ProgramWord(0x08000000 + (offset * 4), embedded_image_start[offset])
|
result = (FLASH_ProgramWord(0x08000000 + (offset * 4), embedded_image_start[offset])
|
||||||
@ -98,15 +94,9 @@ int main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (result == false)
|
if (result == false)
|
||||||
error(PIOS_LED_HEARTBEAT);
|
error();
|
||||||
}
|
}
|
||||||
///
|
///
|
||||||
for (uint8_t x = 0; x < 3; ++x) {
|
|
||||||
PIOS_LED_On(PIOS_LED_HEARTBEAT);
|
|
||||||
PIOS_DELAY_WaitmS(1000);
|
|
||||||
PIOS_LED_Off(PIOS_LED_HEARTBEAT);
|
|
||||||
PIOS_DELAY_WaitmS(1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Invalidate the bootloader updater so we won't run
|
/// Invalidate the bootloader updater so we won't run
|
||||||
/// the update again on the next power cycle.
|
/// the update again on the next power cycle.
|
||||||
@ -119,11 +109,7 @@ int main() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void error(int led) {
|
void error(void) {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
PIOS_LED_On(led);
|
|
||||||
PIOS_DELAY_WaitmS(500);
|
|
||||||
PIOS_LED_Off(led);
|
|
||||||
PIOS_DELAY_WaitmS(500);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ const struct pios_rcvr_driver pios_ppm_rcvr_driver = {
|
|||||||
#define PIOS_PPM_IN_MIN_NUM_CHANNELS 4
|
#define PIOS_PPM_IN_MIN_NUM_CHANNELS 4
|
||||||
#define PIOS_PPM_IN_MAX_NUM_CHANNELS PIOS_PPM_NUM_INPUTS
|
#define PIOS_PPM_IN_MAX_NUM_CHANNELS PIOS_PPM_NUM_INPUTS
|
||||||
#define PIOS_PPM_STABLE_CHANNEL_COUNT 25 // frames
|
#define PIOS_PPM_STABLE_CHANNEL_COUNT 25 // frames
|
||||||
#define PIOS_PPM_IN_MIN_SYNC_PULSE_US 3800 // microseconds
|
#define PIOS_PPM_IN_MIN_SYNC_PULSE_US 3000 // microseconds
|
||||||
#define PIOS_PPM_IN_MIN_CHANNEL_PULSE_US 750 // microseconds
|
#define PIOS_PPM_IN_MIN_CHANNEL_PULSE_US 750 // microseconds
|
||||||
#define PIOS_PPM_IN_MAX_CHANNEL_PULSE_US 2250 // microseconds
|
#define PIOS_PPM_IN_MAX_CHANNEL_PULSE_US 2250 // microseconds
|
||||||
|
|
||||||
|
@ -55,20 +55,10 @@ void PIOS_SYS_Init(void)
|
|||||||
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOC | RCC_APB2Periph_GPIOD | RCC_APB2Periph_GPIOE |
|
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOC | RCC_APB2Periph_GPIOD | RCC_APB2Periph_GPIOE |
|
||||||
RCC_APB2Periph_AFIO, ENABLE);
|
RCC_APB2Periph_AFIO, ENABLE);
|
||||||
|
|
||||||
/* Activate pull-ups on all pins by default */
|
|
||||||
GPIO_InitTypeDef GPIO_InitStructure;
|
|
||||||
GPIO_StructInit(&GPIO_InitStructure);
|
|
||||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;
|
|
||||||
GPIO_InitStructure.GPIO_Pin = 0xffff;
|
|
||||||
GPIO_Init(GPIOB, &GPIO_InitStructure);
|
|
||||||
GPIO_Init(GPIOD, &GPIO_InitStructure);
|
|
||||||
#if (PIOS_USB_ENABLED)
|
|
||||||
GPIO_InitStructure.GPIO_Pin = 0xffff & ~GPIO_Pin_11 & ~GPIO_Pin_12; /* Exclude USB pins */
|
|
||||||
#endif
|
|
||||||
GPIO_Init(GPIOA, &GPIO_InitStructure);
|
|
||||||
|
|
||||||
#if (PIOS_USB_ENABLED)
|
#if (PIOS_USB_ENABLED)
|
||||||
/* Ensure that pull-up is active on detect pin */
|
/* Ensure that pull-up is active on detect pin */
|
||||||
|
GPIO_InitTypeDef GPIO_InitStructure;
|
||||||
|
GPIO_StructInit(&GPIO_InitStructure);
|
||||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;
|
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;
|
||||||
GPIO_InitStructure.GPIO_Pin = PIOS_USB_DETECT_GPIO_PIN;
|
GPIO_InitStructure.GPIO_Pin = PIOS_USB_DETECT_GPIO_PIN;
|
||||||
GPIO_Init(PIOS_USB_DETECT_GPIO_PORT, &GPIO_InitStructure);
|
GPIO_Init(PIOS_USB_DETECT_GPIO_PORT, &GPIO_InitStructure);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user