esp_rom: Fail immediately if the wrong SoC's header file is included

This commit is contained in:
Angus Gratton 2019-08-08 15:27:22 +10:00 committed by Angus Gratton
parent 2f56116db2
commit 8f74271d5d
7 changed files with 40 additions and 7 deletions

View file

@ -11,13 +11,20 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "esp32/rom/uart.h"
#include "esp32/rom/rtc.h"
#include "sdkconfig.h"
#include "soc/soc.h"
#include "soc/rtc.h"
#include "soc/dport_reg.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)
{
// ROM bootloader may have put a lot of text into UART0 FIFO.

View file

@ -25,6 +25,10 @@
#include "soc/soc.h"
#endif
#ifndef CONFIG_IDF_TARGET_ESP32
#error "This header should only be included when building for ESP32"
#endif
#ifdef __cplusplus
extern "C" {
#endif

View file

@ -19,6 +19,12 @@
#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
extern "C" {
#endif

View file

@ -13,7 +13,6 @@
// limitations under the License.
#include <stdarg.h>
#include "esp32/rom/ets_sys.h"
#include "esp_attr.h"
#include "esp_spi_flash.h" //for ``g_flash_guard_default_ops``
#include "esp_flash.h"

View file

@ -13,12 +13,17 @@
// limitations under the License.
#include <stdarg.h>
#include "sdkconfig.h"
#include "esp_flash.h"
#include "esp32/rom/ets_sys.h"
#include "esp32/rom/cache.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)
{

View file

@ -15,7 +15,13 @@
#ifndef WPA_H
#define WPA_H
#include "sdkconfig.h"
#ifdef CONFIG_IDF_TARGET_ESP32
#include "esp32/rom/ets_sys.h"
#else
#include "esp32s2beta/rom/ets_sys.h"
#endif
#include "utils/common.h"
#include "common/defs.h"
#include "common/wpa_common.h"

View file

@ -12,14 +12,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "sdkconfig.h"
#include "esp_types.h"
#include "esp_attr.h"
#include "esp_err.h"
#include "esp_debug_helpers.h"
#include "esp32/rom/ets_sys.h"
#include "soc/soc_memory_layout.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)
{
//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