summaryrefslogtreecommitdiffstats
path: root/keyboards/handwired/symmetric70_proto/debug_config.h
blob: cba99e402fa9370e60e4c8d8ae8a86ffe85e87a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
 * matrix.c testing macros
 *   MATRIX_DEBUG_SCAN:  Measuring execution time of `matrix_scan()`
 *   MATRIX_DEBUG_DELAY: Observation of delay after `unselect_row()`
 */
#pragma once
#ifndef __ASSEMBLER__
#include <gpio.h>

static inline void setDebugPinOutput_Low(void) {
    setPinOutput(MATRIX_DEBUG_PIN);
    writePinLow(MATRIX_DEBUG_PIN);
}

#define MATRIX_DEBUG_PIN_INIT()   setDebugPinOutput_Low()

#ifdef MATRIX_DEBUG_SCAN
#  define MATRIX_DEBUG_SCAN_START() writePinHigh(MATRIX_DEBUG_PIN)
#  define MATRIX_DEBUG_SCAN_END()   writePinLow(MATRIX_DEBUG_PIN)
#else
#  define MATRIX_DEBUG_SCAN_START()
#  define MATRIX_DEBUG_SCAN_END()
#endif

#ifdef MATRIX_DEBUG_DELAY
#  define MATRIX_DEBUG_DELAY_START() writePinHigh(MATRIX_DEBUG_PIN)
#  define MATRIX_DEBUG_DELAY_END()   writePinLow(MATRIX_DEBUG_PIN)
#else
#  define MATRIX_DEBUG_DELAY_START()
#  define MATRIX_DEBUG_DELAY_END()
#endif

#endif // __ASSEMBLER__