mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-04-04 12:55:44 +00:00
Merge remote-tracking branch 'origin/develop' into xap
This commit is contained in:
commit
9a6d54d673
@ -5,6 +5,10 @@
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"author": {"type": "string"},
|
||||
"converter": {
|
||||
"type": "string",
|
||||
"enum": ["elite_pi", "proton_c", "kb2040", "promicro_rp2040", "blok", "bit_c_pro", "stemcell", "bonsai_c4"]
|
||||
},
|
||||
"host_language": {"$ref": "qmk.definitions.v1#/text_identifier"},
|
||||
"keyboard": {"$ref": "qmk.definitions.v1#/text_identifier"},
|
||||
"keymap": {"$ref": "qmk.definitions.v1#/text_identifier"},
|
||||
|
@ -36,7 +36,7 @@
|
||||
#endif
|
||||
|
||||
// Transfer buffer for TWITransmitData()
|
||||
uint8_t g_twi_transfer_buffer[20];
|
||||
uint8_t g_twi_transfer_buffer[65];
|
||||
|
||||
// These buffers match the CKLED2001 PWM registers.
|
||||
// The control buffers match the PG0 LED On/Off registers.
|
||||
@ -72,27 +72,26 @@ bool CKLED2001_write_register(uint8_t addr, uint8_t reg, uint8_t data) {
|
||||
bool CKLED2001_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
|
||||
// Assumes PG1 is already selected.
|
||||
// If any of the transactions fails function returns false.
|
||||
// Transmit PWM registers in 12 transfers of 16 bytes.
|
||||
// g_twi_transfer_buffer[] is 20 bytes
|
||||
// Transmit PWM registers in 3 transfers of 64 bytes.
|
||||
|
||||
// Iterate over the pwm_buffer contents at 16 byte intervals.
|
||||
for (int i = 0; i < 192; i += 16) {
|
||||
// Iterate over the pwm_buffer contents at 64 byte intervals.
|
||||
for (uint8_t i = 0; i < 192; i += 64) {
|
||||
g_twi_transfer_buffer[0] = i;
|
||||
// Copy the data from i to i+15.
|
||||
// Copy the data from i to i+63.
|
||||
// Device will auto-increment register for data after the first byte
|
||||
// Thus this sets registers 0x00-0x0F, 0x10-0x1F, etc. in one transfer.
|
||||
for (int j = 0; j < 16; j++) {
|
||||
for (uint8_t j = 0; j < 64; j++) {
|
||||
g_twi_transfer_buffer[1 + j] = pwm_buffer[i + j];
|
||||
}
|
||||
|
||||
#if CKLED2001_PERSISTENCE > 0
|
||||
for (uint8_t i = 0; i < CKLED2001_PERSISTENCE; i++) {
|
||||
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, CKLED2001_TIMEOUT) != 0) {
|
||||
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 65, CKLED2001_TIMEOUT) != 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, CKLED2001_TIMEOUT) != 0) {
|
||||
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 65, CKLED2001_TIMEOUT) != 0) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -35,7 +35,7 @@
|
||||
K0A, K0B, K0C, K0D, K0E, K0I, K0J \
|
||||
) \
|
||||
{ \
|
||||
/* "Q" */ { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K2O, K0F, K4P }, \
|
||||
/* "Q" */ { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K2O, K0F, K1A }, \
|
||||
/* "A" */ { K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2M, K2N, K4P, K0H, K0B }, \
|
||||
/* "Z" */ { K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1L, K4O, K0C, K4O, K0G, K0A }, \
|
||||
/* PAD */ { K4U, K2T, K3T, K2S, K1Q, K0J, K3S, K2R, K1P, K1R, K3R, K2Q, K1O, K0I, K3U, K1A }, \
|
||||
|
@ -31,6 +31,13 @@
|
||||
#define DRIVER_ADDR_1 0b1110111
|
||||
#define DRIVER_ADDR_2 0b1110100
|
||||
|
||||
/* Increase I2C speed to 1000 KHz */
|
||||
#define I2C1_TIMINGR_PRESC 0U
|
||||
#define I2C1_TIMINGR_SCLDEL 3U
|
||||
#define I2C1_TIMINGR_SDADEL 0U
|
||||
#define I2C1_TIMINGR_SCLH 15U
|
||||
#define I2C1_TIMINGR_SCLL 51U
|
||||
|
||||
/* Scan phase of led driver set as MSKPHASE_9CHANNEL(defined as 0x03 in CKLED2001.h) */
|
||||
#define PHASE_CHANNEL MSKPHASE_9CHANNEL
|
||||
|
||||
|
@ -174,7 +174,7 @@ def generate_config_h(cli):
|
||||
# Determine our keyboard/keymap
|
||||
if cli.args.filename:
|
||||
user_keymap = parse_configurator_json(cli.args.filename)
|
||||
kb_info_json = user_keymap.get('config', {})
|
||||
kb_info_json = dotty(user_keymap.get('config', {}))
|
||||
elif cli.args.keyboard:
|
||||
kb_info_json = dotty(info_json(cli.args.keyboard))
|
||||
else:
|
||||
|
@ -49,10 +49,12 @@ def process_mapping_rule(kb_info_json, rules_key, info_dict):
|
||||
def generate_rules_mk(cli):
|
||||
"""Generates a rules.mk file from info.json.
|
||||
"""
|
||||
converter = None
|
||||
# Determine our keyboard/keymap
|
||||
if cli.args.filename:
|
||||
user_keymap = parse_configurator_json(cli.args.filename)
|
||||
kb_info_json = user_keymap.get('config', {})
|
||||
kb_info_json = dotty(user_keymap.get('config', {}))
|
||||
converter = user_keymap.get('converter', None)
|
||||
elif cli.args.keyboard:
|
||||
kb_info_json = dotty(info_json(cli.args.keyboard))
|
||||
else:
|
||||
@ -88,6 +90,9 @@ def generate_rules_mk(cli):
|
||||
else:
|
||||
rules_mk_lines.append('CUSTOM_MATRIX ?= yes')
|
||||
|
||||
if converter:
|
||||
rules_mk_lines.append(f'CONVERT_TO ?= {converter}')
|
||||
|
||||
# Show the results
|
||||
dump_lines(cli.args.output, rules_mk_lines)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user