Skip to content

Commit 00a02b8

Browse files
committed
pipxtreme: Updated chconf.h and mcuconf.h, resolve variable conflict between cmsis_system.c and HAL.
1 parent 5a8600c commit 00a02b8

3 files changed

Lines changed: 229 additions & 223 deletions

File tree

flight/PiOS/STM32F10x/mcuconf.h

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,46 @@
1+
/*
2+
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
#ifndef MCUCONF_H
18+
#define MCUCONF_H
19+
120
#define STM32F103_MCUCONF
221

22+
/*
23+
* HAL driver system settings.
24+
*/
325
#define STM32_NO_INIT TRUE
4-
#define STM32_PVD_ENABLE FALSE
5-
#define STM32_PLS STM32_PLS_LEV0
626
#define STM32_HSI_ENABLED TRUE
727
#define STM32_LSI_ENABLED TRUE
828
#define STM32_HSE_ENABLED TRUE
929
#define STM32_LSE_ENABLED FALSE
1030
#define STM32_SW STM32_SW_PLL
1131
#define STM32_PLLSRC STM32_PLLSRC_HSE
32+
#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1
1233
#define STM32_PREDIV_VALUE 1
1334
#define STM32_PLLMUL_VALUE 9
35+
#define STM32_HPRE STM32_HPRE_DIV1
36+
#define STM32_PPRE1 STM32_PPRE1_DIV2
37+
#define STM32_PPRE2 STM32_PPRE2_DIV2
38+
#define STM32_ADCPRE STM32_ADCPRE_DIV4
39+
#define STM32_USB_CLOCK_REQUIRED TRUE
40+
#define STM32_USBPRE STM32_USBPRE_DIV1P5
41+
#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK
42+
#define STM32_RTCSEL STM32_RTCSEL_HSEDIV
43+
#define STM32_PVD_ENABLE FALSE
44+
#define STM32_PLS STM32_PLS_LEV0
45+
46+
#endif // MCUCONF_H

flight/targets/pipxtreme/board-info/cmsis_system.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
*/
6868

6969
#include "stm32f10x.h"
70+
#include "pios_config.h"
7071

7172
/**
7273
* @}
@@ -152,6 +153,10 @@
152153
/*******************************************************************************
153154
* Clock Definitions
154155
*******************************************************************************/
156+
#if defined(PIOS_INCLUDE_CHIBIOS)
157+
/* ChibiOS supplies and inits this via HAL. */
158+
extern uint32_t SystemCoreClock;
159+
#else
155160
#ifdef SYSCLK_FREQ_HSE
156161
uint32_t SystemCoreClock = SYSCLK_FREQ_HSE; /*!< System Clock Frequency (Core Clock) */
157162
#elif defined SYSCLK_FREQ_24MHz
@@ -167,6 +172,7 @@
167172
#else /*!< HSI Selected as System Clock source */
168173
uint32_t SystemCoreClock = HSI_VALUE; /*!< System Clock Frequency (Core Clock) */
169174
#endif
175+
#endif // defined(PIOS_INCLUDE_CHIBIOS)
170176

171177
__I uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
172178
/**

0 commit comments

Comments
 (0)