mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-07-16 12:51:47 +00:00
Merge remote-tracking branch 'origin/develop' into xap
This commit is contained in:
commit
ef9c3810c1
@ -120,6 +120,7 @@
|
|||||||
"MATRIX_HAS_GHOST": {"info_key": "matrix_pins.ghost", "value_type": "flag"},
|
"MATRIX_HAS_GHOST": {"info_key": "matrix_pins.ghost", "value_type": "flag"},
|
||||||
"MATRIX_INPUT_PRESSED_STATE": {"info_key": "matrix_pins.input_pressed_state", "value_type": "int"},
|
"MATRIX_INPUT_PRESSED_STATE": {"info_key": "matrix_pins.input_pressed_state", "value_type": "int"},
|
||||||
"MATRIX_IO_DELAY": {"info_key": "matrix_pins.io_delay", "value_type": "int"},
|
"MATRIX_IO_DELAY": {"info_key": "matrix_pins.io_delay", "value_type": "int"},
|
||||||
|
"MATRIX_MASKED": {"info_key": "matrix_pins.masked", "value_type": "flag"},
|
||||||
|
|
||||||
// Mouse Keys
|
// Mouse Keys
|
||||||
"MOUSEKEY_DELAY": {"info_key": "mousekey.delay", "value_type": "int"},
|
"MOUSEKEY_DELAY": {"info_key": "mousekey.delay", "value_type": "int"},
|
||||||
|
@ -473,6 +473,7 @@
|
|||||||
"ghost": {"type": "boolean"},
|
"ghost": {"type": "boolean"},
|
||||||
"input_pressed_state": {"$ref": "./definitions.jsonschema#/unsigned_int"},
|
"input_pressed_state": {"$ref": "./definitions.jsonschema#/unsigned_int"},
|
||||||
"io_delay": {"$ref": "./definitions.jsonschema#/unsigned_int"},
|
"io_delay": {"$ref": "./definitions.jsonschema#/unsigned_int"},
|
||||||
|
"masked": {"type": "boolean"},
|
||||||
"direct": {
|
"direct": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {"$ref": "./definitions.jsonschema#/mcu_pin_array"}
|
"items": {"$ref": "./definitions.jsonschema#/mcu_pin_array"}
|
||||||
|
@ -480,6 +480,9 @@ Configures the [LED Matrix](features/led_matrix) feature.
|
|||||||
* `io_delay` <Badge type="info">Number</Badge>
|
* `io_delay` <Badge type="info">Number</Badge>
|
||||||
* The amount of time to wait between row/col selection and col/row pin reading, in microseconds.
|
* The amount of time to wait between row/col selection and col/row pin reading, in microseconds.
|
||||||
* Default: `30` (30 µs)
|
* Default: `30` (30 µs)
|
||||||
|
* `masked` <Badge type="info">Boolean</Badge>
|
||||||
|
* Whether configured intersections should be ignored.
|
||||||
|
* Default: `false`
|
||||||
* `rows` <Badge type="info">Array: Pin</Badge>
|
* `rows` <Badge type="info">Array: Pin</Badge>
|
||||||
* A list of GPIO pins connected to the matrix rows.
|
* A list of GPIO pins connected to the matrix rows.
|
||||||
* Example: `["B0", "B1", "B2"]`
|
* Example: `["B0", "B1", "B2"]`
|
||||||
|
@ -72,19 +72,6 @@ def generate_matrix_size(kb_info_json, config_h_lines):
|
|||||||
config_h_lines.append(generate_define('MATRIX_ROWS', kb_info_json['matrix_size']['rows']))
|
config_h_lines.append(generate_define('MATRIX_ROWS', kb_info_json['matrix_size']['rows']))
|
||||||
|
|
||||||
|
|
||||||
def generate_matrix_masked(kb_info_json, config_h_lines):
|
|
||||||
""""Enable matrix mask if required"""
|
|
||||||
mask_required = False
|
|
||||||
|
|
||||||
if 'matrix_grid' in kb_info_json.get('dip_switch', {}):
|
|
||||||
mask_required = True
|
|
||||||
if 'matrix_grid' in kb_info_json.get('split', {}).get('handedness', {}):
|
|
||||||
mask_required = True
|
|
||||||
|
|
||||||
if mask_required:
|
|
||||||
config_h_lines.append(generate_define('MATRIX_MASKED'))
|
|
||||||
|
|
||||||
|
|
||||||
def generate_config_items(kb_info_json, config_h_lines):
|
def generate_config_items(kb_info_json, config_h_lines):
|
||||||
"""Iterate through the info_config map to generate basic config values.
|
"""Iterate through the info_config map to generate basic config values.
|
||||||
"""
|
"""
|
||||||
@ -202,8 +189,6 @@ def generate_config_h(cli):
|
|||||||
|
|
||||||
generate_matrix_size(kb_info_json, config_h_lines)
|
generate_matrix_size(kb_info_json, config_h_lines)
|
||||||
|
|
||||||
generate_matrix_masked(kb_info_json, config_h_lines)
|
|
||||||
|
|
||||||
if 'matrix_pins' in kb_info_json:
|
if 'matrix_pins' in kb_info_json:
|
||||||
config_h_lines.append(matrix_pins(kb_info_json['matrix_pins']))
|
config_h_lines.append(matrix_pins(kb_info_json['matrix_pins']))
|
||||||
|
|
||||||
|
@ -254,6 +254,7 @@ def info_json(keyboard, force_layout=None):
|
|||||||
# Ensure that we have various calculated values
|
# Ensure that we have various calculated values
|
||||||
info_data = _matrix_size(info_data)
|
info_data = _matrix_size(info_data)
|
||||||
info_data = _joystick_axis_count(info_data)
|
info_data = _joystick_axis_count(info_data)
|
||||||
|
info_data = _matrix_masked(info_data)
|
||||||
|
|
||||||
# Merge in data from <keyboard.c>
|
# Merge in data from <keyboard.c>
|
||||||
info_data = _extract_led_config(info_data, str(keyboard))
|
info_data = _extract_led_config(info_data, str(keyboard))
|
||||||
@ -830,6 +831,25 @@ def _joystick_axis_count(info_data):
|
|||||||
return info_data
|
return info_data
|
||||||
|
|
||||||
|
|
||||||
|
def _matrix_masked(info_data):
|
||||||
|
""""Add info_data['matrix_pins.masked'] if required"""
|
||||||
|
mask_required = False
|
||||||
|
|
||||||
|
if 'matrix_grid' in info_data.get('dip_switch', {}):
|
||||||
|
mask_required = True
|
||||||
|
if 'matrix_grid' in info_data.get('split', {}).get('handedness', {}):
|
||||||
|
mask_required = True
|
||||||
|
|
||||||
|
if mask_required:
|
||||||
|
if 'masked' not in info_data.get('matrix_pins', {}):
|
||||||
|
if 'matrix_pins' not in info_data:
|
||||||
|
info_data['matrix_pins'] = {}
|
||||||
|
|
||||||
|
info_data['matrix_pins']['masked'] = True
|
||||||
|
|
||||||
|
return info_data
|
||||||
|
|
||||||
|
|
||||||
def _check_matrix(info_data):
|
def _check_matrix(info_data):
|
||||||
"""Check the matrix to ensure that row/column count is consistent.
|
"""Check the matrix to ensure that row/column count is consistent.
|
||||||
"""
|
"""
|
||||||
|
@ -28,7 +28,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#include "action_layer.h"
|
#include "action_layer.h"
|
||||||
#include "action_util.h"
|
#include "action_util.h"
|
||||||
#include "eeconfig.h"
|
#include "eeconfig.h"
|
||||||
#include "sleep_led.h"
|
|
||||||
#include "led.h"
|
#include "led.h"
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "quantum.h"
|
#include "quantum.h"
|
||||||
@ -39,6 +38,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
# include "backlight.h"
|
# include "backlight.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef SLEEP_LED_ENABLE
|
||||||
|
# include "sleep_led.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(MOUSEKEY_ENABLE)
|
#if defined(MOUSEKEY_ENABLE)
|
||||||
# include "mousekey.h"
|
# include "mousekey.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -17,6 +17,10 @@
|
|||||||
#include "quantum.h"
|
#include "quantum.h"
|
||||||
#include "process_quantum.h"
|
#include "process_quantum.h"
|
||||||
|
|
||||||
|
#ifdef SLEEP_LED_ENABLE
|
||||||
|
# include "sleep_led.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef BACKLIGHT_ENABLE
|
#ifdef BACKLIGHT_ENABLE
|
||||||
# include "process_backlight.h"
|
# include "process_backlight.h"
|
||||||
#endif
|
#endif
|
||||||
@ -487,6 +491,10 @@ void suspend_power_down_quantum(void) {
|
|||||||
backlight_level_noeeprom(0);
|
backlight_level_noeeprom(0);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# ifdef SLEEP_LED_ENABLE
|
||||||
|
sleep_led_enable();
|
||||||
|
# endif
|
||||||
|
|
||||||
# ifdef LED_MATRIX_ENABLE
|
# ifdef LED_MATRIX_ENABLE
|
||||||
led_matrix_task();
|
led_matrix_task();
|
||||||
# endif
|
# endif
|
||||||
@ -533,6 +541,10 @@ __attribute__((weak)) void suspend_wakeup_init_quantum(void) {
|
|||||||
backlight_init();
|
backlight_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef SLEEP_LED_ENABLE
|
||||||
|
sleep_led_disable();
|
||||||
|
#endif
|
||||||
|
|
||||||
// Restore LED indicators
|
// Restore LED indicators
|
||||||
led_wakeup();
|
led_wakeup();
|
||||||
|
|
||||||
|
@ -40,9 +40,6 @@
|
|||||||
# define EARLY_INIT_PERFORM_BOOTLOADER_JUMP FALSE
|
# define EARLY_INIT_PERFORM_BOOTLOADER_JUMP FALSE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SLEEP_LED_ENABLE
|
|
||||||
# include "sleep_led.h"
|
|
||||||
#endif
|
|
||||||
#ifdef MIDI_ENABLE
|
#ifdef MIDI_ENABLE
|
||||||
# include "qmk_midi.h"
|
# include "qmk_midi.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -21,10 +21,6 @@
|
|||||||
#include "host.h"
|
#include "host.h"
|
||||||
#include "suspend.h"
|
#include "suspend.h"
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
#ifdef SLEEP_LED_ENABLE
|
|
||||||
# include "sleep_led.h"
|
|
||||||
# include "led.h"
|
|
||||||
#endif
|
|
||||||
#include "wait.h"
|
#include "wait.h"
|
||||||
#include "usb_endpoints.h"
|
#include "usb_endpoints.h"
|
||||||
#include "usb_device_state.h"
|
#include "usb_device_state.h"
|
||||||
@ -135,19 +131,11 @@ static inline bool usb_event_queue_dequeue(usbevent_t *event) {
|
|||||||
|
|
||||||
static inline void usb_event_suspend_handler(void) {
|
static inline void usb_event_suspend_handler(void) {
|
||||||
usb_device_state_set_suspend(USB_DRIVER.configuration != 0, USB_DRIVER.configuration);
|
usb_device_state_set_suspend(USB_DRIVER.configuration != 0, USB_DRIVER.configuration);
|
||||||
#ifdef SLEEP_LED_ENABLE
|
|
||||||
sleep_led_enable();
|
|
||||||
#endif /* SLEEP_LED_ENABLE */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void usb_event_wakeup_handler(void) {
|
static inline void usb_event_wakeup_handler(void) {
|
||||||
suspend_wakeup_init();
|
suspend_wakeup_init();
|
||||||
usb_device_state_set_resume(USB_DRIVER.configuration != 0, USB_DRIVER.configuration);
|
usb_device_state_set_resume(USB_DRIVER.configuration != 0, USB_DRIVER.configuration);
|
||||||
#ifdef SLEEP_LED_ENABLE
|
|
||||||
sleep_led_disable();
|
|
||||||
// NOTE: converters may not accept this
|
|
||||||
led_set(host_keyboard_leds());
|
|
||||||
#endif /* SLEEP_LED_ENABLE */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool last_suspend_state = false;
|
bool last_suspend_state = false;
|
||||||
|
@ -44,9 +44,6 @@
|
|||||||
#include "led.h"
|
#include "led.h"
|
||||||
#include "sendchar.h"
|
#include "sendchar.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#ifdef SLEEP_LED_ENABLE
|
|
||||||
# include "sleep_led.h"
|
|
||||||
#endif
|
|
||||||
#include "suspend.h"
|
#include "suspend.h"
|
||||||
#include "wait.h"
|
#include "wait.h"
|
||||||
|
|
||||||
@ -381,10 +378,6 @@ void EVENT_USB_Device_Reset(void) {
|
|||||||
void EVENT_USB_Device_Suspend(void) {
|
void EVENT_USB_Device_Suspend(void) {
|
||||||
print("[S]");
|
print("[S]");
|
||||||
usb_device_state_set_suspend(USB_Device_ConfigurationNumber != 0, USB_Device_ConfigurationNumber);
|
usb_device_state_set_suspend(USB_Device_ConfigurationNumber != 0, USB_Device_ConfigurationNumber);
|
||||||
|
|
||||||
#ifdef SLEEP_LED_ENABLE
|
|
||||||
sleep_led_enable();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \brief Event USB Device Connect
|
/** \brief Event USB Device Connect
|
||||||
@ -398,12 +391,6 @@ void EVENT_USB_Device_WakeUp(void) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
usb_device_state_set_resume(USB_DeviceState == DEVICE_STATE_Configured, USB_Device_ConfigurationNumber);
|
usb_device_state_set_resume(USB_DeviceState == DEVICE_STATE_Configured, USB_Device_ConfigurationNumber);
|
||||||
|
|
||||||
#ifdef SLEEP_LED_ENABLE
|
|
||||||
sleep_led_disable();
|
|
||||||
// NOTE: converters may not accept this
|
|
||||||
led_set(host_keyboard_leds());
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONSOLE_ENABLE
|
#ifdef CONSOLE_ENABLE
|
||||||
|
@ -27,10 +27,6 @@
|
|||||||
#include "wait.h"
|
#include "wait.h"
|
||||||
#include "sendchar.h"
|
#include "sendchar.h"
|
||||||
|
|
||||||
#ifdef SLEEP_LED_ENABLE
|
|
||||||
# include "sleep_led.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* This is from main.c of USBaspLoader */
|
/* This is from main.c of USBaspLoader */
|
||||||
static void initForUsbConnectivity(void) {
|
static void initForUsbConnectivity(void) {
|
||||||
uint8_t i = 0;
|
uint8_t i = 0;
|
||||||
@ -64,22 +60,6 @@ static inline void vusb_send_remote_wakeup(void) {
|
|||||||
|
|
||||||
bool vusb_suspended = false;
|
bool vusb_suspended = false;
|
||||||
|
|
||||||
static inline void vusb_suspend(void) {
|
|
||||||
#ifdef SLEEP_LED_ENABLE
|
|
||||||
sleep_led_enable();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
suspend_power_down();
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void vusb_wakeup(void) {
|
|
||||||
suspend_wakeup_init();
|
|
||||||
|
|
||||||
#ifdef SLEEP_LED_ENABLE
|
|
||||||
sleep_led_disable();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
/** \brief Setup USB
|
/** \brief Setup USB
|
||||||
*
|
*
|
||||||
* FIXME: Needs doc
|
* FIXME: Needs doc
|
||||||
@ -133,7 +113,7 @@ void protocol_pre_task(void) {
|
|||||||
if (should_do_suspend()) {
|
if (should_do_suspend()) {
|
||||||
dprintln("suspending keyboard");
|
dprintln("suspending keyboard");
|
||||||
while (should_do_suspend()) {
|
while (should_do_suspend()) {
|
||||||
vusb_suspend();
|
suspend_power_down();
|
||||||
if (suspend_wakeup_condition()) {
|
if (suspend_wakeup_condition()) {
|
||||||
vusb_send_remote_wakeup();
|
vusb_send_remote_wakeup();
|
||||||
|
|
||||||
@ -148,7 +128,7 @@ void protocol_pre_task(void) {
|
|||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
vusb_wakeup();
|
suspend_wakeup_init();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user