summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2021-01-30 15:13:56 +1100
committerGitHub <noreply@github.com>2021-01-29 20:13:56 -0800
commit4fe4087d4abd13a0f7b5754a1766151f02daf3fc (patch)
treeee41699775e2ede45ab9208a7dc6d8eb8505c0a3
parent787ff5b55014d725a88aedb7915f226dce054f7a (diff)
downloadqmk_firmware-4fe4087d4abd13a0f7b5754a1766151f02daf3fc.tar.gz
qmk_firmware-4fe4087d4abd13a0f7b5754a1766151f02daf3fc.zip
Enforce memory allocator for ChibiOS builds with allocating debounce algorithms (#11630)
-rw-r--r--quantum/debounce/sym_defer_pk.c6
-rw-r--r--quantum/debounce/sym_eager_pk.c6
-rw-r--r--quantum/debounce/sym_eager_pr.c6
3 files changed, 18 insertions, 0 deletions
diff --git a/quantum/debounce/sym_defer_pk.c b/quantum/debounce/sym_defer_pk.c
index 6c0e3bb071..60513f98e1 100644
--- a/quantum/debounce/sym_defer_pk.c
+++ b/quantum/debounce/sym_defer_pk.c
@@ -23,6 +23,12 @@ When no state changes have occured for DEBOUNCE milliseconds, we push the state.
#include "quantum.h"
#include <stdlib.h>
+#ifdef PROTOCOL_CHIBIOS
+# if CH_CFG_USE_MEMCORE == FALSE
+# error ChibiOS is configured without a memory allocator. Your keyboard may have set `#define CH_CFG_USE_MEMCORE FALSE`, which is incompatible with this debounce algorithm.
+# endif
+#endif
+
#ifndef DEBOUNCE
# define DEBOUNCE 5
#endif
diff --git a/quantum/debounce/sym_eager_pk.c b/quantum/debounce/sym_eager_pk.c
index 93a40ad441..e66cf92d79 100644
--- a/quantum/debounce/sym_eager_pk.c
+++ b/quantum/debounce/sym_eager_pk.c
@@ -23,6 +23,12 @@ No further inputs are accepted until DEBOUNCE milliseconds have occurred.
#include "quantum.h"
#include <stdlib.h>
+#ifdef PROTOCOL_CHIBIOS
+# if CH_CFG_USE_MEMCORE == FALSE
+# error ChibiOS is configured without a memory allocator. Your keyboard may have set `#define CH_CFG_USE_MEMCORE FALSE`, which is incompatible with this debounce algorithm.
+# endif
+#endif
+
#ifndef DEBOUNCE
# define DEBOUNCE 5
#endif
diff --git a/quantum/debounce/sym_eager_pr.c b/quantum/debounce/sym_eager_pr.c
index d12931fddb..20ccb46f1d 100644
--- a/quantum/debounce/sym_eager_pr.c
+++ b/quantum/debounce/sym_eager_pr.c
@@ -23,6 +23,12 @@ No further inputs are accepted until DEBOUNCE milliseconds have occurred.
#include "quantum.h"
#include <stdlib.h>
+#ifdef PROTOCOL_CHIBIOS
+# if CH_CFG_USE_MEMCORE == FALSE
+# error ChibiOS is configured without a memory allocator. Your keyboard may have set `#define CH_CFG_USE_MEMCORE FALSE`, which is incompatible with this debounce algorithm.
+# endif
+#endif
+
#ifndef DEBOUNCE
# define DEBOUNCE 5
#endif