浏览代码

repeat_key.c: add implementation for get_last_record (#26263)

The `get_last_record` signature was present in repeat_key.h but without
any implementation in repeat_key.c which caused compilation errors for
any user of `get_last_record`.
precondition 2 月之前
父节点
当前提交
721affff7b
共有 2 个文件被更改,包括 5 次插入1 次删除
  1. 4 0
      quantum/repeat_key.c
  2. 1 1
      quantum/repeat_key.h

+ 4 - 0
quantum/repeat_key.c

@@ -45,6 +45,10 @@ uint16_t get_last_keycode(void) {
     return last_record.keycode;
     return last_record.keycode;
 }
 }
 
 
+const keyrecord_t* get_last_record(void) {
+    return &last_record;
+}
+
 uint8_t get_last_mods(void) {
 uint8_t get_last_mods(void) {
     return last_mods;
     return last_mods;
 }
 }

+ 1 - 1
quantum/repeat_key.h

@@ -26,7 +26,7 @@ void     set_last_keycode(uint16_t keycode); /**< Sets the last key. */
 void     set_last_mods(uint8_t mods);        /**< Sets the last mods. */
 void     set_last_mods(uint8_t mods);        /**< Sets the last mods. */
 
 
 /** @brief Gets the record for the last key. */
 /** @brief Gets the record for the last key. */
-keyrecord_t* get_last_record(void);
+const keyrecord_t* get_last_record(void);
 
 
 /** @brief Sets keycode and record info for the last key. */
 /** @brief Sets keycode and record info for the last key. */
 void set_last_record(uint16_t keycode, keyrecord_t* record);
 void set_last_record(uint16_t keycode, keyrecord_t* record);