1 /*******************************************************************************
\r
2 // Copyright (c) 2003-2015 Cadence Design Systems, Inc.
\r
4 // Permission is hereby granted, free of charge, to any person obtaining
\r
5 // a copy of this software and associated documentation files (the
\r
6 // "Software"), to deal in the Software without restriction, including
\r
7 // without limitation the rights to use, copy, modify, merge, publish,
\r
8 // distribute, sublicense, and/or sell copies of the Software, and to
\r
9 // permit persons to whom the Software is furnished to do so, subject to
\r
10 // the following conditions:
\r
12 // The above copyright notice and this permission notice shall be included
\r
13 // in all copies or substantial portions of the Software.
\r
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
\r
16 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
\r
17 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
\r
18 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
\r
19 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
\r
20 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
\r
21 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\r
22 --------------------------------------------------------------------------------
\r
24 XTENSA INITIALIZATION ROUTINES CODED IN C
\r
26 This file contains miscellaneous Xtensa RTOS-generic initialization functions
\r
27 that are implemented in C.
\r
29 *******************************************************************************/
\r
33 #include <xtensa/xtbsp.h>
\r
36 #include "xtensa_rtos.h"
\r
37 #include "esp_clk.h"
\r
39 #ifdef XT_RTOS_TIMER_INT
\r
41 unsigned _xt_tick_divisor = 0; /* cached number of cycles per tick */
\r
43 void _xt_tick_divisor_init(void)
\r
45 _xt_tick_divisor = esp_clk_cpu_freq() / XT_TICK_PER_SEC;
\r
48 /* Deprecated, to be removed */
\r
49 int xt_clock_freq(void)
\r
51 return esp_clk_cpu_freq();
\r
54 #endif /* XT_RTOS_TIMER_INT */
\r