summaryrefslogtreecommitdiff
path: root/quantum
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2022-11-03 23:42:58 +0000
committerGitHub <noreply@github.com>2022-11-03 23:42:58 +0000
commit1249f74b31863bc0118057884abae10de698e4a5 (patch)
treeb7e80bea704aa947da0a5229a51fa0f88f311ada /quantum
parentfe18df9d4186c7f2c97a2bfccf3cc0e11615c728 (diff)
Reduce includes for caps_word header (#18948)
Diffstat (limited to 'quantum')
-rw-r--r--quantum/caps_word.c6
-rw-r--r--quantum/caps_word.h27
2 files changed, 22 insertions, 11 deletions
diff --git a/quantum/caps_word.c b/quantum/caps_word.c
index 5b83659f28..66fd0e8afb 100644
--- a/quantum/caps_word.c
+++ b/quantum/caps_word.c
@@ -12,7 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+#include <stdint.h>
#include "caps_word.h"
+#include "timer.h"
+#include "action.h"
+#include "action_util.h"
/** @brief True when Caps Word is active. */
static bool caps_word_active = false;
@@ -36,6 +40,8 @@ void caps_word_task(void) {
void caps_word_reset_idle_timer(void) {
idle_timer = timer_read() + CAPS_WORD_IDLE_TIMEOUT;
}
+#else
+void caps_word_task(void) {}
#endif // CAPS_WORD_IDLE_TIMEOUT > 0
void caps_word_on(void) {
diff --git a/quantum/caps_word.h b/quantum/caps_word.h
index b83f73371e..078d29ead0 100644
--- a/quantum/caps_word.h
+++ b/quantum/caps_word.h
@@ -14,26 +14,31 @@
#pragma once
-#include "quantum.h"
+#include <stdbool.h>
#ifndef CAPS_WORD_IDLE_TIMEOUT
# define CAPS_WORD_IDLE_TIMEOUT 5000 // Default timeout of 5 seconds.
-#endif // CAPS_WORD_IDLE_TIMEOUT
+#endif
-#if CAPS_WORD_IDLE_TIMEOUT > 0
/** @brief Matrix scan task for Caps Word feature */
void caps_word_task(void);
+#if CAPS_WORD_IDLE_TIMEOUT > 0
/** @brief Resets timer for Caps Word idle timeout. */
void caps_word_reset_idle_timer(void);
-#else
-static inline void caps_word_task(void) {}
-#endif // CAPS_WORD_IDLE_TIMEOUT > 0
-
-void caps_word_on(void); /**< Activates Caps Word. */
-void caps_word_off(void); /**< Deactivates Caps Word. */
-void caps_word_toggle(void); /**< Toggles Caps Word. */
-bool is_caps_word_on(void); /**< Gets whether currently active. */
+#endif
+
+/** @brief Activates Caps Word. */
+void caps_word_on(void);
+
+/** @brief Deactivates Caps Word. */
+void caps_word_off(void);
+
+/** @brief Toggles Caps Word. */
+void caps_word_toggle(void);
+
+/** @brief Gets whether currently active. */
+bool is_caps_word_on(void);
/**
* @brief Caps Word set callback.