Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
mbed-os/targets/TARGET_STM/mbed_overrides.c@0:6bf0743ece18, 2020-03-28 (annotated)
- Committer:
- demayer
- Date:
- Sat Mar 28 15:28:19 2020 +0000
- Revision:
- 0:6bf0743ece18
IMU Thread with an event-queue running parallel to handle tasks like a 5 times blinking LED. Button with interrupt detected.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| demayer | 0:6bf0743ece18 | 1 | /* mbed Microcontroller Library |
| demayer | 0:6bf0743ece18 | 2 | * Copyright (c) 2017, STMicroelectronics |
| demayer | 0:6bf0743ece18 | 3 | * All rights reserved. |
| demayer | 0:6bf0743ece18 | 4 | * |
| demayer | 0:6bf0743ece18 | 5 | * Redistribution and use in source and binary forms, with or without |
| demayer | 0:6bf0743ece18 | 6 | * modification, are permitted provided that the following conditions are met: |
| demayer | 0:6bf0743ece18 | 7 | * |
| demayer | 0:6bf0743ece18 | 8 | * 1. Redistributions of source code must retain the above copyright notice, |
| demayer | 0:6bf0743ece18 | 9 | * this list of conditions and the following disclaimer. |
| demayer | 0:6bf0743ece18 | 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
| demayer | 0:6bf0743ece18 | 11 | * this list of conditions and the following disclaimer in the documentation |
| demayer | 0:6bf0743ece18 | 12 | * and/or other materials provided with the distribution. |
| demayer | 0:6bf0743ece18 | 13 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
| demayer | 0:6bf0743ece18 | 14 | * may be used to endorse or promote products derived from this software |
| demayer | 0:6bf0743ece18 | 15 | * without specific prior written permission. |
| demayer | 0:6bf0743ece18 | 16 | * |
| demayer | 0:6bf0743ece18 | 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| demayer | 0:6bf0743ece18 | 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| demayer | 0:6bf0743ece18 | 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| demayer | 0:6bf0743ece18 | 20 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
| demayer | 0:6bf0743ece18 | 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| demayer | 0:6bf0743ece18 | 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| demayer | 0:6bf0743ece18 | 23 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| demayer | 0:6bf0743ece18 | 24 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| demayer | 0:6bf0743ece18 | 25 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| demayer | 0:6bf0743ece18 | 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| demayer | 0:6bf0743ece18 | 27 | */ |
| demayer | 0:6bf0743ece18 | 28 | #include "cmsis.h" |
| demayer | 0:6bf0743ece18 | 29 | |
| demayer | 0:6bf0743ece18 | 30 | // This function is called after RAM initialization and before main. |
| demayer | 0:6bf0743ece18 | 31 | void mbed_sdk_init() |
| demayer | 0:6bf0743ece18 | 32 | { |
| demayer | 0:6bf0743ece18 | 33 | // Update the SystemCoreClock variable. |
| demayer | 0:6bf0743ece18 | 34 | SystemCoreClockUpdate(); |
| demayer | 0:6bf0743ece18 | 35 | HAL_Init(); |
| demayer | 0:6bf0743ece18 | 36 | |
| demayer | 0:6bf0743ece18 | 37 | #if TARGET_STM32F7 |
| demayer | 0:6bf0743ece18 | 38 | // Enable CPU L1-Cache |
| demayer | 0:6bf0743ece18 | 39 | SCB_EnableICache(); |
| demayer | 0:6bf0743ece18 | 40 | SCB_EnableDCache(); |
| demayer | 0:6bf0743ece18 | 41 | #endif /* TARGET_STM32F7 */ |
| demayer | 0:6bf0743ece18 | 42 | |
| demayer | 0:6bf0743ece18 | 43 | /* Configure the System clock source, PLL Multiplier and Divider factors, |
| demayer | 0:6bf0743ece18 | 44 | AHB/APBx prescalers and Flash settings */ |
| demayer | 0:6bf0743ece18 | 45 | SetSysClock(); |
| demayer | 0:6bf0743ece18 | 46 | SystemCoreClockUpdate(); |
| demayer | 0:6bf0743ece18 | 47 | } |