mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #4312 from c1728p9/remove_systick
BEETLE: Remove unused and conflicting systickpull/4322/head
commit
cd84f17ac4
|
@ -30,8 +30,6 @@
|
||||||
#include "apb_dualtimer.h"
|
#include "apb_dualtimer.h"
|
||||||
/* APB Timer */
|
/* APB Timer */
|
||||||
#include "apb_timer.h"
|
#include "apb_timer.h"
|
||||||
/* Cortex M3 SysTick Driver */
|
|
||||||
#include "systick_timer.h"
|
|
||||||
/* Flash Cache Driver */
|
/* Flash Cache Driver */
|
||||||
#include "fcache_api.h"
|
#include "fcache_api.h"
|
||||||
/* Embedded Flash Driver */
|
/* Embedded Flash Driver */
|
||||||
|
|
|
@ -1,94 +0,0 @@
|
||||||
/*
|
|
||||||
* PackageLicenseDeclared: Apache-2.0
|
|
||||||
* Copyright (c) 2015 ARM Limited
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "cmsis.h"
|
|
||||||
#include "systick_timer.h"
|
|
||||||
|
|
||||||
volatile uint32_t MyTicks;
|
|
||||||
|
|
||||||
/* Private Data SysTick */
|
|
||||||
static uint32_t clock;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This Timer is written for MBED OS so the interrupt
|
|
||||||
* is used to keep track of the overflow.
|
|
||||||
*/
|
|
||||||
#define SYSTICK_MAX_RELOAD 0xFFFFFFFF
|
|
||||||
#define SYSTICK_DIVIDER_US (SystemCoreClock/1000000)
|
|
||||||
|
|
||||||
void SysTick_IRQ_Handler(void)
|
|
||||||
{
|
|
||||||
MyTicks++;
|
|
||||||
#if 0
|
|
||||||
printf("System Tick Interrupt: %u\n\r", MyTicks);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* SysTick_Initialize(): Initializes the SysTick timer
|
|
||||||
*/
|
|
||||||
void SysTick_Initialize(void)
|
|
||||||
{
|
|
||||||
clock = SYSTICK_MAX_RELOAD;
|
|
||||||
#if 0
|
|
||||||
printf("\n\rEnable System Tick Interrupt...\n\r");
|
|
||||||
#endif
|
|
||||||
MyTicks=0;
|
|
||||||
|
|
||||||
/* SysTick Reload Value Register */
|
|
||||||
SysTick->LOAD = clock;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* SysTick_CTRL_CLKSOURCE_Msk : Use core's clock
|
|
||||||
* SysTick_CTRL_ENABLE_Msk : Enable SysTick
|
|
||||||
* SysTick_CTRL_TICKINT_Msk : Active the SysTick interrupt on the NVIC
|
|
||||||
*/
|
|
||||||
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk
|
|
||||||
| SysTick_CTRL_ENABLE_Msk
|
|
||||||
| SysTick_CTRL_TICKINT_Msk;
|
|
||||||
|
|
||||||
/* Register the Interrupt */
|
|
||||||
NVIC_SetVector(SysTick_IRQn, (uint32_t)SysTick_IRQ_Handler);
|
|
||||||
NVIC_EnableIRQ(SysTick_IRQn);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* SysTick_Disable(): Disables the SysTick timer
|
|
||||||
*/
|
|
||||||
void SysTick_Disable(void)
|
|
||||||
{
|
|
||||||
/* Disable SysTick */
|
|
||||||
SysTick->CTRL = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* SysTick_Read(): Read SysTick Value
|
|
||||||
* @return: the SysTick VALUE
|
|
||||||
*/
|
|
||||||
uint32_t SysTick_Read(void)
|
|
||||||
{
|
|
||||||
return ((clock - (SysTick->VAL)) / SYSTICK_DIVIDER_US);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* SysTick_Overflow(): Read SysTick Overflow Value
|
|
||||||
* @return: the SysTick Overflow VALUE
|
|
||||||
*/
|
|
||||||
uint32_t SysTick_Overflow(void)
|
|
||||||
{
|
|
||||||
return MyTicks;
|
|
||||||
}
|
|
|
@ -1,51 +0,0 @@
|
||||||
/*
|
|
||||||
* PackageLicenseDeclared: Apache-2.0
|
|
||||||
* Copyright (c) 2015 ARM Limited
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _SYSTICK_TIMER_H
|
|
||||||
#define _SYSTICK_TIMER_H
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* SysTick_Initialize(): Initializes the SysTick timer
|
|
||||||
*/
|
|
||||||
void SysTick_Initialize(void);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* SysTick_Disable(): Disables the SysTick timer
|
|
||||||
*/
|
|
||||||
void SysTick_Disable(void);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* SysTick_Read(): Read SysTick Value
|
|
||||||
* @return: the SysTick VALUE
|
|
||||||
*/
|
|
||||||
uint32_t SysTick_Read(void);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* SysTick_Overflow(): Read SysTick Overflow Value
|
|
||||||
* @return: the SysTick Overflow VALUE
|
|
||||||
*/
|
|
||||||
uint32_t SysTick_Overflow(void);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* _SYSTICK_TIMER_H */
|
|
Loading…
Reference in New Issue