Skip to content

Commit 92559b8

Browse files
committed
fixed style issues
1 parent 116b1c2 commit 92559b8

File tree

2 files changed

+27
-64
lines changed

2 files changed

+27
-64
lines changed

variants/AFROFLIGHT_F103CB/variant.cpp

+1-37
Original file line numberDiff line numberDiff line change
@@ -104,44 +104,8 @@ extern "C" {
104104
*/
105105
WEAK void SystemClock_Config(void)
106106
{
107-
/*
108-
RCC_OscInitTypeDef RCC_OscInitStruct;
109-
RCC_ClkInitTypeDef RCC_ClkInitStruct;
110-
RCC_PeriphCLKInitTypeDef PeriphClkInit;
111-
112-
/* Initializes the CPU, AHB and APB busses clocks * /
113-
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
114-
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
115-
RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1;
116-
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
117-
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
118-
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
119-
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9;
120-
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
121-
while (1);
122-
}
123-
124-
/* Initializes the CPU, AHB and APB busses clocks * /
125-
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
126-
| RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
127-
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
128-
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
129-
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
130-
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
131-
132-
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) {
133-
while (1);
134-
}
135-
136-
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_ADC | RCC_PERIPHCLK_USB;
137-
PeriphClkInit.AdcClockSelection = RCC_ADCPCLK2_DIV6;
138-
PeriphClkInit.UsbClockSelection = RCC_USBCLKSOURCE_PLL_DIV1_5;
139-
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) {
140-
while (1);
141-
}
142-
}*/
143107
//Board has 12mhz xtal, iám currenlty using HSI internal xtal , i've not figured settings for external 12mhz
144-
RCC_OscInitTypeDef RCC_OscInitStruct;
108+
RCC_OscInitTypeDef RCC_OscInitStruct;
145109
RCC_ClkInitTypeDef RCC_ClkInitStruct;
146110
RCC_PeriphCLKInitTypeDef PeriphClkInit;
147111

variants/AFROFLIGHT_F103CB/variant.h

+26-27
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ extern "C" {
9191
#define LED_BUILTIN PB4
9292
#endif
9393
#define LED_GREEN PB3
94-
#define LED_RED LED_BUILTIN
94+
#define LED_RED LED_BUILTIN
9595

9696

9797
// SPI Definitions
@@ -104,11 +104,10 @@ extern "C" {
104104
//#define PIN_WIRE_SDA PB7
105105
//#define PIN_WIRE_SCL PB6
106106
//On afroflight Rev 5 it's on i2c port 2 that MPU6050 is connected too
107-
#define PIN_WIRE_SDA PB11
108-
#define PIN_WIRE_SCL PB10
107+
#define PIN_WIRE_SDA PB11
108+
#define PIN_WIRE_SCL PB10
109+
109110

110-
//Wire.setSDA(PB11);
111-
//Wire.setSCL(PB10);
112111
// Timer Definitions
113112
// Do not use timer used by PWM pins when possible. See PinMap_PWM.
114113
#define TIMER_TONE TIM3
@@ -128,30 +127,30 @@ extern "C" {
128127
#define MPU_ADDR 0x68;
129128
#define MPU_INT PB13;
130129
/*
131-
* RC_CH1 T2C1 PA0
132-
* RC_CH2 T2C2 PA1
133-
* RC_CH3 T2C3/UA2_TX PA2
134-
* RC_CH4 T2C4/UA2_RX PA3
135-
* RC_CH5 T3C1 PA6
136-
* RC_CH6 T3C2 PA7
137-
* RC_CH7 T3C3 PB0
138-
* RC_CH8 T3C4 PB1
139-
*
140-
* PWM1 T1C1 PA8
141-
* PMW2 T1C4 PA11
142-
* PMW3 T4C1 PB6
143-
* PMW4 T4C2 PB7
144-
* PMW5 T4C3 PB8
145-
* PMW6 T4C4 PB9
146-
* SONAR_INT PA15
147-
* GPIO_BOTTOM PB5
148-
* TELEM_OUT PA13 //warning, you loose SWD access when using this pin , bootloader via uart is required after
130+
* RC_CH1 T2C1 PA0
131+
* RC_CH2 T2C2 PA1
132+
* RC_CH3 T2C3/UA2_TX PA2
133+
* RC_CH4 T2C4/UA2_RX PA3
134+
* RC_CH5 T3C1 PA6
135+
* RC_CH6 T3C2 PA7
136+
* RC_CH7 T3C3 PB0
137+
* RC_CH8 T3C4 PB1
138+
*
139+
* PWM1 T1C1 PA8
140+
* PMW2 T1C4 PA11
141+
* PMW3 T4C1 PB6
142+
* PMW4 T4C2 PB7
143+
* PMW5 T4C3 PB8
144+
* PMW6 T4C4 PB9
145+
* SONAR_INT PA15
146+
* GPIO_BOTTOM PB5
147+
* TELEM_OUT PA13//warning, you loose SWD access when using this pin , bootloader via uart is required after
149148
*
150-
* Power ADC ADC12_IN4 PA4 connected to 6 pin header Battery voltage in via resistor devider
151-
* ACC_INT PA5 // Connected to Intterupt pin of MMA84520 accelerometer I2C
149+
* BAT_ADC PA4 //Connected to 6 pin header Battery voltage in via resistor divider
150+
* ACC_INT PA5 //Connected to Intterupt pin of MMA84520 accelerometer I2C
152151
*
153-
* MAG_DRD PB12; //connected to HMC5883L compass I2C
154-
* BEEP PA12; //connected to Beep out transistor on 6 pin header
152+
* MAG_DRD PB12; //Connected to HMC5883L compass I2C
153+
* BEEP PA12; //Connected to Beep out transistor on 6 pin header
155154
*
156155
*/
157156

0 commit comments

Comments
 (0)