mbed-os

Dependents:   cobaLCDJoyMotor_Thread odometry_omni_3roda_v3 odometry_omni_3roda_v1 odometry_omni_3roda_v2 ... more

Committer:
be_bryan
Date:
Mon Dec 11 17:54:04 2017 +0000
Revision:
0:b74591d5ab33
motor ++

Who changed what in which revision?

UserRevisionLine numberNew contents of line
be_bryan 0:b74591d5ab33 1 /* mbed Microcontroller Library
be_bryan 0:b74591d5ab33 2 * Copyright (c) 2017, STMicroelectronics
be_bryan 0:b74591d5ab33 3 * All rights reserved.
be_bryan 0:b74591d5ab33 4 *
be_bryan 0:b74591d5ab33 5 * Redistribution and use in source and binary forms, with or without
be_bryan 0:b74591d5ab33 6 * modification, are permitted provided that the following conditions are met:
be_bryan 0:b74591d5ab33 7 *
be_bryan 0:b74591d5ab33 8 * 1. Redistributions of source code must retain the above copyright notice,
be_bryan 0:b74591d5ab33 9 * this list of conditions and the following disclaimer.
be_bryan 0:b74591d5ab33 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
be_bryan 0:b74591d5ab33 11 * this list of conditions and the following disclaimer in the documentation
be_bryan 0:b74591d5ab33 12 * and/or other materials provided with the distribution.
be_bryan 0:b74591d5ab33 13 * 3. Neither the name of STMicroelectronics nor the names of its contributors
be_bryan 0:b74591d5ab33 14 * may be used to endorse or promote products derived from this software
be_bryan 0:b74591d5ab33 15 * without specific prior written permission.
be_bryan 0:b74591d5ab33 16 *
be_bryan 0:b74591d5ab33 17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
be_bryan 0:b74591d5ab33 18 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
be_bryan 0:b74591d5ab33 19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
be_bryan 0:b74591d5ab33 20 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
be_bryan 0:b74591d5ab33 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
be_bryan 0:b74591d5ab33 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
be_bryan 0:b74591d5ab33 23 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
be_bryan 0:b74591d5ab33 24 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
be_bryan 0:b74591d5ab33 25 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
be_bryan 0:b74591d5ab33 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
be_bryan 0:b74591d5ab33 27 */
be_bryan 0:b74591d5ab33 28 #include "cmsis.h"
be_bryan 0:b74591d5ab33 29
be_bryan 0:b74591d5ab33 30 // This function is called after RAM initialization and before main.
be_bryan 0:b74591d5ab33 31 void mbed_sdk_init()
be_bryan 0:b74591d5ab33 32 {
be_bryan 0:b74591d5ab33 33 // Update the SystemCoreClock variable.
be_bryan 0:b74591d5ab33 34 SystemCoreClockUpdate();
be_bryan 0:b74591d5ab33 35 HAL_Init();
be_bryan 0:b74591d5ab33 36
be_bryan 0:b74591d5ab33 37 #if TARGET_STM32F7
be_bryan 0:b74591d5ab33 38 // Enable CPU L1-Cache
be_bryan 0:b74591d5ab33 39 SCB_EnableICache();
be_bryan 0:b74591d5ab33 40 SCB_EnableDCache();
be_bryan 0:b74591d5ab33 41 #endif /* TARGET_STM32F7 */
be_bryan 0:b74591d5ab33 42
be_bryan 0:b74591d5ab33 43 /* Configure the System clock source, PLL Multiplier and Divider factors,
be_bryan 0:b74591d5ab33 44 AHB/APBx prescalers and Flash settings */
be_bryan 0:b74591d5ab33 45 SetSysClock();
be_bryan 0:b74591d5ab33 46 SystemCoreClockUpdate();
be_bryan 0:b74591d5ab33 47 }