mirror of https://github.com/ARMmbed/mbed-os.git
Merge branch 'master' of git://github.com/bcostm/mbed into bcostm-master
commit
c9167e8c43
|
@ -153,8 +153,6 @@ __I uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}
|
|||
* @{
|
||||
*/
|
||||
|
||||
void SetSysClock(void);
|
||||
|
||||
#if (USE_PLL_HSE_XTAL != 0) || (USE_PLL_HSE_EXTC != 0)
|
||||
uint8_t SetSysClock_PLL_HSE(uint8_t bypass);
|
||||
#endif
|
||||
|
@ -208,10 +206,6 @@ void SystemInit(void)
|
|||
/* Disable all interrupts */
|
||||
RCC->CIR = 0x00000000;
|
||||
|
||||
/* Configure the System clock source, PLL Multiplier and Divider factors,
|
||||
AHB/APBx prescalers and Flash settings */
|
||||
SetSysClock();
|
||||
|
||||
/* Configure the Vector Table location add offset address ------------------*/
|
||||
#ifdef VECT_TAB_SRAM
|
||||
SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
|
||||
|
|
|
@ -65,6 +65,7 @@ extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Cloc
|
|||
|
||||
extern void SystemInit(void);
|
||||
extern void SystemCoreClockUpdate(void);
|
||||
extern void SetSysClock(void);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
|
|
@ -26,10 +26,10 @@
|
|||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include "analogin_api.h"
|
||||
#include "wait_api.h"
|
||||
|
||||
#if DEVICE_ANALOGIN
|
||||
|
||||
#include "wait_api.h"
|
||||
#include "cmsis.h"
|
||||
#include "pinmap.h"
|
||||
#include "error.h"
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
*/
|
||||
#include <stddef.h>
|
||||
#include "cmsis.h"
|
||||
|
||||
#include "gpio_irq_api.h"
|
||||
#include "pinmap.h"
|
||||
#include "error.h"
|
||||
|
|
|
@ -100,7 +100,7 @@ void i2c_init(i2c_t *obj, PinName sda, PinName scl) {
|
|||
void i2c_frequency(i2c_t *obj, int hz) {
|
||||
I2C_TypeDef *i2c = (I2C_TypeDef *)(obj->i2c);
|
||||
I2C_InitTypeDef I2C_InitStructure;
|
||||
uint32_t tim;
|
||||
uint32_t tim = 0;
|
||||
|
||||
// Disable the Fast Mode Plus capability
|
||||
RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE); // Enable SYSCFG clock
|
||||
|
|
|
@ -25,11 +25,14 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
extern void SystemCoreClockUpdate(void);
|
||||
#include "cmsis.h"
|
||||
|
||||
// This function is called after RAM initialization and before main.
|
||||
void mbed_sdk_init() {
|
||||
/* Configure the System clock source, PLL Multiplier and Divider factors,
|
||||
AHB/APBx prescalers and Flash settings */
|
||||
SetSysClock();
|
||||
|
||||
// Update the SystemCoreClock variable.
|
||||
SystemCoreClockUpdate();
|
||||
}
|
||||
|
|
|
@ -29,6 +29,8 @@
|
|||
*/
|
||||
#include "pwmout_api.h"
|
||||
|
||||
#if DEVICE_PWMOUT
|
||||
|
||||
#include "cmsis.h"
|
||||
#include "pinmap.h"
|
||||
#include "error.h"
|
||||
|
@ -275,3 +277,5 @@ void pwmout_pulsewidth_us(pwmout_t* obj, int us) {
|
|||
float value = (float)us / (float)obj->period;
|
||||
pwmout_write(obj, value);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -29,6 +29,8 @@
|
|||
*/
|
||||
#include "rtc_api.h"
|
||||
|
||||
#if DEVICE_RTC
|
||||
|
||||
static int rtc_inited = 0;
|
||||
|
||||
void rtc_init(void) {
|
||||
|
@ -136,3 +138,5 @@ void rtc_write(time_t t) {
|
|||
RTC_SetTime(RTC_Format_BIN, &timeStruct);
|
||||
PWR_BackupAccessCmd(DISABLE); // Disable access to RTC
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -28,6 +28,9 @@
|
|||
*******************************************************************************
|
||||
*/
|
||||
#include "serial_api.h"
|
||||
|
||||
#if DEVICE_SERIAL
|
||||
|
||||
#include "cmsis.h"
|
||||
#include "pinmap.h"
|
||||
#include "error.h"
|
||||
|
@ -309,3 +312,5 @@ void serial_break_clear(serial_t *obj) {
|
|||
USART_RequestCmd(usart, USART_Request_SBKRQ, DISABLE);
|
||||
USART_ClearFlag(usart, USART_FLAG_SBK);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -28,10 +28,10 @@
|
|||
*******************************************************************************
|
||||
*/
|
||||
#include "sleep_api.h"
|
||||
#include "cmsis.h"
|
||||
|
||||
// This function is in the system_stm32f30x.c file
|
||||
extern void SetSysClock(void);
|
||||
#if DEVICE_SLEEP
|
||||
|
||||
#include "cmsis.h"
|
||||
|
||||
// MCU SLEEP mode
|
||||
void sleep(void) {
|
||||
|
@ -53,3 +53,5 @@ void deepsleep(void) {
|
|||
// After wake-up from STOP reconfigure the PLL
|
||||
SetSysClock();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue