summaryrefslogtreecommitdiffstats
path: root/keyboards/keychron/bluetooth
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/keychron/bluetooth')
-rw-r--r--keyboards/keychron/bluetooth/lpm_stm32l432.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/keyboards/keychron/bluetooth/lpm_stm32l432.c b/keyboards/keychron/bluetooth/lpm_stm32l432.c
index 10b64731dd..288cb66765 100644
--- a/keyboards/keychron/bluetooth/lpm_stm32l432.c
+++ b/keyboards/keychron/bluetooth/lpm_stm32l432.c
@@ -31,6 +31,7 @@
#include "battery.h"
#include "report_buffer.h"
#include "stm32_bd.inc"
+#include "debounce.h"
extern pin_t row_pins[MATRIX_ROWS];
extern void select_all_cols(void);
@@ -248,6 +249,11 @@ void enter_power_mode(pm_t mode) {
lpm_wakeup();
lpm_timer_reset();
report_buffer_init();
+
+ /* Call debounce_free() to avoid memory leak as debounce_init() invoked in matrix_init() allocates
+ * new memory when using per row/key debounce
+ */
+ debounce_free();
matrix_init();
power_mode = PM_RUN;
}