Skip to content

Commit

Permalink
cpu/esp32: rename CPU_INUM_RTC to CPU_INUM_RTT
Browse files Browse the repository at this point in the history
  • Loading branch information
gschorcht committed Jun 28, 2022
1 parent 6bd6afb commit 4be0abf
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cpu/esp32/include/irq_arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ extern "C" {
#define CPU_INUM_GPIO 2 /**< Level interrupt with low priority 1 */
#define CPU_INUM_CAN 3 /**< Level interrupt with low priority 1 */
#define CPU_INUM_UART 5 /**< Level interrupt with low priority 1 */
#define CPU_INUM_RTC 9 /**< Level interrupt with low priority 1 */
#define CPU_INUM_RTT 9 /**< Level interrupt with low priority 1 */
#define CPU_INUM_I2C 12 /**< Level interrupt with low priority 1 */
#define CPU_INUM_WDT 13 /**< Level interrupt with low priority 1 */
#define CPU_INUM_SOFTWARE 17 /**< Level interrupt with low priority 1 */
Expand Down
2 changes: 1 addition & 1 deletion cpu/esp32/irq_arch.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ typedef struct intr_handle_data_t {
static const struct intr_handle_data_t _irq_data_table[] = {
{ ETS_FROM_CPU_INTR0_SOURCE, CPU_INUM_SOFTWARE, 1 },
{ ETS_TG0_WDT_LEVEL_INTR_SOURCE, CPU_INUM_WDT, 1 },
{ ETS_TG0_T0_LEVEL_INTR_SOURCE, CPU_INUM_RTC, 1 },
{ ETS_TG0_T0_LEVEL_INTR_SOURCE, CPU_INUM_RTT, 1 },
#if defined(MCU_ESP32) || defined(MCU_ESP32S2) || defined(MCU_ESP32S3)
{ ETS_TG0_T1_LEVEL_INTR_SOURCE, CPU_INUM_TIMER, 2 },
#endif
Expand Down
10 changes: 5 additions & 5 deletions cpu/esp32/periph/rtt_hw_rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,18 @@ static void _rtc_init(void)
static void _rtc_poweron(void)
{
/* route all interrupt sources to the same RTT level type interrupt */
intr_matrix_set(PRO_CPU_NUM, ETS_RTC_CORE_INTR_SOURCE, CPU_INUM_RTC);
intr_matrix_set(PRO_CPU_NUM, ETS_RTC_CORE_INTR_SOURCE, CPU_INUM_RTT);

/* set interrupt handler and enable the CPU interrupt */
xt_set_interrupt_handler(CPU_INUM_RTC, _rtc_isr, NULL);
xt_ints_on(BIT(CPU_INUM_RTC));
xt_set_interrupt_handler(CPU_INUM_RTT, _rtc_isr, NULL);
xt_ints_on(BIT(CPU_INUM_RTT));
}

static void _rtc_poweroff(void)
{
/* reset interrupt handler and disable the CPU interrupt */
xt_ints_off(BIT(CPU_INUM_RTC));
xt_set_interrupt_handler(CPU_INUM_RTC, NULL, NULL);
xt_ints_off(BIT(CPU_INUM_RTT));
xt_set_interrupt_handler(CPU_INUM_RTT, NULL, NULL);
}

uint64_t _rtc_get_counter(void)
Expand Down
10 changes: 5 additions & 5 deletions cpu/esp32/periph/rtt_hw_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,18 @@ static void _sys_init(void)
static void _sys_poweron(void)
{
/* route all interrupt sources to the same RTT level type interrupt */
intr_matrix_set(PRO_CPU_NUM, TIMER_SYSTEM_INT_SRC, CPU_INUM_RTC);
intr_matrix_set(PRO_CPU_NUM, TIMER_SYSTEM_INT_SRC, CPU_INUM_RTT);

/* set interrupt handler and enable the CPU interrupt */
xt_set_interrupt_handler(CPU_INUM_RTC, _sys_isr, NULL);
xt_ints_on(BIT(CPU_INUM_RTC));
xt_set_interrupt_handler(CPU_INUM_RTT, _sys_isr, NULL);
xt_ints_on(BIT(CPU_INUM_RTT));
}

static void _sys_poweroff(void)
{
/* reset interrupt handler and disable the CPU interrupt */
xt_ints_off(BIT(CPU_INUM_RTC));
xt_set_interrupt_handler(CPU_INUM_RTC, NULL, NULL);
xt_ints_off(BIT(CPU_INUM_RTT));
xt_set_interrupt_handler(CPU_INUM_RTT, NULL, NULL);
}

static uint64_t _sys_get_counter(void)
Expand Down

0 comments on commit 4be0abf

Please sign in to comment.