summaryrefslogtreecommitdiff
path: root/tmk_core/common
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/common')
-rw-r--r--tmk_core/common/avr/suspend.c22
-rw-r--r--tmk_core/common/avr/suspend_avr.h33
-rw-r--r--tmk_core/common/chibios/suspend.c4
-rw-r--r--tmk_core/common/keyboard.c2
4 files changed, 18 insertions, 43 deletions
diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c
index c59c196880..11ac146eb8 100644
--- a/tmk_core/common/avr/suspend.c
+++ b/tmk_core/common/avr/suspend.c
@@ -9,7 +9,6 @@
#include "timer.h"
#include "led.h"
#include "host.h"
-#include "rgblight_reconfig.h"
#ifdef PROTOCOL_LUFA
# include "lufa.h"
@@ -30,23 +29,6 @@ static bool rgblight_enabled;
static bool is_suspended;
#endif
-#define wdt_intr_enable(value) \
- __asm__ __volatile__("in __tmp_reg__,__SREG__" \
- "\n\t" \
- "cli" \
- "\n\t" \
- "wdr" \
- "\n\t" \
- "sts %0,%1" \
- "\n\t" \
- "out __SREG__,__tmp_reg__" \
- "\n\t" \
- "sts %0,%2" \
- "\n\t" \
- : /* no outputs */ \
- : "M"(_SFR_MEM_ADDR(_WD_CONTROL_REG)), "r"(_BV(_WD_CHANGE_BIT) | _BV(WDE)), "r"((uint8_t)((value & 0x08 ? _WD_PS3_MASK : 0x00) | _BV(WDIE) | (value & 0x07))) \
- : "r0")
-
/** \brief Suspend idle
*
* FIXME: needs doc
@@ -122,9 +104,7 @@ static void power_down(uint8_t wdto) {
// stop_all_notes();
# endif /* AUDIO_ENABLE */
# if defined(RGBLIGHT_SLEEP) && defined(RGBLIGHT_ENABLE)
-# ifdef RGBLIGHT_ANIMATIONS
rgblight_timer_disable();
-# endif
if (!is_suspended) {
is_suspended = true;
rgblight_enabled = rgblight_config.enable;
@@ -204,9 +184,7 @@ void suspend_wakeup_init(void) {
# endif
rgblight_enable_noeeprom();
}
-# ifdef RGBLIGHT_ANIMATIONS
rgblight_timer_enable();
-# endif
#endif
suspend_wakeup_init_kb();
}
diff --git a/tmk_core/common/avr/suspend_avr.h b/tmk_core/common/avr/suspend_avr.h
index d73852ba11..e4cc0be505 100644
--- a/tmk_core/common/avr/suspend_avr.h
+++ b/tmk_core/common/avr/suspend_avr.h
@@ -7,21 +7,22 @@
#include <avr/wdt.h>
#include <avr/interrupt.h>
-#define wdt_intr_enable(value) \
- __asm__ __volatile__("in __tmp_reg__,__SREG__" \
- "\n\t" \
- "cli" \
- "\n\t" \
- "wdr" \
- "\n\t" \
- "sts %0,%1" \
- "\n\t" \
- "out __SREG__,__tmp_reg__" \
- "\n\t" \
- "sts %0,%2" \
- "\n\t" \
- : /* no outputs */ \
- : "M"(_SFR_MEM_ADDR(_WD_CONTROL_REG)), "r"(_BV(_WD_CHANGE_BIT) | _BV(WDE)), "r"((uint8_t)((value & 0x08 ? _WD_PS3_MASK : 0x00) | _BV(WDIE) | (value & 0x07))) \
- : "r0")
+// clang-format off
+#define wdt_intr_enable(value) \
+__asm__ __volatile__ ( \
+ "in __tmp_reg__,__SREG__" "\n\t" \
+ "cli" "\n\t" \
+ "wdr" "\n\t" \
+ "sts %0,%1" "\n\t" \
+ "out __SREG__,__tmp_reg__" "\n\t" \
+ "sts %0,%2" "\n\t" \
+ : /* no outputs */ \
+ : "M" (_SFR_MEM_ADDR(_WD_CONTROL_REG)), \
+ "r" (_BV(_WD_CHANGE_BIT) | _BV(WDE)), \
+ "r" ((uint8_t) ((value & 0x08 ? _WD_PS3_MASK : 0x00) | \
+ _BV(WDIE) | (value & 0x07)) ) \
+ : "r0" \
+)
+// clang-format on
#endif
diff --git a/tmk_core/common/chibios/suspend.c b/tmk_core/common/chibios/suspend.c
index 5be1b76777..8c071e7a08 100644
--- a/tmk_core/common/chibios/suspend.c
+++ b/tmk_core/common/chibios/suspend.c
@@ -51,9 +51,7 @@ void suspend_power_down(void) {
// shouldn't power down TPM/FTM if we want a breathing LED
// also shouldn't power down USB
#if defined(RGBLIGHT_SLEEP) && defined(RGBLIGHT_ENABLE)
-# ifdef RGBLIGHT_ANIMATIONS
rgblight_timer_disable();
-# endif
if (!is_suspended) {
is_suspended = true;
rgblight_enabled = rgblight_config.enable;
@@ -126,9 +124,7 @@ void suspend_wakeup_init(void) {
if (rgblight_enabled) {
rgblight_enable_noeeprom();
}
-# ifdef RGBLIGHT_ANIMATIONS
rgblight_timer_enable();
-# endif
#endif
suspend_wakeup_init_kb();
}
diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c
index 95238d1c4c..d576d565d1 100644
--- a/tmk_core/common/keyboard.c
+++ b/tmk_core/common/keyboard.c
@@ -330,7 +330,7 @@ MATRIX_LOOP_END:
matrix_scan_perf_task();
#endif
-#if defined(RGBLIGHT_ANIMATIONS) && defined(RGBLIGHT_ENABLE)
+#if defined(RGBLIGHT_ENABLE)
rgblight_task();
#endif