Skip to content
Merged
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
2 changes: 1 addition & 1 deletion arch/xtensa/src/common/espressif/esp_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ static int esp_adc_oneshot_new_unit(struct adc_dev_s *dev)

spin_unlock_irqrestore(&g_adc_common.esp_adc_spinlock, flags);

ainfo("unit %d freq %u\n", priv->unit, clk_src_freq_hz);
ainfo("unit %d freq %" PRIu32 "\n", priv->unit, clk_src_freq_hz);
return OK;
}

Expand Down
27 changes: 16 additions & 11 deletions arch/xtensa/src/common/espressif/esp_i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -2041,8 +2041,8 @@ static void i2s_set_clock(struct esp_i2s_s *priv)

mclk_div = sclk / mclk;

i2sinfo("Clock division info: [sclk]%" PRIu32 " Hz [mdiv] %d "
"[mclk] %" PRIu32 " Hz [bdiv] %d [bclk] %" PRIu32 " Hz\n",
i2sinfo("Clock division info: [sclk]%" PRIu32 " Hz [mdiv] %lu "
"[mclk] %" PRIu32 " Hz [bdiv] %" PRIu16 " [bclk] %" PRIu32 " Hz\n",
sclk, mclk_div, mclk, bclk_div, bclk);

priv->config->clk_info->bclk = bclk;
Expand Down Expand Up @@ -2085,7 +2085,7 @@ static void i2s_tx_channel_start(struct esp_i2s_s *priv)
{
if (priv->tx_started)
{
i2swarn("TX channel of port %d was previously started\n",
i2swarn("TX channel of port %" PRIu32 " was previously started\n",
priv->config->port);
return;
}
Expand Down Expand Up @@ -2127,7 +2127,8 @@ static void i2s_tx_channel_start(struct esp_i2s_s *priv)

priv->tx_started = true;

i2sinfo("Started TX channel of port %d\n", priv->config->port);
i2sinfo("Started TX channel of port %" PRIu32 "\n",
priv->config->port);
}
}
#endif /* I2S_HAVE_TX */
Expand All @@ -2153,7 +2154,7 @@ static void i2s_rx_channel_start(struct esp_i2s_s *priv)
{
if (priv->rx_started)
{
i2swarn("RX channel of port %d was previously started\n",
i2swarn("RX channel of port %" PRIu32 " was previously started\n",
priv->config->port);
return;
}
Expand Down Expand Up @@ -2195,7 +2196,8 @@ static void i2s_rx_channel_start(struct esp_i2s_s *priv)

priv->rx_started = true;

i2sinfo("Started RX channel of port %d\n", priv->config->port);
i2sinfo("Started RX channel of port %" PRIu32 "\n",
priv->config->port);
}
}
#endif /* I2S_HAVE_RX */
Expand All @@ -2221,7 +2223,7 @@ static void i2s_tx_channel_stop(struct esp_i2s_s *priv)
{
if (!priv->tx_started)
{
i2swarn("TX channel of port %d was previously stopped\n",
i2swarn("TX channel of port %" PRIu32 " was previously stopped\n",
priv->config->port);
return;
}
Expand Down Expand Up @@ -2250,7 +2252,8 @@ static void i2s_tx_channel_stop(struct esp_i2s_s *priv)

priv->tx_started = false;

i2sinfo("Stopped TX channel of port %d\n", priv->config->port);
i2sinfo("Stopped TX channel of port %" PRIu32 "\n",
priv->config->port);
}
}
#endif /* I2S_HAVE_TX */
Expand All @@ -2276,7 +2279,7 @@ static void i2s_rx_channel_stop(struct esp_i2s_s *priv)
{
if (!priv->rx_started)
{
i2swarn("RX channel of port %d was previously stopped\n",
i2swarn("RX channel of port %" PRIu32 " was previously stopped\n",
priv->config->port);
return;
}
Expand Down Expand Up @@ -2305,7 +2308,8 @@ static void i2s_rx_channel_stop(struct esp_i2s_s *priv)

priv->rx_started = false;

i2sinfo("Stopped RX channel of port %d\n", priv->config->port);
i2sinfo("Stopped RX channel of port %" PRIu32 "\n",
priv->config->port);
}
}
#endif /* I2S_HAVE_RX */
Expand Down Expand Up @@ -3247,7 +3251,8 @@ struct i2s_dev_s *esp_i2sbus_initialize(int port)

/* Success exit */

i2sinfo("I2S%d was successfully initialized\n", priv->config->port);
i2sinfo("I2S%" PRIu32 " was successfully initialized\n",
priv->config->port);

return &priv->dev;

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);
Copy link
Contributor

Choose a reason for hiding this comment

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

you should remove the cast. (or revert the format change)

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
Loading