8000 Resolve flash address issues with SDK v3.0.0 by mhightower83 · Pull Request #8755 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content

Resolve flash address issues with SDK v3.0.0 #8755

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Dec 19, 2022
Prev Previous commit
Next Next commit
Add more build issolation when including flash_hal.h
  • Loading branch information
mhightower83 committed Dec 15, 2022
commit d42bbdb25137a32a48309421f454e60a4bc9d37b
10 changes: 9 additions & 1 deletion cores/esp8266/core_esp8266_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ extern "C" {
#include <umm_malloc/umm_malloc.h>
#include <core_esp8266_non32xfer.h>
#include "core_esp8266_vm.h"
#include "flash_hal.h"

#define LOOP_TASK_PRIORITY 1
#define LOOP_QUEUE_SIZE 1
Expand Down Expand Up @@ -414,6 +413,10 @@ uint32_t __flashindex;
#define ETS_PRINTF(...) ets_uart_printf(__VA_ARGS__)
extern "C" uint8_t uart_rx_one_char_block();

#if ! FLASH_MAP_SUPPORT
#include "flash_hal.h"
#endif

extern "C" void ICACHE_FLASH_ATTR user_pre_init(void)
{
const char *flash_map_str = NULL;
Expand Down Expand Up @@ -487,6 +490,11 @@ extern "C" void ICACHE_FLASH_ATTR user_pre_init(void)
chip_sz_str = PSTR("Flash size mismatch, check that the build setting matches the device.\n");
continue;
}
#elif defined(ALLOW_SMALL_FLASH_SIZE) && !defined(FLASH_MAP_SUPPORT)
// Note, while EEPROM is confined to a smaller flash size, we are still
// placing RF_CAL and SYSTEM_PARAMETER at the end of flash. To prevent
// this, esptool or its equal needs to not update the flash size in the
// .bin image.
#endif

#if FLASH_MAP_SUPPORT & defined(DEBUG_ESP_PORT)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#if FLASH_MAP_SUPPORT & defined(DEBUG_ESP_PORT)
#if FLASH_MAP_SUPPORT && defined(DEBUG_ESP_PORT)

(would also suggest moving all #... to the beginning of line? things are pretty dense here)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have gone back and forth on this. I kept getting lost with all the #ifs in column one. The density of the #ifs is the reason I started indenting the innermost #ifs to reduce the visual disruption to a block of "C" code. When nested the outer #if are at the beginning of the line. I don't know if doing this is a style violation.

Expand Down
0