记录编译报错及解决方法
1,编译串口打印的报错信息见第2项。
主要是: ‘I2S_TIMING_REG’ was not declared in this scope; did you mean ‘I2S_TX_TIMING_REG’?
中文意思:“I2S_TIMING_REG”未在此范围内声明;你是说“I2S_TX_TIMING_REG”吗?
按提示修改为:
#define I2S_TIMING_REG I2S_TX_TIMING_REG //该行和下一行为新增
#define I2S_CONF_REG I2S_TX_CONF_REG
void I2SMEMSSampler::configureI2S()
{
if (m_fixSPH0645)
{
// FIXES for SPH0645
REG_SET_BIT(I2S_TIMING_REG(m_i2sPort), BIT(9));
REG_SET_BIT(I2S_CONF_REG(m_i2sPort), I2S_RX_MSB_SHIFT);
}
i2s_set_pin(m_i2sPort, &m_i2sPins);
}
2,串口打印信息
In file included from C:\Users\Administrator\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-bd2b9390ef\esp32s3/include/esp_hw_support/include/esp_memory_utils.h:12,
from C:\Users\Administrator\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-bd2b9390ef\esp32s3/include/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h:79,
from C:\Users\Administrator\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-bd2b9390ef\esp32s3/include/freertos/FreeRTOS-Kernel/include/freertos/portable.h:59,
from C:\Users\Administrator\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-bd2b9390ef\esp32s3/include/freertos/FreeRTOS-Kernel/include/freertos/FreeRTOS.h:71,
from C:\Users\Administrator\Documents\Arduino\UDP\esp32_sph0645_udp\src\main\I2SSampler.h:3,
from C:\Users\Administrator\Documents\Arduino\UDP\esp32_sph0645_udp\src\main\I2SMEMSSampler.h:3,
from C:\Users\Administrator\Documents\Arduino\UDP\esp32_sph0645_udp\src\main\I2SMEMSSampler.cpp:1:
C:\Users\Administrator\Documents\Arduino\UDP\esp32_sph0645_udp\src\main\I2SMEMSSampler.cpp: In member function ‘virtual void I2SMEMSSampler::configureI2S()’:
C:\Users\Administrator\Documents\Arduino\UDP\esp32_sph0645_udp\src\main\I2SMEMSSampler.cpp:25:21: error: ‘I2S_TIMING_REG’ was not declared in this scope; did you mean ‘I2S_TX_TIMING_REG’?
25 | REG_SET_BIT(I2S_TIMING_REG(m_i2sPort), BIT(9));
| ^~~~~~~~~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-bd2b9390ef\esp32s3/include/soc/esp32s3/include/soc/soc.h:67:35: note: in definition of macro ‘REG_SET_BIT’
67 | (volatile uint32_t)(_r) = ((volatile uint32_t)(_r)) | (_b);
| ^~
C:\Users\Administrator\Documents\Arduino\UDP\esp32_sph0645_udp\src\main\I2SMEMSSampler.cpp:26:21: error: ‘I2S_CONF_REG’ was not declared in this scope; did you mean ‘I2S_TX_CONF_REG’?
26 | REG_SET_BIT(I2S_CONF_REG(m_i2sPort), I2S_RX_MSB_SHIFT);
| ^~~~~~~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-bd2b9390ef\esp32s3/include/soc/esp32s3/include/soc/soc.h:67:35: note: in definition of macro ‘REG_SET_BIT’
67 | (volatile uint32_t)(_r) = ((volatile uint32_t)(_r)) | (_b);
| ^~
exit status 1
Compilation error: ‘I2S_TIMING_REG’ was not declared in this scope; did you mean ‘I2S_TX_TIMING_REG’?
标签:Administrator,esp32,I2S,TIMING,include,REG From: https://blog.csdn.net/USALCD/article/details/140641888