Update formatting
parent
a14c96f9ff
commit
29f5300b8a
|
|
@ -30,7 +30,7 @@ static void txend1(UARTDriver *uartp) {
|
||||||
* This callback is invoked when a transmission has physically completed.
|
* This callback is invoked when a transmission has physically completed.
|
||||||
*/
|
*/
|
||||||
static void txend2(UARTDriver *uartp) {
|
static void txend2(UARTDriver *uartp) {
|
||||||
(void)uartp;
|
(void)uartp;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -38,8 +38,8 @@ static void txend2(UARTDriver *uartp) {
|
||||||
* as parameter.
|
* as parameter.
|
||||||
*/
|
*/
|
||||||
static void rxerr(UARTDriver *uartp, uartflags_t e) {
|
static void rxerr(UARTDriver *uartp, uartflags_t e) {
|
||||||
(void)uartp;
|
(void)uartp;
|
||||||
(void)e;
|
(void)e;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -47,53 +47,53 @@ static void rxerr(UARTDriver *uartp, uartflags_t e) {
|
||||||
* was not ready to receive it, the character is passed as parameter.
|
* was not ready to receive it, the character is passed as parameter.
|
||||||
*/
|
*/
|
||||||
static void rxchar(UARTDriver *uartp, uint16_t c) {
|
static void rxchar(UARTDriver *uartp, uint16_t c) {
|
||||||
(void)uartp;
|
(void)uartp;
|
||||||
(void)c;
|
(void)c;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This callback is invoked when a receive buffer has been completely written.
|
* This callback is invoked when a receive buffer has been completely written.
|
||||||
*/
|
*/
|
||||||
static void rxend(UARTDriver *uartp) {
|
static void rxend(UARTDriver *uartp) {
|
||||||
(void)uartp;
|
(void)uartp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static UARTConfig uart_cfg = {
|
static UARTConfig uart_cfg = {
|
||||||
.txend1_cb = txend1,
|
.txend1_cb = txend1,
|
||||||
.txend2_cb = txend2,
|
.txend2_cb = txend2,
|
||||||
.rxend_cb = rxend,
|
.rxend_cb = rxend,
|
||||||
.rxchar_cb = rxchar,
|
.rxchar_cb = rxchar,
|
||||||
.rxerr_cb = rxerr,
|
.rxerr_cb = rxerr,
|
||||||
.speed = 38400,
|
.speed = 38400,
|
||||||
.cr1 = 0,
|
.cr1 = 0,
|
||||||
.cr2 = USART_CR2_LINEN,
|
.cr2 = USART_CR2_LINEN,
|
||||||
.cr3 = 0
|
.cr3 = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
if (!record->event.pressed) {
|
if (!record->event.pressed) {
|
||||||
// Send 'next theme' command to lighting controller
|
/* Send 'next theme' command to lighting controller */
|
||||||
uartStartSend(&UARTD3, 4, "\x09\x04\x05\x01\x00\x00");
|
uartStartSend(&UARTD3, 4, "\x09\x04\x05\x01\x00\x00");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void matrix_init_kb(void) {
|
void matrix_init_kb(void) {
|
||||||
// Turn on lighting controller
|
/* Turn on lighting controller */
|
||||||
setPinOutput(C15);
|
setPinOutput(C15);
|
||||||
writePinLow(C15);
|
writePinLow(C15);
|
||||||
chThdSleepMilliseconds(100);
|
chThdSleepMilliseconds(100);
|
||||||
writePinHigh(C15);
|
writePinHigh(C15);
|
||||||
chThdSleepMilliseconds(100);
|
chThdSleepMilliseconds(100);
|
||||||
|
|
||||||
// Initialize the lighting UART
|
/* Initialize the lighting UART */
|
||||||
uartStart(&UARTD3, &uart_cfg);
|
uartStart(&UARTD3, &uart_cfg);
|
||||||
palSetPadMode(GPIOB, 10, PAL_MODE_ALTERNATE(7));
|
palSetPadMode(GPIOB, 10, PAL_MODE_ALTERNATE(7));
|
||||||
palSetPadMode(GPIOB, 11, PAL_MODE_ALTERNATE(7));
|
palSetPadMode(GPIOB, 11, PAL_MODE_ALTERNATE(7));
|
||||||
|
|
||||||
// Send 'set theme' command to lighting controller
|
/* Send 'set theme' command to lighting controller */
|
||||||
uartStartSend(&UARTD3, 4, "\x09\x02\x01\x01");
|
uartStartSend(&UARTD3, 4, "\x09\x02\x01\x01");
|
||||||
|
|
||||||
matrix_init_user();
|
matrix_init_user();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "quantum.h"
|
#include "quantum.h"
|
||||||
|
|
||||||
/* The fully-featured LAYOUT_all() that has every single key available in the matrix.
|
/* The fully-featured LAYOUT() that has every single key available in the matrix.
|
||||||
*/
|
*/
|
||||||
#define LAYOUT(\
|
#define LAYOUT(\
|
||||||
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, \
|
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, \
|
||||||
|
|
|
||||||
|
|
@ -37,11 +37,6 @@
|
||||||
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||||
#define DEBOUNCE 6
|
#define DEBOUNCE 6
|
||||||
|
|
||||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
|
||||||
//#define LOCKING_SUPPORT_ENABLE
|
|
||||||
/* Locking resynchronize hack */
|
|
||||||
//#define LOCKING_RESYNC_ENABLE
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Force NKRO
|
* Force NKRO
|
||||||
*
|
*
|
||||||
|
|
@ -80,36 +75,3 @@
|
||||||
//#define NO_ACTION_ONESHOT
|
//#define NO_ACTION_ONESHOT
|
||||||
//#define NO_ACTION_MACRO
|
//#define NO_ACTION_MACRO
|
||||||
//#define NO_ACTION_FUNCTION
|
//#define NO_ACTION_FUNCTION
|
||||||
|
|
||||||
/*
|
|
||||||
* MIDI options
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Prevent use of disabled MIDI features in the keymap */
|
|
||||||
//#define MIDI_ENABLE_STRICT 1
|
|
||||||
|
|
||||||
/* enable basic MIDI features:
|
|
||||||
- MIDI notes can be sent when in Music mode is on
|
|
||||||
*/
|
|
||||||
//#define MIDI_BASIC
|
|
||||||
|
|
||||||
/* enable advanced MIDI features:
|
|
||||||
- MIDI notes can be added to the keymap
|
|
||||||
- Octave shift and transpose
|
|
||||||
- Virtual sustain, portamento, and modulation wheel
|
|
||||||
- etc.
|
|
||||||
*/
|
|
||||||
//#define MIDI_ADVANCED
|
|
||||||
|
|
||||||
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
|
|
||||||
//#define MIDI_TONE_KEYCODE_OCTAVES 1
|
|
||||||
|
|
||||||
// #define WS2812_LED_N 2
|
|
||||||
// #define RGBLED_NUM WS2812_LED_N
|
|
||||||
// #define WS2812_TIM_N 2
|
|
||||||
// #define WS2812_TIM_CH 2
|
|
||||||
// #define PORT_WS2812 GPIOA
|
|
||||||
// #define PIN_WS2812 1
|
|
||||||
// #define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA stream for TIMx_UP (look up in reference manual under DMA Channel selection)
|
|
||||||
//#define WS2812_DMA_CHANNEL 7 // DMA channel for TIMx_UP
|
|
||||||
//#define WS2812_EXTERNAL_PULLUP
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue