1 /* -------------------------------- Arctic Core ------------------------------
2 * Arctic Core - the open source AUTOSAR platform http://arccore.com
4 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
6 * This source code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published by the
8 * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * -------------------------------- Arctic Core ------------------------------*/
26 * Created on: 2009-jan-17
\r
33 #include "internal.h"
\r
34 #include "stm32f10x.h"
\r
35 #include "core_cm3.h"
\r
38 * Init of free running timer.
\r
40 void Frt_Init( void ) {
\r
42 tid = Os_CreateIsr(OsTick,6/*prio*/,"OsTick");
\r
43 IntCtrl_AttachIsr2(tid,NULL,7);
\r
48 * @param period_ticks How long the period in timer ticks should be. The timer
\r
49 * on PowerPC often driver by the CPU clock or some platform clock.
\r
53 void Frt_Start(uint32_t period_ticks) {
55 SysTick_Config(period_ticks);
58 // SysTick interrupt each 250ms with counter clock equal to 9MHz
59 if (SysTick_Config((SystemFrequency / 8) / 4)) {
65 // Select HCLK/8 as SysTick clock source
66 SysTick_CLKSourceConfig(SysTick_CLKSource_HCLK_Div8);
75 uint32_t Frt_GetTimeElapsed( void )
\r
77 return (SysTick->VAL);
\r