diff options
Diffstat (limited to 'keyboards/handwired/onekey/keymaps')
5 files changed, 25 insertions, 14 deletions
diff --git a/keyboards/handwired/onekey/keymaps/apa102/config.h b/keyboards/handwired/onekey/keymaps/apa102/config.h index 756ebb3593..bb618d77fb 100644 --- a/keyboards/handwired/onekey/keymaps/apa102/config.h +++ b/keyboards/handwired/onekey/keymaps/apa102/config.h @@ -1,6 +1,6 @@ #pragma once -#define RGBLED_NUM 40 +#define RGBLIGHT_LED_COUNT 40 #define APA102_DEFAULT_BRIGHTNESS 5 #define RGBLIGHT_EFFECT_BREATHING #define RGBLIGHT_EFFECT_RAINBOW_MOOD diff --git a/keyboards/handwired/onekey/keymaps/dip_switch_map/config.h b/keyboards/handwired/onekey/keymaps/dip_switch_map/config.h new file mode 100644 index 0000000000..7e5b6c0b91 --- /dev/null +++ b/keyboards/handwired/onekey/keymaps/dip_switch_map/config.h @@ -0,0 +1,6 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +// TODO: Remove reuse of pin +#define DIP_SWITCH_PINS { WS2812_DI_PIN } diff --git a/keyboards/handwired/onekey/keymaps/dip_switch_map/keymap.c b/keyboards/handwired/onekey/keymaps/dip_switch_map/keymap.c new file mode 100644 index 0000000000..35bb16d458 --- /dev/null +++ b/keyboards/handwired/onekey/keymaps/dip_switch_map/keymap.c @@ -0,0 +1,14 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ortho_1x1(KC_A), + [1] = LAYOUT_ortho_1x1(KC_B), +}; + +#if defined(DIP_SWITCH_MAP_ENABLE) +const uint16_t PROGMEM dip_switch_map[NUM_DIP_SWITCHES][NUM_DIP_STATES] = { + DIP_SWITCH_OFF_ON(DF(0), DF(1)) +}; +#endif diff --git a/keyboards/handwired/onekey/keymaps/dip_switch_map/rules.mk b/keyboards/handwired/onekey/keymaps/dip_switch_map/rules.mk new file mode 100644 index 0000000000..b2429854f1 --- /dev/null +++ b/keyboards/handwired/onekey/keymaps/dip_switch_map/rules.mk @@ -0,0 +1,2 @@ +DIP_SWITCH_ENABLE = yes +DIP_SWITCH_MAP_ENABLE = yes diff --git a/keyboards/handwired/onekey/keymaps/i2c_scanner/keymap.c b/keyboards/handwired/onekey/keymaps/i2c_scanner/keymap.c index ea8443709d..1d1a7c2b00 100644 --- a/keyboards/handwired/onekey/keymaps/i2c_scanner/keymap.c +++ b/keyboards/handwired/onekey/keymaps/i2c_scanner/keymap.c @@ -8,16 +8,6 @@ // TODO: remove patch #ifdef PROTOCOL_CHIBIOS # pragma message("ChibiOS is currently 'best effort' and might not report accurate results") - -i2c_status_t i2c_start_bodge(uint8_t address, uint16_t timeout) { - i2c_start(address); - - // except on ChibiOS where the only way is do do "something" - uint8_t data = 0; - return i2c_readReg(address, 0, &data, sizeof(data), TIMEOUT); -} - -# define i2c_start i2c_start_bodge #endif const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -31,10 +21,9 @@ void do_scan(void) { for (uint8_t address = 1; address < 127; address++) { // The i2c_scanner uses the return value of - // i2c_start to see if a device did acknowledge to the address. - i2c_status_t error = i2c_start(address << 1, TIMEOUT); + // i2c_ping_address to see if a device did acknowledge to the address. + i2c_status_t error = i2c_ping_address(address << 1, TIMEOUT); if (error == I2C_STATUS_SUCCESS) { - i2c_stop(); dprintf(" I2C device found at address 0x%02X\n", address); nDevices++; } else { |