diff options
Diffstat (limited to 'tmk_core/common/action_tapping.c')
| -rw-r--r-- | tmk_core/common/action_tapping.c | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/tmk_core/common/action_tapping.c b/tmk_core/common/action_tapping.c index 6280c6c36f..8adf013e16 100644 --- a/tmk_core/common/action_tapping.c +++ b/tmk_core/common/action_tapping.c | |||
| @@ -36,6 +36,10 @@ static void debug_tapping_key(void); | |||
| 36 | static void debug_waiting_buffer(void); | 36 | static void debug_waiting_buffer(void); |
| 37 | 37 | ||
| 38 | 38 | ||
| 39 | /** \brief Action Tapping Process | ||
| 40 | * | ||
| 41 | * FIXME: Needs doc | ||
| 42 | */ | ||
| 39 | void action_tapping_process(keyrecord_t record) | 43 | void action_tapping_process(keyrecord_t record) |
| 40 | { | 44 | { |
| 41 | if (process_tapping(&record)) { | 45 | if (process_tapping(&record)) { |
| @@ -70,7 +74,7 @@ void action_tapping_process(keyrecord_t record) | |||
| 70 | } | 74 | } |
| 71 | 75 | ||
| 72 | 76 | ||
| 73 | /* Tapping | 77 | /** \brief Tapping |
| 74 | * | 78 | * |
| 75 | * Rule: Tap key is typed(pressed and released) within TAPPING_TERM. | 79 | * Rule: Tap key is typed(pressed and released) within TAPPING_TERM. |
| 76 | * (without interfering by typing other key) | 80 | * (without interfering by typing other key) |
| @@ -289,8 +293,9 @@ bool process_tapping(keyrecord_t *keyp) | |||
| 289 | } | 293 | } |
| 290 | 294 | ||
| 291 | 295 | ||
| 292 | /* | 296 | /** \brief Waiting buffer enq |
| 293 | * Waiting buffer | 297 | * |
| 298 | * FIXME: Needs docs | ||
| 294 | */ | 299 | */ |
| 295 | bool waiting_buffer_enq(keyrecord_t record) | 300 | bool waiting_buffer_enq(keyrecord_t record) |
| 296 | { | 301 | { |
| @@ -310,12 +315,20 @@ bool waiting_buffer_enq(keyrecord_t record) | |||
| 310 | return true; | 315 | return true; |
| 311 | } | 316 | } |
| 312 | 317 | ||
| 318 | /** \brief Waiting buffer clear | ||
| 319 | * | ||
| 320 | * FIXME: Needs docs | ||
| 321 | */ | ||
| 313 | void waiting_buffer_clear(void) | 322 | void waiting_buffer_clear(void) |
| 314 | { | 323 | { |
| 315 | waiting_buffer_head = 0; | 324 | waiting_buffer_head = 0; |
| 316 | waiting_buffer_tail = 0; | 325 | waiting_buffer_tail = 0; |
| 317 | } | 326 | } |
| 318 | 327 | ||
| 328 | /** \brief Waiting buffer typed | ||
| 329 | * | ||
| 330 | * FIXME: Needs docs | ||
| 331 | */ | ||
| 319 | bool waiting_buffer_typed(keyevent_t event) | 332 | bool waiting_buffer_typed(keyevent_t event) |
| 320 | { | 333 | { |
| 321 | for (uint8_t i = waiting_buffer_tail; i != waiting_buffer_head; i = (i + 1) % WAITING_BUFFER_SIZE) { | 334 | for (uint8_t i = waiting_buffer_tail; i != waiting_buffer_head; i = (i + 1) % WAITING_BUFFER_SIZE) { |
| @@ -326,6 +339,10 @@ bool waiting_buffer_typed(keyevent_t event) | |||
| 326 | return false; | 339 | return false; |
| 327 | } | 340 | } |
| 328 | 341 | ||
| 342 | /** \brief Waiting buffer has anykey pressed | ||
| 343 | * | ||
| 344 | * FIXME: Needs docs | ||
| 345 | */ | ||
| 329 | __attribute__((unused)) | 346 | __attribute__((unused)) |
| 330 | bool waiting_buffer_has_anykey_pressed(void) | 347 | bool waiting_buffer_has_anykey_pressed(void) |
| 331 | { | 348 | { |
| @@ -335,7 +352,10 @@ bool waiting_buffer_has_anykey_pressed(void) | |||
| 335 | return false; | 352 | return false; |
| 336 | } | 353 | } |
| 337 | 354 | ||
| 338 | /* scan buffer for tapping */ | 355 | /** \brief Scan buffer for tapping |
| 356 | * | ||
| 357 | * FIXME: Needs docs | ||
| 358 | */ | ||
| 339 | void waiting_buffer_scan_tap(void) | 359 | void waiting_buffer_scan_tap(void) |
| 340 | { | 360 | { |
| 341 | // tapping already is settled | 361 | // tapping already is settled |
| @@ -359,14 +379,19 @@ void waiting_buffer_scan_tap(void) | |||
| 359 | } | 379 | } |
| 360 | 380 | ||
| 361 | 381 | ||
| 362 | /* | 382 | /** \brief Tapping key debug print |
| 363 | * debug print | 383 | * |
| 384 | * FIXME: Needs docs | ||
| 364 | */ | 385 | */ |
| 365 | static void debug_tapping_key(void) | 386 | static void debug_tapping_key(void) |
| 366 | { | 387 | { |
| 367 | debug("TAPPING_KEY="); debug_record(tapping_key); debug("\n"); | 388 | debug("TAPPING_KEY="); debug_record(tapping_key); debug("\n"); |
| 368 | } | 389 | } |
| 369 | 390 | ||
| 391 | /** \brief Waiting buffer debug print | ||
| 392 | * | ||
| 393 | * FIXME: Needs docs | ||
| 394 | */ | ||
| 370 | static void debug_waiting_buffer(void) | 395 | static void debug_waiting_buffer(void) |
| 371 | { | 396 | { |
| 372 | debug("{ "); | 397 | debug("{ "); |
