mirror of
https://github.com/esphome/esphome.git
synced 2026-10-07 11:26:39 +00:00
[rp2040] Fix compiler warnings in crash_handler and mdns (#14739)
This commit is contained in:
@@ -7,7 +7,12 @@
|
|||||||
#include "esphome/core/log.h"
|
#include "esphome/core/log.h"
|
||||||
#include "mdns_component.h"
|
#include "mdns_component.h"
|
||||||
|
|
||||||
|
// Arduino-Pico's PolledTimeout.h (pulled in by ESP8266mDNS.h) redefines IRAM_ATTR to empty.
|
||||||
|
// Save and restore our definition around the include to avoid a redefinition warning.
|
||||||
|
#pragma push_macro("IRAM_ATTR")
|
||||||
|
#undef IRAM_ATTR
|
||||||
#include <ESP8266mDNS.h>
|
#include <ESP8266mDNS.h>
|
||||||
|
#pragma pop_macro("IRAM_ATTR")
|
||||||
|
|
||||||
namespace esphome::mdns {
|
namespace esphome::mdns {
|
||||||
|
|
||||||
|
|||||||
@@ -57,14 +57,14 @@ static const char *const TAG = "rp2040.crash";
|
|||||||
|
|
||||||
// Placed in .noinit so BSS zero-init cannot race with crash_handler_read_and_clear().
|
// Placed in .noinit so BSS zero-init cannot race with crash_handler_read_and_clear().
|
||||||
// The valid field is explicitly cleared in crash_handler_read_and_clear() instead.
|
// The valid field is explicitly cleared in crash_handler_read_and_clear() instead.
|
||||||
static struct {
|
static struct CrashData {
|
||||||
bool valid;
|
bool valid;
|
||||||
uint32_t pc;
|
uint32_t pc;
|
||||||
uint32_t lr;
|
uint32_t lr;
|
||||||
uint32_t sp;
|
uint32_t sp;
|
||||||
uint32_t backtrace[MAX_BACKTRACE];
|
uint32_t backtrace[MAX_BACKTRACE];
|
||||||
uint8_t backtrace_count;
|
uint8_t backtrace_count;
|
||||||
} __attribute__((section(".noinit"))) s_crash_data;
|
} s_crash_data __attribute__((section(".noinit")));
|
||||||
|
|
||||||
bool crash_handler_has_data() { return s_crash_data.valid; }
|
bool crash_handler_has_data() { return s_crash_data.valid; }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user