Skip to content

Commit

Permalink
Replaced the remaining CONFIG_IDF_TARGET with ESP_PLATFORM
Browse files Browse the repository at this point in the history
It's the preferred way to detect building inside esp-idf.
  • Loading branch information
ducalex committed Jan 24, 2024
1 parent b69dcd9 commit 370532e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion components/retro-go/rg_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <stdlib.h>
#include <unistd.h>

#if defined(RG_GPIO_I2C_SDA) && defined(RG_GPIO_I2C_SCL)
#if defined(ESP_PLATFORM) && (RG_GPIO_I2C_SDA) && defined(RG_GPIO_I2C_SCL)
#include <driver/i2c.h>
#include <esp_err.h>
#define USE_I2C_DRIVER 1
Expand Down
6 changes: 3 additions & 3 deletions components/retro-go/rg_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
#include <string.h>
#include <unistd.h>

#ifdef RG_TARGET_SDL2
#include <SDL2/SDL.h>
#else
#ifdef ESP_PLATFORM
#include <driver/gpio.h>
#else
#include <SDL2/SDL.h>
#endif

#if RG_GAMEPAD_DRIVER == 1 || defined(RG_BATTERY_ADC_CHANNEL)
Expand Down
2 changes: 1 addition & 1 deletion components/retro-go/rg_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const char *rg_relpath(const char *path)

uint32_t rg_crc32(uint32_t crc, const uint8_t *buf, uint32_t len)
{
#ifdef CONFIG_IDF_TARGET
#ifdef ESP_PLATFORM
// This is part of the ROM but finding the correct header is annoying as it differs per SOC...
extern uint32_t crc32_le(uint32_t crc, const uint8_t *buf, uint32_t len);
return crc32_le(crc, buf, len);
Expand Down
4 changes: 2 additions & 2 deletions launcher/main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <string.h>
#include <unistd.h>

#ifdef CONFIG_IDF_TARGET
#ifdef ESP_PLATFORM
#include <esp_heap_caps.h>
#endif

Expand Down Expand Up @@ -482,7 +482,7 @@ void app_main(void)
try_migrate();
}

#ifdef CONFIG_IDF_TARGET
#ifdef ESP_PLATFORM
// The launcher makes a lot of small allocations and it sometimes fills internal RAM, causing the SD Card driver to
// stop working. Lowering CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL and manually using rg_alloc to do internal allocs when
// needed is a better solution, but that would have to be done for every app. This is a good workaround for now.
Expand Down

0 comments on commit 370532e

Please sign in to comment.