Skip to content

Commit

Permalink
add bluetooth IO:enable,state
Browse files Browse the repository at this point in the history
  • Loading branch information
wuyouwulv1314 committed Jul 1, 2014
1 parent a78f26b commit 593ed95
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 2 deletions.
Binary file added SkyQuad_v2_Sch.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion Src/algorithm/my_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#define MyKp 15
#define MyKi 0
//#define MyKd 20
#define MyKd 10
#define MyKd 6

#define RC_Scale 0.2
//#define RC_Scale_Throttle 0.8
Expand Down
16 changes: 16 additions & 0 deletions Src/driver/my_usart.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,22 @@
#include "DataReceiver.h"
#include <stdio.h>

void BT_IO_Config(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOC, ENABLE);

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOA, &GPIO_InitStructure);

GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13;
GPIO_Init(GPIOC, &GPIO_InitStructure);
//GPIO_ResetBits(GPIOC,GPIO_Pin_13);
GPIO_SetBits(GPIOC,GPIO_Pin_13);
}
void BT_USART_Config(void)/*{{{*/
{
GPIO_InitTypeDef GPIO_InitStructure;
Expand Down
1 change: 1 addition & 0 deletions Src/driver/my_usart.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define __MY_UART__H__

void USART_Config(void);
void BT_IO_Config(void);
void BT_USART_Config(void);

#endif /*__MY_UART__H__*/
3 changes: 2 additions & 1 deletion Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ void periph_init(void)/*{{{*/
RCC_ClocksTypeDef systemclocks;
LED_Config();
USART_Config();
BT_IO_Config();
BT_USART_Config();
I2C_Config();
TIM_Interrupt_Config();
Expand Down Expand Up @@ -208,7 +209,7 @@ void periph_init(void)/*{{{*/
gLEDCounterG = 0;
gLEDCounterB = 0;

delay_ms(500);
delay_ms(1500);
calib_sensor();
gsPrintfActualLength = sprintf((uint8_t*)gsPrintfBuffer,(uint8_t*)"Boot Success.\r\n"
"System Freq:%dHz\r\n""Bulid"" "__DATE__" "__TIME__"\r\n"
Expand Down

0 comments on commit 593ed95

Please sign in to comment.