diff options
| author | tmk <nobody@nowhere> | 2013-05-14 16:18:22 +0900 |
|---|---|---|
| committer | tmk <nobody@nowhere> | 2013-05-14 16:19:40 +0900 |
| commit | ff2d276b193632136c785d92ed01df48aea8461f (patch) | |
| tree | bd8e7c789fbb7f191b4de31498160f05d2f80229 /common/action_layer.c | |
| parent | d9c06db60006e2191d8b86e34f651644a54426b4 (diff) | |
| download | qmk_firmware-ff2d276b193632136c785d92ed01df48aea8461f.tar.gz qmk_firmware-ff2d276b193632136c785d92ed01df48aea8461f.zip | |
Use dprint and dprintf for debug
Diffstat (limited to 'common/action_layer.c')
| -rw-r--r-- | common/action_layer.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/common/action_layer.c b/common/action_layer.c index 3413c53e6..d24aa2e19 100644 --- a/common/action_layer.c +++ b/common/action_layer.c | |||
| @@ -1,10 +1,15 @@ | |||
| 1 | #include <stdint.h> | 1 | #include <stdint.h> |
| 2 | #include "keyboard.h" | 2 | #include "keyboard.h" |
| 3 | #include "action.h" | 3 | #include "action.h" |
| 4 | #include "debug.h" | ||
| 5 | #include "util.h" | 4 | #include "util.h" |
| 6 | #include "action_layer.h" | 5 | #include "action_layer.h" |
| 7 | 6 | ||
| 7 | #ifdef DEBUG_ACTION | ||
| 8 | #include "debug.h" | ||
| 9 | #else | ||
| 10 | #include "nodebug.h" | ||
| 11 | #endif | ||
| 12 | |||
| 8 | 13 | ||
| 9 | /* | 14 | /* |
| 10 | * Default Layer State | 15 | * Default Layer State |
| @@ -22,8 +27,7 @@ static void default_layer_state_set(uint32_t state) | |||
| 22 | 27 | ||
| 23 | void default_layer_debug(void) | 28 | void default_layer_debug(void) |
| 24 | { | 29 | { |
| 25 | debug_hex32(default_layer_state); | 30 | dprintf("%08lX(%u)", default_layer_state, biton32(default_layer_state)); |
| 26 | debug("("); debug_dec(biton32(default_layer_state)); debug(")"); | ||
| 27 | } | 31 | } |
| 28 | 32 | ||
| 29 | void default_layer_set(uint8_t layer) | 33 | void default_layer_set(uint8_t layer) |
| @@ -55,10 +59,10 @@ uint32_t layer_state = 0; | |||
| 55 | 59 | ||
| 56 | static void layer_state_set(uint32_t state) | 60 | static void layer_state_set(uint32_t state) |
| 57 | { | 61 | { |
| 58 | debug("layer_state: "); | 62 | dprint("layer_state: "); |
| 59 | layer_debug(); debug(" to "); | 63 | layer_debug(); dprint(" to "); |
| 60 | layer_state = state; | 64 | layer_state = state; |
| 61 | layer_debug(); debug("\n"); | 65 | layer_debug(); dprintln(); |
| 62 | clear_keyboard_but_mods(); // To avoid stuck keys | 66 | clear_keyboard_but_mods(); // To avoid stuck keys |
| 63 | } | 67 | } |
| 64 | 68 | ||
| @@ -102,8 +106,7 @@ void layer_xor(uint32_t state) | |||
| 102 | 106 | ||
| 103 | void layer_debug(void) | 107 | void layer_debug(void) |
| 104 | { | 108 | { |
| 105 | debug_hex32(layer_state); | 109 | dprintf("%08lX(%u)", layer_state, biton32(layer_state)); |
| 106 | debug("("); debug_dec(biton32(layer_state)); debug(")"); | ||
| 107 | } | 110 | } |
| 108 | #endif | 111 | #endif |
| 109 | 112 | ||
