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.
Fork of mbed-dev by
targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KL43Z/TARGET_FRDM/mbed_overrides.c@188:60408c49b6d4, 2018-09-20 (annotated)
- Committer:
- WaleedElmughrabi
- Date:
- Thu Sep 20 16:11:23 2018 +0000
- Revision:
- 188:60408c49b6d4
- Parent:
- 186:707f6e361f3e
Fork modified for BG96 error
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
<> | 154:37f96f9d4de2 | 1 | /* mbed Microcontroller Library |
<> | 154:37f96f9d4de2 | 2 | * Copyright (c) 2006-2013 ARM Limited |
<> | 154:37f96f9d4de2 | 3 | * |
<> | 154:37f96f9d4de2 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
<> | 154:37f96f9d4de2 | 5 | * you may not use this file except in compliance with the License. |
<> | 154:37f96f9d4de2 | 6 | * You may obtain a copy of the License at |
<> | 154:37f96f9d4de2 | 7 | * |
<> | 154:37f96f9d4de2 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
<> | 154:37f96f9d4de2 | 9 | * |
<> | 154:37f96f9d4de2 | 10 | * Unless required by applicable law or agreed to in writing, software |
<> | 154:37f96f9d4de2 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
<> | 154:37f96f9d4de2 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
<> | 154:37f96f9d4de2 | 13 | * See the License for the specific language governing permissions and |
<> | 154:37f96f9d4de2 | 14 | * limitations under the License. |
<> | 154:37f96f9d4de2 | 15 | */ |
<> | 154:37f96f9d4de2 | 16 | #include "gpio_api.h" |
<> | 154:37f96f9d4de2 | 17 | #include "pinmap.h" |
<> | 154:37f96f9d4de2 | 18 | #include "fsl_clock_config.h" |
<> | 154:37f96f9d4de2 | 19 | |
<> | 154:37f96f9d4de2 | 20 | // called before main - implement here if board needs it otherwise, let |
<> | 154:37f96f9d4de2 | 21 | // the application override this if necessary |
<> | 154:37f96f9d4de2 | 22 | void mbed_sdk_init() |
<> | 154:37f96f9d4de2 | 23 | { |
<> | 154:37f96f9d4de2 | 24 | BOARD_BootClockRUN(); |
Anna Bridge |
186:707f6e361f3e | 25 | /* Set the TPM clock source to be IRC48M, do not change as TPM2 is used for the usticker */ |
Anna Bridge |
186:707f6e361f3e | 26 | CLOCK_SetTpmClock(1U); |
<> | 154:37f96f9d4de2 | 27 | } |
<> | 154:37f96f9d4de2 | 28 | |
<> | 154:37f96f9d4de2 | 29 | // Enable the RTC oscillator if available on the board |
<> | 154:37f96f9d4de2 | 30 | void rtc_setup_oscillator(RTC_Type *base) |
<> | 154:37f96f9d4de2 | 31 | { |
<> | 154:37f96f9d4de2 | 32 | /* Enable the RTC oscillator */ |
<> | 154:37f96f9d4de2 | 33 | RTC->CR |= RTC_CR_OSCE_MASK; |
<> | 154:37f96f9d4de2 | 34 | } |
<> | 154:37f96f9d4de2 | 35 | |
<> | 154:37f96f9d4de2 | 36 | // Change the NMI pin to an input. This allows NMI pin to |
<> | 154:37f96f9d4de2 | 37 | // be used as a low power mode wakeup. The application will |
<> | 154:37f96f9d4de2 | 38 | // need to change the pin back to NMI_b or wakeup only occurs once! |
<> | 154:37f96f9d4de2 | 39 | void NMI_Handler(void) |
<> | 154:37f96f9d4de2 | 40 | { |
<> | 154:37f96f9d4de2 | 41 | gpio_t gpio; |
<> | 154:37f96f9d4de2 | 42 | gpio_init_in(&gpio, PTA4); |
<> | 154:37f96f9d4de2 | 43 | } |