Skip to content

Commit 1854809

Browse files
committed
cpu/esp32: changes for RTOS SDK
1 parent e47ea05 commit 1854809

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

cpu/esp32/exceptions.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,3 +205,10 @@ void IRAM NORETURN panic_arch(void)
205205

206206
UNREACHABLE();
207207
}
208+
209+
void _panic_handler(uint32_t addr)
210+
{
211+
ets_printf("#! _xt_panic called from 0x%08x: powering off\n", addr);
212+
pm_off();
213+
while (1) { };
214+
}

cpu/esp32/include/periph_cpu.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,11 @@ typedef struct {
325325
gpio_t sda; /**< GPIO used as SDA pin */
326326
} i2c_conf_t;
327327

328+
/**
329+
* @brief Maximum number of I2C interfaces that can be used by board definitions
330+
*/
331+
#define I2C_NUMOF_MAX (2)
332+
328333
#define PERIPH_I2C_NEED_READ_REG /**< i2c_read_reg required */
329334
#define PERIPH_I2C_NEED_READ_REGS /**< i2c_read_regs required */
330335
#define PERIPH_I2C_NEED_WRITE_REG /**< i2c_write_reg required */
@@ -333,7 +338,6 @@ typedef struct {
333338

334339
/**
335340
* @name PWM configuration
336-
* @{
337341
*
338342
* PWM implementation uses ESP32's high-speed MCPWM modules. ESP32 has 2 such
339343
* modules, each with up to 6 channels (PWM_CHANNEL_NUM_DEV_MAX). Thus, the
@@ -355,6 +359,8 @@ typedef struct {
355359
* @note As long as the GPIOs listed in PWM0_GPIOS and PMW1_GPIOS are not
356360
* initialized as PWM channels with the *pwm_init* function, they can be used
357361
* other purposes.
362+
*
363+
* @{
358364
*/
359365

360366
/**
@@ -402,6 +408,8 @@ typedef struct {
402408
*
403409
* SPI_NUMOF is determined automatically from the board-specific peripheral
404410
* definitions of SPIn_*.
411+
*
412+
* @{
405413
*/
406414

407415
/**
@@ -423,6 +431,11 @@ typedef struct {
423431
gpio_t cs; /**< GPIO used as CS0 pin */
424432
} spi_conf_t;
425433

434+
/**
435+
* @brief Maximum number of SPI interfaces that can be used by board definitions
436+
*/
437+
#define SPI_NUMOF_MAX 2
438+
426439
#define PERIPH_SPI_NEEDS_TRANSFER_BYTE /**< requires function spi_transfer_byte */
427440
#define PERIPH_SPI_NEEDS_TRANSFER_REG /**< requires function spi_transfer_reg */
428441
#define PERIPH_SPI_NEEDS_TRANSFER_REGS /**< requires function spi_transfer_regs */

0 commit comments

Comments
 (0)