/****************************************************************************** * * Copyright (c) 2017-2019 by Löwenware Ltd * Please, refer LICENSE file for legal information * ******************************************************************************/ /** * @file timer.c * @author Ilja Kartašov * @brief * * @see https://lowenware.com/ */ #include #include #include #include "timer.h" const unsigned int m_interval = 200000; unsigned int m_current = 0; #ifndef CONFIG_ARM_TIMER #define CONFIG_ARM_TIMER 1 #endif void Timer_init(void) { #if CONFIG_ARM_TIMER == 1 #else m_current = aarch64_get32r(TIMER_CLO); m_current += m_interval; aarch64_set32r(TIMER_C1, m_current); #endif } void Timer_incFromISR(void) { #if CONFIG_ARM_TIMER == 1 #else m_current += m_interval; aarch64_set32r(TIMER_C1, m_current); aarch64_set32r(TIMER_CS, TIMER_CS_M1); #endif Log_putS("Timer: "); Log_putI(m_current, 10); Log_putS("\r\n"); }