board_common_esp32.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 Gunar Schorcht
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
9 #pragma once
10 
36 #ifndef ESP32_XTAL_FREQ
37 #define ESP32_XTAL_FREQ (40)
38 #endif
39 
40 #if !DOXYGEN
41 
46 #if CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ <= 80
47 # define CONFIG_ZTIMER_USEC_ADJUST_SET (880/CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ)
48 # define CONFIG_ZTIMER_USEC_ADJUST_SLEEP ((CONFIG_ZTIMER_USEC_ADJUST_SET >> 2) * 5)
49 #else
50 # define CONFIG_ZTIMER_USEC_ADJUST_SET (960/CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ)
51 # define CONFIG_ZTIMER_USEC_ADJUST_SLEEP (CONFIG_ZTIMER_USEC_ADJUST_SET + 1)
52 #endif
55 #endif /* !DOXYGEN */
56 
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60 
61 #ifdef __cplusplus
62 } /* end extern "C" */
63 #endif
64