Skip to content
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

arch/xtensa: fix definition for _int32_t and _uint32_t #16022

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions arch/xtensa/include/inttypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,89 +33,89 @@

#define PRId8 "d"
#define PRId16 "d"
#define PRId32 "d"
#define PRId32 "ld"
#define PRId64 "lld"

#define PRIdPTR "d"

#define PRIi8 "i"
#define PRIi16 "i"
#define PRIi32 "i"
#define PRIi32 "li"
#define PRIi64 "lli"

#define PRIiPTR "i"

#define PRIo8 "o"
#define PRIo16 "o"
#define PRIo32 "o"
#define PRIo32 "lo"
#define PRIo64 "llo"

#define PRIoPTR "o"

#define PRIu8 "u"
#define PRIu16 "u"
#define PRIu32 "u"
#define PRIu32 "lu"
#define PRIu64 "llu"

#define PRIuPTR "u"

#define PRIx8 "x"
#define PRIx16 "x"
#define PRIx32 "x"
#define PRIx32 "lx"
#define PRIx64 "llx"

#define PRIxPTR "x"

#define PRIX8 "X"
#define PRIX16 "X"
#define PRIX32 "X"
#define PRIX32 "lX"
#define PRIX64 "llX"

#define PRIXPTR "X"

#define SCNd8 "hhd"
#define SCNd16 "hd"
#define SCNd32 "d"
#define SCNd32 "ld"
#define SCNd64 "lld"

#define SCNdPTR "d"

#define SCNi8 "hhi"
#define SCNi16 "hi"
#define SCNi32 "i"
#define SCNi32 "li"
#define SCNi64 "lli"

#define SCNiPTR "i"

#define SCNo8 "hho"
#define SCNo16 "ho"
#define SCNo32 "o"
#define SCNo32 "lo"
#define SCNo64 "llo"

#define SCNoPTR "o"

#define SCNu8 "hhu"
#define SCNu16 "hu"
#define SCNu32 "u"
#define SCNu32 "lu"
#define SCNu64 "llu"

#define SCNuPTR "u"

#define SCNx8 "hhx"
#define SCNx16 "hx"
#define SCNx32 "x"
#define SCNx32 "lx"
#define SCNx64 "llx"

#define SCNxPTR "x"

#define INT8_C(x) x
#define INT16_C(x) x
#define INT32_C(x) x
#define INT32_C(x) x ## ll
#define INT64_C(x) x ## ll

#define UINT8_C(x) x
#define UINT16_C(x) x
#define UINT32_C(x) x ## u
#define UINT32_C(x) x ## ul
#define UINT64_C(x) x ## ull

#endif /* __ARCH_XTENSA_INCLUDE_INTTYPES_H */
4 changes: 2 additions & 2 deletions arch/xtensa/include/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ typedef unsigned char _uint8_t;
typedef signed short _int16_t;
typedef unsigned short _uint16_t;

typedef signed int _int32_t;
typedef unsigned int _uint32_t;
typedef long int _int32_t;
typedef long unsigned int _uint32_t;

typedef signed long long _int64_t;
typedef unsigned long long _uint64_t;
Expand Down
17 changes: 10 additions & 7 deletions arch/xtensa/src/common/espressif/esp_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ int map_rom_segments(uint32_t app_drom_start, uint32_t app_drom_vaddr,
ram_segments++;
}

ets_printf("%s: lma 0x%08x vma 0x%08x len 0x%-6x (%u)\n",
ets_printf("%s: lma 0x%08x vma 0x%08" PRIx32 " len 0x%-6" PRIx32 ""
" (%" PRIu32 ")\n",
IS_NONE(segment_hdr.load_addr) ? "???" :
IS_RTC_FAST_IRAM(segment_hdr.load_addr) ||
IS_RTC_FAST_DRAM(segment_hdr.load_addr) ||
Expand Down Expand Up @@ -266,12 +267,14 @@ int map_rom_segments(uint32_t app_drom_start, uint32_t app_drom_vaddr,
#if defined (CONFIG_ESP32S2_APP_FORMAT_MCUBOOT) || \
defined (CONFIG_ESP32S3_APP_FORMAT_MCUBOOT) || \
defined (CONFIG_ESP32_APP_FORMAT_MCUBOOT)
ets_printf("IROM segment aligned lma 0x%08x vma 0x%08x len 0x%06x (%u)\n",
app_irom_start_aligned, app_irom_vaddr_aligned,
app_irom_size, app_irom_size);
ets_printf("DROM segment aligned lma 0x%08x vma 0x%08x len 0x%06x (%u)\n",
app_drom_start_aligned, app_drom_vaddr_aligned,
app_drom_size, app_drom_size);
ets_printf("IROM segment aligned lma 0x%08" PRIx32 " vma 0x%08" PRIx32 ""
" len 0x%06" PRIx32 " "\
"(%" PRIu32 ")\n", app_irom_start_aligned,
app_irom_vaddr_aligned, app_irom_size, app_irom_size);
ets_printf("DROM segment aligned lma 0x%08" PRIx32 " vma 0x%08" PRIx32 ""
" len 0x%06" PRIx32 " "\
"(%" PRIu32 ")\n", app_drom_start_aligned,
app_drom_vaddr_aligned, app_drom_size, app_drom_size);
#endif

#ifdef CONFIG_ARCH_CHIP_ESP32
Expand Down
6 changes: 3 additions & 3 deletions arch/xtensa/src/common/espressif/esp_mcpwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@ static int esp_motor_fault_configure(struct mcpwm_motor_lowerhalf_s *lower,

#ifdef CONFIG_ESP_MCPWM_MOTOR
static int esp_motor_set_duty_cycle(struct mcpwm_motor_lowerhalf_s *lower,
float duty)
float duty)
{
DEBUGASSERT(lower != NULL);

Expand All @@ -1158,7 +1158,7 @@ static int esp_motor_set_duty_cycle(struct mcpwm_motor_lowerhalf_s *lower,
uint32_t pwm_count = -1 * lower->counter_peak * (duty - 1.0);
mcpwm_ll_operator_set_compare_value(hal->dev, lower->operator_id,
MCPWM_GENERATOR_0, pwm_count);
mtrinfo("Duty %f compare value set: %u\n", duty, pwm_count);
mtrinfo("Duty %f compare value set: %" PRIu32 "\n", duty, pwm_count);

return OK;
}
Expand Down Expand Up @@ -1924,7 +1924,7 @@ struct motor_lowerhalf_s *esp_motor_bdc_initialize(int channel,
return NULL;
}

mtrinfo("Channel %d initialized. GPIO: PWM_A: %d | PWM_B: %d | Freq: %d\n",
mtrinfo("Ch %d initialized GPIO: PWM_A %d | PWM_B %d | Freq %" PRIu32 "\n",
lower->channel_id, lower->generator_pins[MCPWM_GENERATOR_0],
lower->generator_pins[MCPWM_GENERATOR_1], lower->pwm_frequency);
return (struct motor_lowerhalf_s *) lower;
Expand Down
2 changes: 1 addition & 1 deletion arch/xtensa/src/common/espressif/esp_nxdiag.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ static ssize_t esp_nxdiag_read(struct file *filep,
}
else
{
snprintf(tmp, tmp_arr_size, "Flash status: 0x%lx\n\n",
snprintf(tmp, tmp_arr_size, "Flash status: 0x%" PRIx32 "\n\n",
(long unsigned int)flash_status);
strcat(buffer, tmp);
}
Expand Down
2 changes: 1 addition & 1 deletion arch/xtensa/src/common/espressif/esp_openeth.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ static IRAM_ATTR int openeth_isr_handler(int irq, void *context, void *arg)

if (status & OPENETH_INT_BUSY)
{
ninfo("RX frame dropped (0x%x)", status);
ninfo("RX frame dropped (0x%" PRIx32 ")", status);
}

/* Clear interrupt */
Expand Down
2 changes: 1 addition & 1 deletion arch/xtensa/src/common/espressif/esp_pcnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ static int esp_pcnt_ioctl(struct cap_lowerhalf_s *dev, int cmd,
ret = esp_pcnt_unit_register_event_callback(dev, handler);
if (ret != OK)
{
cperr("Could not register callback-%x to pcnt-%d!\n",
cperr("Could not register callback-%" PRIx32 " to pcnt-%d!\n",
(uint32_t)handler, priv->unit_id);
}

Expand Down
4 changes: 2 additions & 2 deletions arch/xtensa/src/common/espressif/esp_rmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1437,7 +1437,7 @@ static int IRAM_ATTR rmt_driver_isr_default(int irq, void *context,

rmt_ll_rx_reset_pointer(g_rmtdev_common.hal.regs, channel);
rmtinfo("RMT RX channel %d error", channel);
rmtinfo("status: 0x%08x",
rmtinfo("status: 0x%08" PRIx32 "",
rmt_ll_rx_get_status_word(g_rmtdev_common.hal.regs,
channel));
}
Expand All @@ -1462,7 +1462,7 @@ static int IRAM_ATTR rmt_driver_isr_default(int irq, void *context,

rmt_ll_tx_reset_pointer(g_rmtdev_common.hal.regs, channel);
rmtinfo("RMT TX channel %d error", channel);
rmtinfo("status: 0x%08x",
rmtinfo("status: 0x%08" PRIx32 "",
rmt_ll_tx_get_status_word(g_rmtdev_common.hal.regs,
channel));
}
Expand Down
22 changes: 11 additions & 11 deletions arch/xtensa/src/common/espressif/esp_wireless.c
Original file line number Diff line number Diff line change
Expand Up @@ -1074,8 +1074,8 @@ int esp_phy_update_country_info(const char *country)
*
****************************************************************************/

int32_t esp_timer_create(const esp_timer_create_args_t *create_args,
esp_timer_handle_t *out_handle)
int esp_timer_create(const esp_timer_create_args_t *create_args,
esp_timer_handle_t *out_handle)
{
int ret;
struct rt_timer_args_s rt_timer_args;
Expand Down Expand Up @@ -1111,7 +1111,7 @@ int32_t esp_timer_create(const esp_timer_create_args_t *create_args,
*
****************************************************************************/

int32_t esp_timer_start_once(esp_timer_handle_t timer, uint64_t timeout_us)
int esp_timer_start_once(esp_timer_handle_t timer, uint64_t timeout_us)
{
struct rt_timer_s *rt_timer = (struct rt_timer_s *)timer;

Expand All @@ -1135,7 +1135,7 @@ int32_t esp_timer_start_once(esp_timer_handle_t timer, uint64_t timeout_us)
*
****************************************************************************/

int32_t esp_timer_start_periodic(esp_timer_handle_t timer, uint64_t period)
int esp_timer_start_periodic(esp_timer_handle_t timer, uint64_t period)
{
struct rt_timer_s *rt_timer = (struct rt_timer_s *)timer;

Expand All @@ -1158,7 +1158,7 @@ int32_t esp_timer_start_periodic(esp_timer_handle_t timer, uint64_t period)
*
****************************************************************************/

int32_t esp_timer_stop(esp_timer_handle_t timer)
int esp_timer_stop(esp_timer_handle_t timer)
{
struct rt_timer_s *rt_timer = (struct rt_timer_s *)timer;

Expand All @@ -1181,7 +1181,7 @@ int32_t esp_timer_stop(esp_timer_handle_t timer)
*
****************************************************************************/

int32_t esp_timer_delete(esp_timer_handle_t timer)
int esp_timer_delete(esp_timer_handle_t timer)
{
struct rt_timer_s *rt_timer = (struct rt_timer_s *)timer;

Expand Down Expand Up @@ -1499,7 +1499,7 @@ int esp_wireless_deinit(void)
*
****************************************************************************/

int32_t esp_wifi_init(const wifi_init_config_t *config)
int esp_wifi_init(const wifi_init_config_t *config)
{
int32_t ret;

Expand All @@ -1520,7 +1520,7 @@ int32_t esp_wifi_init(const wifi_init_config_t *config)
ret = coex_init();
if (ret)
{
wlerr("ERROR: Failed to initialize coex error=%d\n", ret);
wlerr("ERROR: Failed to initialize coex error=%ld\n", ret);
return ret;
}
#endif
Expand All @@ -1534,7 +1534,7 @@ int32_t esp_wifi_init(const wifi_init_config_t *config)
ret = esp_wifi_init_internal(config);
if (ret)
{
wlerr("Failed to initialize Wi-Fi error=%d\n", ret);
wlerr("Failed to initialize Wi-Fi error=%ld\n", ret);
return ret;
}

Expand All @@ -1551,7 +1551,7 @@ int32_t esp_wifi_init(const wifi_init_config_t *config)
ret = esp_supplicant_init();
if (ret)
{
wlerr("Failed to initialize WPA supplicant error=%d\n", ret);
wlerr("Failed to initialize WPA supplicant error=%ld\n", ret);
esp_wifi_deinit_internal();
return ret;
}
Expand All @@ -1573,7 +1573,7 @@ int32_t esp_wifi_init(const wifi_init_config_t *config)
*
****************************************************************************/

int32_t esp_wifi_deinit(void)
int esp_wifi_deinit(void)
{
int ret;

Expand Down
12 changes: 6 additions & 6 deletions arch/xtensa/src/common/espressif/esp_wireless.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ int phy_printf(const char *format, ...) printf_like(1, 2);
*
****************************************************************************/

int32_t esp_timer_create(const esp_timer_create_args_t *create_args,
esp_timer_handle_t *out_handle);
int esp_timer_create(const esp_timer_create_args_t *create_args,
esp_timer_handle_t *out_handle);

/****************************************************************************
* Name: esp_timer_start_once
Expand All @@ -213,7 +213,7 @@ int32_t esp_timer_create(const esp_timer_create_args_t *create_args,
*
****************************************************************************/

int32_t esp_timer_start_once(esp_timer_handle_t timer, uint64_t timeout_us);
int esp_timer_start_once(esp_timer_handle_t timer, uint64_t timeout_us);

/****************************************************************************
* Name: esp_timer_start_periodic
Expand All @@ -230,7 +230,7 @@ int32_t esp_timer_start_once(esp_timer_handle_t timer, uint64_t timeout_us);
*
****************************************************************************/

int32_t esp_timer_start_periodic(esp_timer_handle_t timer, uint64_t period);
int esp_timer_start_periodic(esp_timer_handle_t timer, uint64_t period);

/****************************************************************************
* Name: esp_timer_stop
Expand All @@ -246,7 +246,7 @@ int32_t esp_timer_start_periodic(esp_timer_handle_t timer, uint64_t period);
*
****************************************************************************/

int32_t esp_timer_stop(esp_timer_handle_t timer);
int esp_timer_stop(esp_timer_handle_t timer);

/****************************************************************************
* Name: esp_timer_delete
Expand All @@ -262,7 +262,7 @@ int32_t esp_timer_stop(esp_timer_handle_t timer);
*
****************************************************************************/

int32_t esp_timer_delete(esp_timer_handle_t timer);
int esp_timer_delete(esp_timer_handle_t timer);

/****************************************************************************
* Name: esp_phy_update_country_info
Expand Down
2 changes: 1 addition & 1 deletion arch/xtensa/src/common/espressif/esp_ws2812.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ static ssize_t esp_write(struct file *filep, const char *data, size_t len)
if (((position + len) / WS2812_RW_PIXEL_SIZE) > dev->nleds)
{
ledwarn("esp_ws2812 write truncated:\n\t\tLED position: %d\n"
"\t\tLED requested to be written: %d\n"
"\t\tLED requested to be written: %" PRIu32 "\n"
"\t\tLED strip LED count: %d\n"
"\t\tLED being written: %d\n",
position / WS2812_RW_PIXEL_SIZE,
Expand Down
2 changes: 1 addition & 1 deletion arch/xtensa/src/common/xtensa_cpuinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ ssize_t up_show_cpuinfo(char *buf, size_t buf_size, off_t file_off)

procfs_sprintf(buf, buf_size, &file_off,
"core ID\t\t: " XCHAL_CORE_ID "\n"
"build ID\t: 0x%x\n"
"build ID\t: %08x\n"
"config ID\t: %08" PRIx32 ":%08" PRIx32 "\n",
XCHAL_BUILD_UNIQUE_ID,
xtensa_getconfig0(), xtensa_getconfig1());
Expand Down
2 changes: 1 addition & 1 deletion arch/xtensa/src/esp32/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ endif

ESP_HAL_3RDPARTY_REPO = esp-hal-3rdparty
ifndef ESP_HAL_3RDPARTY_VERSION
ESP_HAL_3RDPARTY_VERSION = 5d4868f08b94efbe76383382f7a843c6cdeaf811
ESP_HAL_3RDPARTY_VERSION = 82650fec17ee061e318687a102bddbe8e0a0583e
endif

ifndef ESP_HAL_3RDPARTY_URL
Expand Down
Loading
Loading