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

Small cleanup changes.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@200 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
gussy 2010-02-28 04:47:51 +00:00 committed by gussy
parent 93901e8754
commit 9bce59ef1a
4 changed files with 12 additions and 5 deletions

View File

@ -76,14 +76,14 @@ void PIOS_BMP085_Init(void)
EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising;
EXTI_InitStructure.EXTI_LineCmd = ENABLE;
EXTI_Init(&EXTI_InitStructure);
//EXTI_Init(&EXTI_InitStructure);
/* Enable and set EOC EXTI Interrupt to the lowest priority */
NVIC_InitStructure.NVIC_IRQChannel = BMP085_EOC_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 15;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 15;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
//NVIC_Init(&NVIC_InitStructure);
/* Read all 22 bytes of calibration data in one transfer, this is a very optimised way of doing things */
uint8_t Data[22];
@ -160,7 +160,7 @@ void PIOS_BMP085_GetValues(uint16_t *Pressure, uint16_t *Altitude, uint16_t *Tem
int32_t X1, X2, X3, B3, B5, B6, P;
uint32_t B4, B7;
/* Convert Temperatre */
/* Convert Temperature */
X1 = (RawTemperature - CalibData.AC6) * CalibData.AC5 >> 15;
X2 = ((int32_t) CalibData.MC << 11) / (X1 + CalibData.MD);
B5 = X1 + X2;

View File

@ -61,7 +61,6 @@ void PIOS_Servo_Init(void)
TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
TIM_TimeBaseStructInit(&TIM_TimeBaseStructure);
TIM_TimeBaseStructure.TIM_Prescaler = (MASTER_CLOCK / 1000000) - 1;
TIM_TimeBaseStructure.TIM_Period = (20000 - 1);
TIM_TimeBaseStructure.TIM_ClockDivision = TIM_CKD_DIV1;
TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
@ -69,7 +68,9 @@ void PIOS_Servo_Init(void)
TIM_OCInitTypeDef TIM_OCInitStructure;
/* TIM4 */
TIM_TimeBaseStructure.TIM_Period = (20000 - 1);
TIM_TimeBaseInit(TIM4, &TIM_TimeBaseStructure);
TIM_OCStructInit(&TIM_OCInitStructure);
TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1;
TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable;
@ -88,7 +89,9 @@ void PIOS_Servo_Init(void)
TIM_Cmd(TIM4, ENABLE);
/* TIM8 */
TIM_TimeBaseStructure.TIM_Period = (20000 - 1);
TIM_TimeBaseInit(TIM8, &TIM_TimeBaseStructure);
TIM_OCStructInit(&TIM_OCInitStructure);
TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1;
TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable;

View File

@ -100,8 +100,12 @@ int main()
//PIOS_PWM_Init();
PIOS_USB_Init(0);
PIOS_COM_ReceiveCallbackInit(CONSOLE_Parse);
//PIOS_BMP085_Init();
/* Initialise OpenPilot application */
// OpenPilotInit();