/*
 * clock-arch.c
 *
 *  Created on: Jan 29, 2012
 *      Author: RomanM
 */

#include "stm32f10x.h"
#include "clock-arch.h"

clock_time_t clock_datetime = 0;			// uIP clock counter

/*
 * Clock initialization
 */
void clock_init(void) {
	SysTick_Config(SystemCoreClock / 100); // SysTick every 10 ms
}

/*
 * Get clock value
 */
clock_time_t clock_time(void) {
	return clock_datetime;
}

/*
 * Clock interrupt handler
 */
void clock_handler(void) {
	clock_datetime ++;
}
