Skip to content

Commit

Permalink
Merge remote-tracking branch 'qmk/develop' into develop
Browse files Browse the repository at this point in the history
* qmk/develop:
  Tidy up LCD_ENABLE/visualizer references (qmk#14855)
  Relocate PS2 code (qmk#14895)
  Rename platform SRC variable (qmk#14894)
  Align PS/2 GPIO defines (qmk#14745)
  Fix type of Tap Dance max index variable (qmk#14887)
  Make the MAGIC_TOGGLE_GUI keycode work (qmk#14886)
  • Loading branch information
Carlos Cardoso committed Oct 21, 2021
2 parents c1d4d46 + 1816006 commit 2193c67
Show file tree
Hide file tree
Showing 43 changed files with 270 additions and 1,410 deletions.
8 changes: 4 additions & 4 deletions build_keyboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -435,15 +435,15 @@ ALL_CONFIGS := $(PROJECT_CONFIG) $(CONFIG_H)

OUTPUTS := $(KEYMAP_OUTPUT) $(KEYBOARD_OUTPUT)
$(KEYMAP_OUTPUT)_SRC := $(SRC)
$(KEYMAP_OUTPUT)_DEFS := $(OPT_DEFS) $(GFXDEFS) \
$(KEYMAP_OUTPUT)_DEFS := $(OPT_DEFS) \
-DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYBOARD_H=\"$(QMK_KEYBOARD_H)\" \
-DQMK_KEYMAP=\"$(KEYMAP)\" -DQMK_KEYMAP_H=\"$(KEYMAP).h\" -DQMK_KEYMAP_CONFIG_H=\"$(KEYMAP_PATH)/config.h\" \
-DQMK_SUBPROJECT -DQMK_SUBPROJECT_H -DQMK_SUBPROJECT_CONFIG_H
$(KEYMAP_OUTPUT)_INC := $(VPATH) $(EXTRAINCDIRS)
$(KEYMAP_OUTPUT)_CONFIG := $(CONFIG_H)
$(KEYBOARD_OUTPUT)_SRC := $(CHIBISRC) $(GFXSRC)
$(KEYBOARD_OUTPUT)_DEFS := $(PROJECT_DEFS) $(GFXDEFS)
$(KEYBOARD_OUTPUT)_INC := $(PROJECT_INC) $(GFXINC)
$(KEYBOARD_OUTPUT)_SRC := $(PLATFORM_SRC)
$(KEYBOARD_OUTPUT)_DEFS := $(PROJECT_DEFS)
$(KEYBOARD_OUTPUT)_INC := $(PROJECT_INC)
$(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG)

# Default target.
Expand Down
38 changes: 34 additions & 4 deletions common_features.mk
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,6 @@ ifneq ($(strip $(VARIABLE_TRACE)),no)
endif
endif

ifeq ($(strip $(LCD_ENABLE)), yes)
CIE1931_CURVE := yes
endif

VALID_BACKLIGHT_TYPES := pwm timer software custom

BACKLIGHT_ENABLE ?= no
Expand Down Expand Up @@ -576,6 +572,40 @@ ifeq ($(strip $(AUTO_SHIFT_ENABLE)), yes)
endif
endif

ifeq ($(strip $(PS2_MOUSE_ENABLE)), yes)
PS2_ENABLE := yes
SRC += ps2_mouse.c
OPT_DEFS += -DPS2_MOUSE_ENABLE
OPT_DEFS += -DMOUSE_ENABLE
endif

ifeq ($(strip $(PS2_USE_BUSYWAIT)), yes)
PS2_ENABLE := yes
SRC += ps2_busywait.c
SRC += ps2_io_avr.c
OPT_DEFS += -DPS2_USE_BUSYWAIT
endif

ifeq ($(strip $(PS2_USE_INT)), yes)
PS2_ENABLE := yes
SRC += ps2_interrupt.c
SRC += ps2_io.c
OPT_DEFS += -DPS2_USE_INT
endif

ifeq ($(strip $(PS2_USE_USART)), yes)
PS2_ENABLE := yes
SRC += ps2_usart.c
SRC += ps2_io.c
OPT_DEFS += -DPS2_USE_USART
endif

ifeq ($(strip $(PS2_ENABLE)), yes)
COMMON_VPATH += $(DRIVER_PATH)/ps2
COMMON_VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/ps2
OPT_DEFS += -DPS2_ENABLE
endif

JOYSTICK_ENABLE ?= no
VALID_JOYSTICK_TYPES := analog digital
JOYSTICK_DRIVER ?= analog
Expand Down
34 changes: 8 additions & 26 deletions docs/feature_ps2_mouse.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,8 @@ In your keyboard config.h:

```c
#ifdef PS2_USE_BUSYWAIT
# define PS2_CLOCK_PORT PORTD
# define PS2_CLOCK_PIN PIND
# define PS2_CLOCK_DDR DDRD
# define PS2_CLOCK_BIT 1
# define PS2_DATA_PORT PORTD
# define PS2_DATA_PIN PIND
# define PS2_DATA_DDR DDRD
# define PS2_DATA_BIT 2
# define PS2_CLOCK_PIN D1
# define PS2_DATA_PIN D2
#endif
```

Expand All @@ -65,14 +59,8 @@ In your keyboard config.h:

```c
#ifdef PS2_USE_INT
#define PS2_CLOCK_PORT PORTD
#define PS2_CLOCK_PIN PIND
#define PS2_CLOCK_DDR DDRD
#define PS2_CLOCK_BIT 2
#define PS2_DATA_PORT PORTD
#define PS2_DATA_PIN PIND
#define PS2_DATA_DDR DDRD
#define PS2_DATA_BIT 5
#define PS2_CLOCK_PIN D2
#define PS2_DATA_PIN D5

#define PS2_INT_INIT() do { \
EICRA |= ((1<<ISC21) | \
Expand Down Expand Up @@ -102,8 +90,8 @@ PS2_USE_INT = yes
In your keyboard config.h:

```c
#define PS2_CLOCK A8
#define PS2_DATA A9
#define PS2_CLOCK_PIN A8
#define PS2_DATA_PIN A9
```
And in the chibios specifig halconf.h:
Expand All @@ -127,14 +115,8 @@ In your keyboard config.h:

```c
#ifdef PS2_USE_USART
#define PS2_CLOCK_PORT PORTD
#define PS2_CLOCK_PIN PIND
#define PS2_CLOCK_DDR DDRD
#define PS2_CLOCK_BIT 5
#define PS2_DATA_PORT PORTD
#define PS2_DATA_PIN PIND
#define PS2_DATA_DDR DDRD
#define PS2_DATA_BIT 2
#define PS2_CLOCK_PIN D5
#define PS2_DATA_PIN D2

/* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */
/* set DDR of CLOCK as input to be slave */
Expand Down
31 changes: 7 additions & 24 deletions docs/ja/feature_ps2_mouse.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,8 @@ PS2_USE_BUSYWAIT = yes

```c
#ifdef PS2_USE_BUSYWAIT
# define PS2_CLOCK_PORT PORTD
# define PS2_CLOCK_PIN PIND
# define PS2_CLOCK_DDR DDRD
# define PS2_CLOCK_BIT 1
# define PS2_DATA_PORT PORTD
# define PS2_DATA_PIN PIND
# define PS2_DATA_DDR DDRD
# define PS2_DATA_BIT 2
# define PS2_CLOCK_PIN D1
# define PS2_DATA_PIN D2
#endif
```

Expand All @@ -69,14 +63,8 @@ PS2_USE_INT = yes

```c
#ifdef PS2_USE_INT
#define PS2_CLOCK_PORT PORTD
#define PS2_CLOCK_PIN PIND
#define PS2_CLOCK_DDR DDRD
#define PS2_CLOCK_BIT 2
#define PS2_DATA_PORT PORTD
#define PS2_DATA_PIN PIND
#define PS2_DATA_DDR DDRD
#define PS2_DATA_BIT 5
#define PS2_CLOCK_PIN D2
#define PS2_DATA_PIN D5

#define PS2_INT_INIT() do { \
EICRA |= ((1<<ISC21) | \
Expand Down Expand Up @@ -107,14 +95,9 @@ PS2_USE_USART = yes

```c
#ifdef PS2_USE_USART
#define PS2_CLOCK_PORT PORTD
#define PS2_CLOCK_PIN PIND
#define PS2_CLOCK_DDR DDRD
#define PS2_CLOCK_BIT 5
#define PS2_DATA_PORT PORTD
#define PS2_DATA_PIN PIND
#define PS2_DATA_DDR DDRD
#define PS2_DATA_BIT 2
#ifdef PS2_USE_USART
#define PS2_CLOCK_PIN D5
#define PS2_DATA_PIN D2

/* 同期、奇数パリティ、1-bit ストップ、8-bit データ、立ち下がりエッジでサンプル */
/* CLOCK の DDR を入力としてスレーブに設定 */
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,17 @@ static inline void pbuf_clear(void);
void ps2_interrupt_service_routine(void);
void palCallback(void *arg) { ps2_interrupt_service_routine(); }

# define PS2_INT_INIT() \
{ palSetLineMode(PS2_CLOCK, PAL_MODE_INPUT); } \
# define PS2_INT_INIT() \
{ palSetLineMode(PS2_CLOCK_PIN, PAL_MODE_INPUT); } \
while (0)
# define PS2_INT_ON() \
{ \
palEnableLineEvent(PS2_CLOCK, PAL_EVENT_MODE_FALLING_EDGE); \
palSetLineCallback(PS2_CLOCK, palCallback, NULL); \
} \
# define PS2_INT_ON() \
{ \
palEnableLineEvent(PS2_CLOCK_PIN, PAL_EVENT_MODE_FALLING_EDGE); \
palSetLineCallback(PS2_CLOCK_PIN, palCallback, NULL); \
} \
while (0)
# define PS2_INT_OFF() \
{ palDisableLineEvent(PS2_CLOCK); } \
# define PS2_INT_OFF() \
{ palDisableLineEvent(PS2_CLOCK_PIN); } \
while (0)
#endif // PROTOCOL_CHIBIOS

Expand Down
File renamed without changes.
10 changes: 3 additions & 7 deletions tmk_core/protocol/ps2_mouse.c → drivers/ps2/ps2_mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <stdbool.h>

#if defined(__AVR__)
# include <avr/io.h>
#endif

#include "ps2_mouse.h"
#include "wait.h"
#include "gpio.h"
#include "host.h"
#include "timer.h"
#include "print.h"
Expand Down Expand Up @@ -158,8 +154,8 @@ static inline void ps2_mouse_convert_report_to_hid(report_mouse_t *mouse_report)

#ifdef PS2_MOUSE_INVERT_BUTTONS
// swap left & right buttons
uint8_t needs_left = mouse_report->buttons & PS2_MOUSE_BTN_RIGHT;
uint8_t needs_right = mouse_report->buttons & PS2_MOUSE_BTN_LEFT;
uint8_t needs_left = mouse_report->buttons & PS2_MOUSE_BTN_RIGHT;
uint8_t needs_right = mouse_report->buttons & PS2_MOUSE_BTN_LEFT;
mouse_report->buttons = (mouse_report->buttons & ~(PS2_MOUSE_BTN_MASK)) | (needs_left ? PS2_MOUSE_BTN_LEFT : 0) | (needs_right ? PS2_MOUSE_BTN_RIGHT : 0);
#else
// remove sign and overflow flags
Expand Down
File renamed without changes.
33 changes: 6 additions & 27 deletions keyboards/converter/ibm_terminal/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef PS2_USE_USART
/* XCK for clock line */
#define PS2_CLOCK_PORT PORTD
#define PS2_CLOCK_PIN PIND
#define PS2_CLOCK_DDR DDRD
#define PS2_CLOCK_BIT 5
/* RXD for data line */
#define PS2_DATA_PORT PORTD
#define PS2_DATA_PIN PIND
#define PS2_DATA_DDR DDRD
#define PS2_DATA_BIT 2
#define PS2_CLOCK_PIN D5
#define PS2_DATA_PIN D2

/* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */
/* set DDR of CLOCK as input to be slave */
Expand Down Expand Up @@ -93,15 +86,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef PS2_USE_INT
/* uses INT1 for clock line(ATMega32U4) */
#define PS2_CLOCK_PORT PORTD
#define PS2_CLOCK_PIN PIND
#define PS2_CLOCK_DDR DDRD
#define PS2_CLOCK_BIT 1

#define PS2_DATA_PORT PORTD
#define PS2_DATA_PIN PIND
#define PS2_DATA_DDR DDRD
#define PS2_DATA_BIT 0
#define PS2_CLOCK_PIN D1
#define PS2_DATA_PIN D0

#define PS2_INT_INIT() do { \
EICRA |= ((1<<ISC11) | \
Expand All @@ -121,13 +107,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* PS/2 Busywait configuration
*/
#ifdef PS2_USE_BUSYWAIT
#define PS2_CLOCK_PORT PORTD
#define PS2_CLOCK_PIN PIND
#define PS2_CLOCK_DDR DDRD
#define PS2_CLOCK_BIT 1

#define PS2_DATA_PORT PORTD
#define PS2_DATA_PIN PIND
#define PS2_DATA_DDR DDRD
#define PS2_DATA_BIT 0
#define PS2_CLOCK_PIN D1
#define PS2_DATA_PIN D0
#endif
2 changes: 0 additions & 2 deletions keyboards/ergodox_infinity/keymaps/dudeofawesome/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@
#include "../../config.h"
#include "dudeofawesome.h"

#include "./visualizer.h"

#endif
4 changes: 2 additions & 2 deletions keyboards/ergodox_infinity/keymaps/dudeofawesome/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};

void matrix_init_user() {
backlight_enable();
backlight_level(BACKLIGHT_LEVELS);
led_matrix_enable_noeeprom();
led_matrix_set_val_noeeprom(UINT8_MAX);
}

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
Expand Down
Loading

0 comments on commit 2193c67

Please sign in to comment.