From 21a9fdf45a0ed588151fdc2f13ba3e68ce47f11d Mon Sep 17 00:00:00 2001 From: d00f <8052722+DrDoof@users.noreply.github.com> Date: Tue, 8 Sep 2026 01:06:57 +0200 Subject: [PATCH] Do not enter Idle mode from the external interrupt 2 handler isr_ext2() ends with PCON |= 1. On the DW8051 any enabled interrupt request ends idle, so the handler sleeps until the next request arrives, the system tick at the latest, and only then returns. Everything at the same priority waits with it, and the instruction after the idle is RETI, so the sleep buys nothing. The handler still clears its flag, which is what it has to do. The other four uses of PCON |= 1 are in task context and are left alone. --- rtlplayground.c | 1 - 1 file changed, 1 deletion(-) diff --git a/rtlplayground.c b/rtlplayground.c index 700df0b8..f4228e27 100644 --- a/rtlplayground.c +++ b/rtlplayground.c @@ -516,7 +516,6 @@ void isr_ext1(void) __interrupt(2) void isr_ext2(void) __interrupt(8) { EXIF &= 0xef; // Clear IRQ flag (bit 7) in EXIF - PCON |= 1; // Enter Idle mode until interrupt occurs } /*