mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-07-17 05:02:07 +00:00
Implement probe command, make logical key names match configurator
This commit is contained in:
parent
1f51d23635
commit
b4ec11f5f5
@ -5,6 +5,8 @@
|
||||
#include "launch_1.h"
|
||||
|
||||
enum Command {
|
||||
// Probe for System76 EC protocol
|
||||
CMD_PROBE = 1,
|
||||
// Get keyboard map index
|
||||
CMD_KEYMAP_GET = 9,
|
||||
// Set keyboard map index
|
||||
@ -40,6 +42,14 @@ void raw_hid_receive(uint8_t *data, uint8_t length) {
|
||||
data[1] = 1;
|
||||
|
||||
switch (data[0]) {
|
||||
case CMD_PROBE:
|
||||
// Signature
|
||||
data[2] = 0x76;
|
||||
data[3] = 0xEC;
|
||||
// Version
|
||||
data[4] = 0x01;
|
||||
data[1] = 0;
|
||||
break;
|
||||
case CMD_KEYMAP_GET:
|
||||
{
|
||||
uint16_t value = 0;
|
||||
|
@ -5,6 +5,8 @@
|
||||
#include "launch_test.h"
|
||||
|
||||
enum Command {
|
||||
// Probe for System76 EC protocol
|
||||
CMD_PROBE = 1,
|
||||
// Get keyboard map index
|
||||
CMD_KEYMAP_GET = 9,
|
||||
// Set keyboard map index
|
||||
@ -40,6 +42,14 @@ void raw_hid_receive(uint8_t *data, uint8_t length) {
|
||||
data[1] = 1;
|
||||
|
||||
switch (data[0]) {
|
||||
case CMD_PROBE:
|
||||
// Signature
|
||||
data[2] = 0x76;
|
||||
data[3] = 0xEC;
|
||||
// Version
|
||||
data[4] = 0x01;
|
||||
data[1] = 0;
|
||||
break;
|
||||
case CMD_KEYMAP_GET:
|
||||
{
|
||||
uint16_t value = 0;
|
||||
@ -74,7 +84,34 @@ void eeprom_set_valid(bool valid) {
|
||||
eeprom_update_byte(((void*)EEPROM_VERSION_ADDR), valid ? EEPROM_VERSION : 0xFF);
|
||||
}
|
||||
|
||||
void eeprom_reset(void) {
|
||||
// Set the keyboard specific EEPROM state as invalid.
|
||||
eeprom_set_valid(false);
|
||||
// Set the TMK/QMK EEPROM state as invalid.
|
||||
eeconfig_disable();
|
||||
}
|
||||
|
||||
void bootmagic_lite(void) {
|
||||
// The lite version of TMK's bootmagic.
|
||||
// 100% less potential for accidentally making the
|
||||
// keyboard do stupid things.
|
||||
|
||||
// We need multiple scans because debouncing can't be turned off.
|
||||
matrix_scan();
|
||||
wait_ms(DEBOUNCE);
|
||||
wait_ms(DEBOUNCE);
|
||||
matrix_scan();
|
||||
|
||||
// If the Esc (matrix 0,0) is held down on power up,
|
||||
// reset the EEPROM valid state and jump to bootloader.
|
||||
if ( matrix_get_row(0) & (1<<0) ) {
|
||||
eeprom_reset();
|
||||
bootloader_jump();
|
||||
}
|
||||
}
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
bootmagic_lite();
|
||||
if (!eeprom_is_valid()) {
|
||||
dynamic_keymap_reset();
|
||||
dynamic_keymap_macro_reset();
|
||||
|
Loading…
Reference in New Issue
Block a user