diff options
author | skullydazed <skullydazed@users.noreply.github.com> | 2018-03-21 23:50:38 -0700 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2018-03-22 02:50:38 -0400 |
commit | 7c9d5ace143d3cc6d767a354acde814926d566fd (patch) | |
tree | 1f2b581b6c9f6278a9e180bfcc8dd86b0a7fd2ef /tmk_core/common/action.c | |
parent | f0932a8716dc946322c5ebae7f75eaa275c6220c (diff) | |
download | qmk_firmware-7c9d5ace143d3cc6d767a354acde814926d566fd.tar.gz qmk_firmware-7c9d5ace143d3cc6d767a354acde814926d566fd.zip |
Generate API docs from source code comments (#2491)
* Generate api docs from source code
* Add a bunch of doxygen comments
* more doxygen comments
* Add the in-progress api docs
* script to generate docs from travis
* Add doc generation to the travis job
* make travis_docs.sh commit the work it does
* make sure the docs script exits cleanly
Diffstat (limited to 'tmk_core/common/action.c')
-rw-r--r-- | tmk_core/common/action.c | 63 |
1 files changed, 58 insertions, 5 deletions
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index 33d920554..fff834791 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c | |||
@@ -44,6 +44,10 @@ int retro_tapping_counter = 0; | |||
44 | #include <fauxclicky.h> | 44 | #include <fauxclicky.h> |
45 | #endif | 45 | #endif |
46 | 46 | ||
47 | /** \brief Called to execute an action. | ||
48 | * | ||
49 | * FIXME: Needs documentation. | ||
50 | */ | ||
47 | void action_exec(keyevent_t event) | 51 | void action_exec(keyevent_t event) |
48 | { | 52 | { |
49 | if (!IS_NOEVENT(event)) { | 53 | if (!IS_NOEVENT(event)) { |
@@ -95,6 +99,10 @@ void action_exec(keyevent_t event) | |||
95 | bool swap_hands = false; | 99 | bool swap_hands = false; |
96 | bool swap_held = false; | 100 | bool swap_held = false; |
97 | 101 | ||
102 | /** \brief Process Hand Swap | ||
103 | * | ||
104 | * FIXME: Needs documentation. | ||
105 | */ | ||
98 | void process_hand_swap(keyevent_t *event) { | 106 | void process_hand_swap(keyevent_t *event) { |
99 | static swap_state_row_t swap_state[MATRIX_ROWS]; | 107 | static swap_state_row_t swap_state[MATRIX_ROWS]; |
100 | 108 | ||
@@ -134,7 +142,10 @@ bool process_record_quantum(keyrecord_t *record) { | |||
134 | } | 142 | } |
135 | 143 | ||
136 | #ifndef NO_ACTION_TAPPING | 144 | #ifndef NO_ACTION_TAPPING |
137 | // Allows for handling tap-hold actions immediately instead of waiting for TAPPING_TERM or another keypress. | 145 | /** \brief Allows for handling tap-hold actions immediately instead of waiting for TAPPING_TERM or another keypress. |
146 | * | ||
147 | * FIXME: Needs documentation. | ||
148 | */ | ||
138 | void process_record_tap_hint(keyrecord_t *record) | 149 | void process_record_tap_hint(keyrecord_t *record) |
139 | { | 150 | { |
140 | action_t action = layer_switch_get_action(record->event.key); | 151 | action_t action = layer_switch_get_action(record->event.key); |
@@ -154,6 +165,10 @@ void process_record_tap_hint(keyrecord_t *record) | |||
154 | } | 165 | } |
155 | #endif | 166 | #endif |
156 | 167 | ||
168 | /** \brief Take a key event (key press or key release) and processes it. | ||
169 | * | ||
170 | * FIXME: Needs documentation. | ||
171 | */ | ||
157 | void process_record(keyrecord_t *record) | 172 | void process_record(keyrecord_t *record) |
158 | { | 173 | { |
159 | if (IS_NOEVENT(record->event)) { return; } | 174 | if (IS_NOEVENT(record->event)) { return; } |
@@ -172,6 +187,10 @@ void process_record(keyrecord_t *record) | |||
172 | process_action(record, action); | 187 | process_action(record, action); |
173 | } | 188 | } |
174 | 189 | ||
190 | /** \brief Take an action and processes it. | ||
191 | * | ||
192 | * FIXME: Needs documentation. | ||
193 | */ | ||
175 | void process_action(keyrecord_t *record, action_t action) | 194 | void process_action(keyrecord_t *record, action_t action) |
176 | { | 195 | { |
177 | keyevent_t event = record->event; | 196 | keyevent_t event = record->event; |
@@ -674,8 +693,9 @@ void process_action(keyrecord_t *record, action_t action) | |||
674 | 693 | ||
675 | 694 | ||
676 | 695 | ||
677 | /* | 696 | /** \brief Utilities for actions. (FIXME: Needs better description) |
678 | * Utilities for actions. | 697 | * |
698 | * FIXME: Needs documentation. | ||
679 | */ | 699 | */ |
680 | void register_code(uint8_t code) | 700 | void register_code(uint8_t code) |
681 | { | 701 | { |
@@ -755,6 +775,10 @@ void register_code(uint8_t code) | |||
755 | } | 775 | } |
756 | } | 776 | } |
757 | 777 | ||
778 | /** \brief Utilities for actions. (FIXME: Needs better description) | ||
779 | * | ||
780 | * FIXME: Needs documentation. | ||
781 | */ | ||
758 | void unregister_code(uint8_t code) | 782 | void unregister_code(uint8_t code) |
759 | { | 783 | { |
760 | if (code == KC_NO) { | 784 | if (code == KC_NO) { |
@@ -810,6 +834,10 @@ void unregister_code(uint8_t code) | |||
810 | } | 834 | } |
811 | } | 835 | } |
812 | 836 | ||
837 | /** \brief Utilities for actions. (FIXME: Needs better description) | ||
838 | * | ||
839 | * FIXME: Needs documentation. | ||
840 | */ | ||
813 | void register_mods(uint8_t mods) | 841 | void register_mods(uint8_t mods) |
814 | { | 842 | { |
815 | if (mods) { | 843 | if (mods) { |
@@ -818,6 +846,10 @@ void register_mods(uint8_t mods) | |||
818 | } | 846 | } |
819 | } | 847 | } |
820 | 848 | ||
849 | /** \brief Utilities for actions. (FIXME: Needs better description) | ||
850 | * | ||
851 | * FIXME: Needs documentation. | ||
852 | */ | ||
821 | void unregister_mods(uint8_t mods) | 853 | void unregister_mods(uint8_t mods) |
822 | { | 854 | { |
823 | if (mods) { | 855 | if (mods) { |
@@ -826,12 +858,20 @@ void unregister_mods(uint8_t mods) | |||
826 | } | 858 | } |
827 | } | 859 | } |
828 | 860 | ||
861 | /** \brief Utilities for actions. (FIXME: Needs better description) | ||
862 | * | ||
863 | * FIXME: Needs documentation. | ||
864 | */ | ||
829 | void clear_keyboard(void) | 865 | void clear_keyboard(void) |
830 | { | 866 | { |
831 | clear_mods(); | 867 | clear_mods(); |
832 | clear_keyboard_but_mods(); | 868 | clear_keyboard_but_mods(); |
833 | } | 869 | } |
834 | 870 | ||
871 | /** \brief Utilities for actions. (FIXME: Needs better description) | ||
872 | * | ||
873 | * FIXME: Needs documentation. | ||
874 | */ | ||
835 | void clear_keyboard_but_mods(void) | 875 | void clear_keyboard_but_mods(void) |
836 | { | 876 | { |
837 | clear_weak_mods(); | 877 | clear_weak_mods(); |
@@ -848,6 +888,10 @@ void clear_keyboard_but_mods(void) | |||
848 | #endif | 888 | #endif |
849 | } | 889 | } |
850 | 890 | ||
891 | /** \brief Utilities for actions. (FIXME: Needs better description) | ||
892 | * | ||
893 | * FIXME: Needs documentation. | ||
894 | */ | ||
851 | bool is_tap_key(keypos_t key) | 895 | bool is_tap_key(keypos_t key) |
852 | { | 896 | { |
853 | action_t action = layer_switch_get_action(key); | 897 | action_t action = layer_switch_get_action(key); |
@@ -880,14 +924,19 @@ bool is_tap_key(keypos_t key) | |||
880 | } | 924 | } |
881 | 925 | ||
882 | 926 | ||
883 | /* | 927 | /** \brief Debug print (FIXME: Needs better description) |
884 | * debug print | 928 | * |
929 | * FIXME: Needs documentation. | ||
885 | */ | 930 | */ |
886 | void debug_event(keyevent_t event) | 931 | void debug_event(keyevent_t event) |
887 | { | 932 | { |
888 | dprintf("%04X%c(%u)", (event.key.row<<8 | event.key.col), (event.pressed ? 'd' : 'u'), event.time); | 933 | dprintf("%04X%c(%u)", (event.key.row<<8 | event.key.col), (event.pressed ? 'd' : 'u'), event.time); |
889 | } | 934 | } |
890 | 935 | ||
936 | /** \brief Debug print (FIXME: Needs better description) | ||
937 | * | ||
938 | * FIXME: Needs documentation. | ||
939 | */ | ||
891 | void debug_record(keyrecord_t record) | 940 | void debug_record(keyrecord_t record) |
892 | { | 941 | { |
893 | debug_event(record.event); | 942 | debug_event(record.event); |
@@ -896,6 +945,10 @@ void debug_record(keyrecord_t record) | |||
896 | #endif | 945 | #endif |
897 | } | 946 | } |
898 | 947 | ||
948 | /** \brief Debug print (FIXME: Needs better description) | ||
949 | * | ||
950 | * FIXME: Needs documentation. | ||
951 | */ | ||
899 | void debug_action(action_t action) | 952 | void debug_action(action_t action) |
900 | { | 953 | { |
901 | switch (action.kind.id) { | 954 | switch (action.kind.id) { |