5
Line | |
---|
1 | /* |
---|
2 | * Copyright (c) 2016 embedded brains GmbH. All rights reserved. |
---|
3 | * |
---|
4 | * embedded brains GmbH |
---|
5 | * Dornierstr. 4 |
---|
6 | * 82178 Puchheim |
---|
7 | * Germany |
---|
8 | * <rtems@embedded-brains.de> |
---|
9 | * |
---|
10 | * The license and distribution terms for this file may be |
---|
11 | * found in the file LICENSE in this distribution or at |
---|
12 | * http://www.rtems.org/license/LICENSE. |
---|
13 | */ |
---|
14 | |
---|
15 | #include <bsp.h> |
---|
16 | |
---|
17 | #include <chip.h> |
---|
18 | |
---|
19 | uint32_t atsam_systick_frequency(void) |
---|
20 | { |
---|
21 | uint32_t mdiv = (PMC->PMC_MCKR & PMC_MCKR_MDIV_Msk) >> PMC_MCKR_MDIV_Pos; |
---|
22 | uint32_t fclk; |
---|
23 | |
---|
24 | if (mdiv == 3) { |
---|
25 | fclk = BOARD_MCK * mdiv; |
---|
26 | } else { |
---|
27 | fclk = BOARD_MCK * (1 << mdiv); |
---|
28 | } |
---|
29 | |
---|
30 | return fclk; |
---|
31 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.