diff --git a/irmp-main-chibios.c b/irmp-main-chibios.c
index 06d0800..ba4cd65 100644
--- a/irmp-main-chibios.c
+++ b/irmp-main-chibios.c
@@ -44,6 +44,43 @@ static const GPTConfig irmp_gpt_cfg =
     0
 };
 
+#if IRMP_USE_IDLE_CALL == 1
+/*
+ * Idle and sleepmode handling
+ *
+ * irmp_idle is called from irmp_ISR when irmp is idle.
+ * Switch off the timer and use a pinchange interrupt.
+ * 
+ * When a pinchange is detected, re-enable the timer.
+ * 
+ * To actually send the controller into a sleep mode, you have to provide code in
+ * CH_CFG_IDLE_ENTER_HOOK() or enable CORTEX_ENABLE_WFI_IDLE. Then ChibiOS activates
+ * the sleepmode when all threads are idle
+ *
+ * Both functions are called from irq context, so only use ...I syscalls
+ */
+
+static void irmp_reenable(void *arg)
+{
+    (void)arg;
+
+    palDisableLineEventI(LINE_IR_IN);
+    gptStartContinuousI(&GPTD14, 10);
+
+    // call irmp_ISR once, the next call is then done by the timer again
+    // this gives a slight timing imperfection but it seems to be within the allowed tolerance
+    (void) irmp_ISR();
+}
+
+void irmp_idle(void)
+{
+    gptStopTimerI(&GPTD14);
+
+    palSetLineCallbackI(LINE_IR_IN, irmp_reenable, NULL);
+    palEnableLineEventI(LINE_IR_IN, PAL_EVENT_MODE_FALLING_EDGE);
+}
+#endif // IRMP_USE_IDLE_CALL
+
 /*
  * IR receive thread, sends decoded IR data to a serial data stream
  */
diff --git a/irmp.c b/irmp.c
index 466eab4..76303a3 100644
--- a/irmp.c
+++ b/irmp.c
@@ -5212,6 +5212,18 @@ irmp_ISR (void)
         chEvtSignalI(IRMP_EVENT_THREAD_PTR,IRMP_EVENT_BIT);
 #endif
 
+#if IRMP_USE_IDLE_CALL == 1
+    // check if there is no ongoing transmission or repetition
+    if (!irmp_start_bit_detected && !irmp_pulse_time
+        && key_repetition_len > IRMP_KEY_REPETITION_LEN)
+    {
+        // no ongoing transmission
+        // enough time passed since last decoded signal that a repetition won't affect our output
+
+        irmp_idle();
+    }
+#endif // IRMP_USE_IDLE_CALL
+
     return (irmp_ir_detected);
 }
 
diff --git a/irmp.h b/irmp.h
index 2c3a4c1..62fb25f 100644
--- a/irmp.h
+++ b/irmp.h
@@ -92,6 +92,10 @@
 
 #endif
 
+#if IRMP_USE_IDLE_CALL == 1
+void irmp_idle(void);                   // the user has to provide an implementation of the irmp_idle() function and link it
+#endif
+
 #if IRMP_SUPPORT_TECHNICS_PROTOCOL == 1
 #  undef IRMP_SUPPORT_MATSUSHITA_PROTOCOL
 #  define IRMP_SUPPORT_MATSUSHITA_PROTOCOL      1
diff --git a/irmpconfig.h b/irmpconfig.h
index 94f8f2b..ec5a784 100644
--- a/irmpconfig.h
+++ b/irmpconfig.h
@@ -227,6 +227,15 @@
 #  define IRMP_USE_CALLBACK                     0       // 1: use callbacks. 0: do not. default is 0
 #endif
 
+/*---------------------------------------------------------------------------------------------------------------------------------------------------
+ * Call the user-provided irmp_idle() function when IRMP is idle.
+ * Can be used to disable the timer irq and enter a sleep mode to save power
+ *---------------------------------------------------------------------------------------------------------------------------------------------------
+ */
+#ifndef IRMP_USE_IDLE_CALL
+#  define IRMP_USE_IDLE_CALL                    0       // 1: use idle calls. 0: do not. default is 0
+#endif
+
 /*---------------------------------------------------------------------------------------------------------------------------------------------------
  * Use ChibiOS Events to signal that valid IR data was received
  *---------------------------------------------------------------------------------------------------------------------------------------------------
