aboutsummaryrefslogtreecommitdiff
path: root/quantum/dynamic_macro.h
diff options
context:
space:
mode:
authorWojciech Siewierski <wojciech.siewierski@onet.pl>2017-05-04 22:39:02 +0200
committerWojciech Siewierski <wojciech.siewierski@onet.pl>2017-05-04 22:39:02 +0200
commit8e94c9b4cba4cf3479154a11faacfa2bbad50098 (patch)
treefb23e1603d11d708fc743741ecddb72dc479e9a5 /quantum/dynamic_macro.h
parent4b50ea15a954de2e6062aa7228bd1f9f76669ce7 (diff)
downloadqmk_firmware-8e94c9b4cba4cf3479154a11faacfa2bbad50098.tar.gz
qmk_firmware-8e94c9b4cba4cf3479154a11faacfa2bbad50098.zip
dynamic_macro.h: Make the documentation more clear
Diffstat (limited to 'quantum/dynamic_macro.h')
-rw-r--r--quantum/dynamic_macro.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/quantum/dynamic_macro.h b/quantum/dynamic_macro.h
index c4017aec9..6aae7d230 100644
--- a/quantum/dynamic_macro.h
+++ b/quantum/dynamic_macro.h
@@ -99,7 +99,7 @@ void dynamic_macro_play(
99 * 99 *
100 * @param macro_buffer[in] The start of the used macro buffer. 100 * @param macro_buffer[in] The start of the used macro buffer.
101 * @param macro_pointer[in,out] The current buffer position. 101 * @param macro_pointer[in,out] The current buffer position.
102 * @param macro2_end[in] The last buffer element it is safe to use before overwriting the other macro. 102 * @param macro2_end[in] The end of the other macro.
103 * @param direction[in] Either +1 or -1, which way to iterate the buffer. 103 * @param direction[in] Either +1 or -1, which way to iterate the buffer.
104 * @param record[in] The current keypress. 104 * @param record[in] The current keypress.
105 */ 105 */
@@ -115,6 +115,9 @@ void dynamic_macro_record_key(
115 return; 115 return;
116 } 116 }
117 117
118 /* The other end of the other macro is the last buffer element it
119 * is safe to use before overwriting the other macro.
120 */
118 if (*macro_pointer - direction != macro2_end) { 121 if (*macro_pointer - direction != macro2_end) {
119 **macro_pointer = *record; 122 **macro_pointer = *record;
120 *macro_pointer += direction; 123 *macro_pointer += direction;
@@ -170,7 +173,7 @@ bool process_record_dynamic_macro(uint16_t keycode, keyrecord_t *record)
170 * &macro_buffer macro_end 173 * &macro_buffer macro_end
171 * v v 174 * v v
172 * +------------------------------------------------------------+ 175 * +------------------------------------------------------------+
173 * |>>>>>> MACRO1 >>>>>>| |<<<<<<<<<<<<< MACRO2 <<<<<<<<<<<<<| 176 * |>>>>>> MACRO1 >>>>>> <<<<<<<<<<<<< MACRO2 <<<<<<<<<<<<<|
174 * +------------------------------------------------------------+ 177 * +------------------------------------------------------------+
175 * ^ ^ 178 * ^ ^
176 * r_macro_end r_macro_buffer 179 * r_macro_end r_macro_buffer