esp_rom: Fail immediately if the wrong SoC's header file is included
This commit is contained in:
parent
2f56116db2
commit
8f74271d5d
|
@ -11,13 +11,20 @@
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
#include "esp32/rom/uart.h"
|
#include "sdkconfig.h"
|
||||||
#include "esp32/rom/rtc.h"
|
|
||||||
#include "soc/soc.h"
|
#include "soc/soc.h"
|
||||||
#include "soc/rtc.h"
|
#include "soc/rtc.h"
|
||||||
#include "soc/dport_reg.h"
|
#include "soc/dport_reg.h"
|
||||||
#include "soc/efuse_periph.h"
|
#include "soc/efuse_periph.h"
|
||||||
|
|
||||||
|
#ifdef CONFIG_IDF_TARGET_ESP32
|
||||||
|
#include "esp32/rom/uart.h"
|
||||||
|
#include "esp32/rom/rtc.h"
|
||||||
|
#else
|
||||||
|
#include "esp32s2beta/rom/uart.h"
|
||||||
|
#include "esp32s2beta/rom/rtc.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
void bootloader_clock_configure(void)
|
void bootloader_clock_configure(void)
|
||||||
{
|
{
|
||||||
// ROM bootloader may have put a lot of text into UART0 FIFO.
|
// ROM bootloader may have put a lot of text into UART0 FIFO.
|
||||||
|
|
|
@ -25,6 +25,10 @@
|
||||||
#include "soc/soc.h"
|
#include "soc/soc.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef CONFIG_IDF_TARGET_ESP32
|
||||||
|
#error "This header should only be included when building for ESP32"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -19,6 +19,12 @@
|
||||||
|
|
||||||
#include "soc/soc.h"
|
#include "soc/soc.h"
|
||||||
|
|
||||||
|
#include "sdkconfig.h"
|
||||||
|
|
||||||
|
#ifndef CONFIG_IDF_TARGET_ESP32S2BETA
|
||||||
|
#error "This header should only be included when building for esp32s2beta"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include "esp32/rom/ets_sys.h"
|
|
||||||
#include "esp_attr.h"
|
#include "esp_attr.h"
|
||||||
#include "esp_spi_flash.h" //for ``g_flash_guard_default_ops``
|
#include "esp_spi_flash.h" //for ``g_flash_guard_default_ops``
|
||||||
#include "esp_flash.h"
|
#include "esp_flash.h"
|
||||||
|
|
|
@ -13,12 +13,17 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include "sdkconfig.h"
|
||||||
#include "esp_flash.h"
|
#include "esp_flash.h"
|
||||||
|
|
||||||
#include "esp32/rom/ets_sys.h"
|
|
||||||
#include "esp32/rom/cache.h"
|
|
||||||
#include "esp_attr.h"
|
#include "esp_attr.h"
|
||||||
|
|
||||||
|
#ifdef CONFIG_IDF_TARGET_ESP32
|
||||||
|
#include "esp32/rom/ets_sys.h"
|
||||||
|
#include "esp32/rom/cache.h"
|
||||||
|
#else
|
||||||
|
#include "esp32s2beta/rom/ets_sys.h"
|
||||||
|
#include "esp32s2beta/rom/cache.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
static esp_err_t start(void *arg)
|
static esp_err_t start(void *arg)
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,7 +15,13 @@
|
||||||
#ifndef WPA_H
|
#ifndef WPA_H
|
||||||
#define WPA_H
|
#define WPA_H
|
||||||
|
|
||||||
|
#include "sdkconfig.h"
|
||||||
|
|
||||||
|
#ifdef CONFIG_IDF_TARGET_ESP32
|
||||||
#include "esp32/rom/ets_sys.h"
|
#include "esp32/rom/ets_sys.h"
|
||||||
|
#else
|
||||||
|
#include "esp32s2beta/rom/ets_sys.h"
|
||||||
|
#endif
|
||||||
#include "utils/common.h"
|
#include "utils/common.h"
|
||||||
#include "common/defs.h"
|
#include "common/defs.h"
|
||||||
#include "common/wpa_common.h"
|
#include "common/wpa_common.h"
|
||||||
|
|
|
@ -12,14 +12,20 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
|
#include "sdkconfig.h"
|
||||||
#include "esp_types.h"
|
#include "esp_types.h"
|
||||||
#include "esp_attr.h"
|
#include "esp_attr.h"
|
||||||
#include "esp_err.h"
|
#include "esp_err.h"
|
||||||
#include "esp_debug_helpers.h"
|
#include "esp_debug_helpers.h"
|
||||||
#include "esp32/rom/ets_sys.h"
|
|
||||||
#include "soc/soc_memory_layout.h"
|
#include "soc/soc_memory_layout.h"
|
||||||
#include "soc/cpu.h"
|
#include "soc/cpu.h"
|
||||||
|
|
||||||
|
#ifdef CONFIG_IDF_TARGET_ESP32
|
||||||
|
#include "esp32/rom/ets_sys.h"
|
||||||
|
#else
|
||||||
|
#include "esp32s2beta/rom/ets_sys.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
bool IRAM_ATTR esp_backtrace_get_next_frame(esp_backtrace_frame_t *frame)
|
bool IRAM_ATTR esp_backtrace_get_next_frame(esp_backtrace_frame_t *frame)
|
||||||
{
|
{
|
||||||
//Use frame(i-1)'s BS area located below frame(i)'s sp to get frame(i-1)'s sp and frame(i-2)'s pc
|
//Use frame(i-1)'s BS area located below frame(i)'s sp to get frame(i-1)'s sp and frame(i-2)'s pc
|
||||||
|
|
Loading…
Reference in a new issue