From c86fba7919fed086ae3dfd07911d589391cf7e89 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 Date: Fri, 18 Feb 2022 15:37:07 +0100 Subject: [PATCH] Fix compiling when included from C++ --- components/hal/esp32/include/hal/i2s_ll.h | 2 +- components/hal/include/hal/adc_hal.h | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/components/hal/esp32/include/hal/i2s_ll.h b/components/hal/esp32/include/hal/i2s_ll.h index fd20c406cb..674dfe2b88 100644 --- a/components/hal/esp32/include/hal/i2s_ll.h +++ b/components/hal/esp32/include/hal/i2s_ll.h @@ -754,7 +754,7 @@ static inline void i2s_ll_rx_set_pdm_dsr(i2s_dev_t *hw, i2s_pdm_dsr_t dsr) */ static inline void i2s_ll_rx_get_pdm_dsr(i2s_dev_t *hw, i2s_pdm_dsr_t *dsr) { - *dsr = hw->pdm_conf.rx_sinc_dsr_16_en; + *dsr = (i2s_pdm_dsr_t)hw->pdm_conf.rx_sinc_dsr_16_en; } /** diff --git a/components/hal/include/hal/adc_hal.h b/components/hal/include/hal/adc_hal.h index b8455e27ec..003a0bcf65 100644 --- a/components/hal/include/hal/adc_hal.h +++ b/components/hal/include/hal/adc_hal.h @@ -6,6 +6,10 @@ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + #include "esp_err.h" #include "soc/soc_caps.h" #include "hal/dma_types.h" @@ -382,3 +386,7 @@ uint32_t adc_hal_self_calibration(adc_ll_num_t adc_n, adc_channel_t channel, adc * @prarm adc_n ADC unit. */ #define adc_hal_rtc_output_invert(adc_n, inv_en) adc_ll_rtc_output_invert(adc_n, inv_en) + +#ifdef __cplusplus +} +#endif