/****************************************************************************
[ systick.c ] - SysTick timer setting
****************************************************************************/

/*
 *  for MB9BF618T on FRK-FM3
 * 
 *   Copyright (C) by Y.Ishioka.
 */

#include <systick.h>
#if 0 /* Y.Ishioka */
#include "MK60N512MD100.h"
#include "core_cm4.h"
#else
#include "mb9bf618t.h"
#include "core_cm3.h"
#endif

EXPORT void InitSysTickTimer(void)
	{
	volatile SysTickRegister_t* sysTickReg = (SysTickRegister_t*)SYSTICK_REG_BASE;

	sysTickReg->STRVR = SYSTICK_RELOAD_VALUE;
	sysTickReg->STCVR = 0;				 	
	sysTickReg->STCSR = (1 << SYSTICK_CLKSOURCE) | (1 << SYSTICK_ENABLE) | (1 << SYSTICK_TICKINT);
	return;
	}

