Move debug options to runtime
This commit is contained in:
parent
90f769fb7d
commit
326c9de6d6
7 changed files with 37 additions and 14 deletions
|
@ -31,7 +31,10 @@ bool soft_serial_transaction(int sstd_index);
|
|||
#ifdef SERIAL_DEBUG
|
||||
# include <debug.h>
|
||||
# include <print.h>
|
||||
# define serial_dprintf(...) dprintf(__VA_ARGS__)
|
||||
# define serial_dprintf(fmt, ...) \
|
||||
do { \
|
||||
if (debug_config.serial) xprintf(fmt, ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
#else
|
||||
# define serial_dprintf(...) \
|
||||
do { \
|
||||
|
|
|
@ -317,7 +317,7 @@ void process_record_handler(keyrecord_t *record) {
|
|||
action_t action = store_or_get_action(record->event.pressed, record->event.key);
|
||||
#endif
|
||||
ac_dprintf("ACTION: ");
|
||||
debug_action(action);
|
||||
debug_action_fn(action);
|
||||
#ifndef NO_ACTION_LAYER
|
||||
ac_dprintf(" layer_state: ");
|
||||
layer_debug();
|
||||
|
@ -1215,7 +1215,7 @@ void debug_record(keyrecord_t record) {
|
|||
*
|
||||
* FIXME: Needs documentation.
|
||||
*/
|
||||
void debug_action(action_t action) {
|
||||
void debug_action_fn(action_t action) {
|
||||
switch (action.kind.id) {
|
||||
case ACT_LMODS:
|
||||
ac_dprintf("ACT_LMODS");
|
||||
|
|
|
@ -143,7 +143,10 @@ uint16_t get_record_keycode(keyrecord_t *record, bool update_layer_cache);
|
|||
#ifdef ACTION_DEBUG
|
||||
# include "debug.h"
|
||||
# include "print.h"
|
||||
# define ac_dprintf(...) dprintf(__VA_ARGS__)
|
||||
# define ac_dprintf(fmt, ...) \
|
||||
do { \
|
||||
if (debug_config.action) xprintf(fmt, ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
#else
|
||||
# define ac_dprintf(...) \
|
||||
do { \
|
||||
|
@ -153,7 +156,7 @@ uint16_t get_record_keycode(keyrecord_t *record, bool update_layer_cache);
|
|||
/* debug */
|
||||
void debug_event(keyevent_t event);
|
||||
void debug_record(keyrecord_t record);
|
||||
void debug_action(action_t action);
|
||||
void debug_action_fn(action_t action);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -17,9 +17,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "debug.h"
|
||||
|
||||
debug_config_t debug_config = {
|
||||
.enable = false, //
|
||||
.matrix = false, //
|
||||
.keyboard = false, //
|
||||
.mouse = false, //
|
||||
.reserved = 0 //
|
||||
.enable = false,
|
||||
.matrix = false,
|
||||
.keyboard = false,
|
||||
.mouse = false,
|
||||
.pointing = false,
|
||||
.action = false,
|
||||
.serial = false,
|
||||
.quantum_painter = false,
|
||||
};
|
||||
|
|
|
@ -34,7 +34,12 @@ typedef union {
|
|||
bool matrix : 1;
|
||||
bool keyboard : 1;
|
||||
bool mouse : 1;
|
||||
uint8_t reserved : 4;
|
||||
bool pointing :1;
|
||||
bool action : 1;
|
||||
bool serial: 1;
|
||||
bool quantum_painter : 1;
|
||||
// bool backing_store : 1;
|
||||
// bool wear_leveling : 1;
|
||||
};
|
||||
uint8_t raw;
|
||||
} debug_config_t;
|
||||
|
@ -50,7 +55,10 @@ extern debug_config_t debug_config;
|
|||
#define debug_matrix (debug_config.matrix)
|
||||
#define debug_keyboard (debug_config.keyboard)
|
||||
#define debug_mouse (debug_config.mouse)
|
||||
|
||||
#define debug_pointing (debug_config.pointing)
|
||||
#define debug_action (debug_config.action)
|
||||
#define debug_serial (debug_config.serial)
|
||||
#define debug_quantum_painter (debug_config.quantum_painter)
|
||||
/*
|
||||
* Debug print utils
|
||||
*/
|
||||
|
|
|
@ -19,7 +19,10 @@
|
|||
#ifdef QUANTUM_PAINTER_DEBUG
|
||||
# include <debug.h>
|
||||
# include <print.h>
|
||||
# define qp_dprintf(...) dprintf(__VA_ARGS__)
|
||||
# define qp_dprintf(fmt, ...) \
|
||||
do { \
|
||||
if (debug_config.quantum_painter) xprintf(fmt, ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
#else
|
||||
# define qp_dprintf(...) \
|
||||
do { \
|
||||
|
|
|
@ -6,7 +6,10 @@
|
|||
#ifdef POINTING_DEVICE_DEBUG
|
||||
# include "debug.h"
|
||||
# include "print.h"
|
||||
# define pd_dprintf(...) dprintf(__VA_ARGS__)
|
||||
# define pd_dprintf(fmt, ...) \
|
||||
do { \
|
||||
if (debug_config.pointing) xprintf(fmt, ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
#else
|
||||
# define pd_dprintf(...) \
|
||||
do { \
|
||||
|
|
Loading…
Add table
Reference in a new issue