aboutsummaryrefslogtreecommitdiff
path: root/quantum/quantum.h
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/quantum.h')
-rw-r--r--quantum/quantum.h55
1 files changed, 7 insertions, 48 deletions
diff --git a/quantum/quantum.h b/quantum/quantum.h
index e24a4c43a..fe6bf310a 100644
--- a/quantum/quantum.h
+++ b/quantum/quantum.h
@@ -30,11 +30,11 @@
30#include "keymap.h" 30#include "keymap.h"
31 31
32#ifdef BACKLIGHT_ENABLE 32#ifdef BACKLIGHT_ENABLE
33# ifdef LED_MATRIX_ENABLE 33# include "backlight.h"
34# include "led_matrix.h" 34#endif
35# else 35
36# include "backlight.h" 36#ifdef LED_MATRIX_ENABLE
37# endif 37# include "led_matrix.h"
38#endif 38#endif
39 39
40#if defined(RGBLIGHT_ENABLE) 40#if defined(RGBLIGHT_ENABLE)
@@ -52,6 +52,7 @@
52#include "action_layer.h" 52#include "action_layer.h"
53#include "eeconfig.h" 53#include "eeconfig.h"
54#include "bootloader.h" 54#include "bootloader.h"
55#include "bootmagic.h"
55#include "timer.h" 56#include "timer.h"
56#include "sync_timer.h" 57#include "sync_timer.h"
57#include "config_common.h" 58#include "config_common.h"
@@ -97,7 +98,7 @@ extern layer_state_t layer_state;
97# include "process_music.h" 98# include "process_music.h"
98#endif 99#endif
99 100
100#ifdef BACKLIGHT_ENABLE 101#if defined(BACKLIGHT_ENABLE) || defined(LED_MATRIX_ENABLE)
101# include "process_backlight.h" 102# include "process_backlight.h"
102#endif 103#endif
103 104
@@ -199,39 +200,6 @@ extern layer_state_t layer_state;
199# include "usbpd.h" 200# include "usbpd.h"
200#endif 201#endif
201 202
202// Function substitutions to ease GPIO manipulation
203#if defined(__AVR__)
204
205/* The AVR series GPIOs have a one clock read delay for changes in the digital input signal.
206 * But here's more margin to make it two clocks. */
207# if !defined(GPIO_INPUT_PIN_DELAY)
208# define GPIO_INPUT_PIN_DELAY 2
209# endif
210# define waitInputPinDelay() wait_cpuclock(GPIO_INPUT_PIN_DELAY)
211
212#elif defined(__ARMEL__) || defined(__ARMEB__)
213
214/* For GPIOs on ARM-based MCUs, the input pins are sampled by the clock of the bus
215 * to which the GPIO is connected.
216 * The connected buses differ depending on the various series of MCUs.
217 * And since the instruction execution clock of the CPU and the bus clock of GPIO are different,
218 * there is a delay of several clocks to read the change of the input signal.
219 *
220 * Define this delay with the GPIO_INPUT_PIN_DELAY macro.
221 * If the GPIO_INPUT_PIN_DELAY macro is not defined, the following default values will be used.
222 * (A fairly large value of 0.25 microseconds is set.)
223 */
224# if !defined(GPIO_INPUT_PIN_DELAY)
225# if defined(STM32_SYSCLK)
226# define GPIO_INPUT_PIN_DELAY (STM32_SYSCLK / 1000000L / 4)
227# elif defined(KINETIS_SYSCLK_FREQUENCY)
228# define GPIO_INPUT_PIN_DELAY (KINETIS_SYSCLK_FREQUENCY / 1000000L / 4)
229# endif
230# endif
231# define waitInputPinDelay() wait_cpuclock(GPIO_INPUT_PIN_DELAY)
232
233#endif
234
235// For tri-layer 203// For tri-layer
236void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3); 204void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3);
237layer_state_t update_tri_layer_state(layer_state_t state, uint8_t layer1, uint8_t layer2, uint8_t layer3); 205layer_state_t update_tri_layer_state(layer_state_t state, uint8_t layer1, uint8_t layer2, uint8_t layer3);
@@ -256,15 +224,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record);
256void post_process_record_kb(uint16_t keycode, keyrecord_t *record); 224void post_process_record_kb(uint16_t keycode, keyrecord_t *record);
257void post_process_record_user(uint16_t keycode, keyrecord_t *record); 225void post_process_record_user(uint16_t keycode, keyrecord_t *record);
258 226
259#ifndef BOOTMAGIC_LITE_COLUMN
260# define BOOTMAGIC_LITE_COLUMN 0
261#endif
262#ifndef BOOTMAGIC_LITE_ROW
263# define BOOTMAGIC_LITE_ROW 0
264#endif
265
266void bootmagic_lite(void);
267
268void reset_keyboard(void); 227void reset_keyboard(void);
269 228
270void startup_user(void); 229void startup_user(void);