[Keymap] Drashna's Cleanup and RGB Divide (#8506)
* Enable External EEPROM on Planck Rev6 * Update KC_MAKE macro to use qmk cli util * Disable additional gradients for rgb matrix * Update analog code for newer methods * Update ergodox layout * Disable Grave Escape * Cleanup OLED code a bit * Remove old unicode code * Seperate RGB Matrix code from RGB Light code in userspace * Massive overhaul an generalization of personal OLED code Now lets hope I NEVER get a keyboard using a 128x32 in a normal orientation. * Super tiny cleanup * Enable Diablo layer on kyria * clang format pass * Additional OLED cleanup
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#include "drashna.h"
|
||||
#include "analog.c"
|
||||
#include "analog.h"
|
||||
#include "pointing_device.h"
|
||||
#include "pincontrol.h"
|
||||
|
||||
@@ -17,8 +17,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
// Joystick
|
||||
// Set Pins
|
||||
uint8_t xPin = 8; // VRx / /B4
|
||||
uint8_t yPin = 7; // VRy // B5
|
||||
// uint8_t xPin = 8; // VRx / /B4
|
||||
// uint8_t yPin = 7; // VRy // B5
|
||||
uint8_t swPin = E6; // SW
|
||||
|
||||
// Set Parameters
|
||||
@@ -43,7 +43,7 @@ int16_t axisCoordinate(uint8_t pin, uint16_t origin) {
|
||||
int16_t distanceFromOrigin;
|
||||
int16_t range;
|
||||
|
||||
int16_t position = analogRead(pin);
|
||||
int16_t position = analogReadPin(pin);
|
||||
|
||||
if (origin == position) {
|
||||
return 0;
|
||||
@@ -88,11 +88,11 @@ void pointing_device_task(void) {
|
||||
// todo read as one vector
|
||||
if (timer_elapsed(lastCursor) > cursorTimeout) {
|
||||
lastCursor = timer_read();
|
||||
report.x = axisToMouseComponent(xPin, xOrigin, maxCursorSpeed, xPolarity);
|
||||
report.y = axisToMouseComponent(yPin, yOrigin, maxCursorSpeed, yPolarity);
|
||||
report.x = axisToMouseComponent(B4, xOrigin, maxCursorSpeed, xPolarity);
|
||||
report.y = axisToMouseComponent(B5, yOrigin, maxCursorSpeed, yPolarity);
|
||||
}
|
||||
//
|
||||
if (!readPin(swPin)) {
|
||||
if (!readPin(E6)) {
|
||||
report.buttons |= MOUSE_BTN1;
|
||||
} else {
|
||||
report.buttons &= ~MOUSE_BTN1;
|
||||
@@ -104,8 +104,8 @@ void pointing_device_task(void) {
|
||||
|
||||
void matrix_init_keymap(void) {
|
||||
// init pin? Is needed?
|
||||
setPinInputHigh(swPin);
|
||||
setPinInputHigh(E6);
|
||||
// Account for drift
|
||||
xOrigin = analogRead(xPin);
|
||||
yOrigin = analogRead(yPin);
|
||||
xOrigin = analogReadPin(B4);
|
||||
yOrigin = analogReadPin(B5);
|
||||
}
|
||||
|
@@ -3,3 +3,5 @@ RGBLIGHT_ENABLE = no
|
||||
CONSOLE_ENABLE = no
|
||||
|
||||
BOOTLOADER = qmk-dfu
|
||||
|
||||
SRC += analog.c
|
||||
|
Reference in New Issue
Block a user