From c67e30459390982f4f1b47f46c62322f1fe9ba87 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 31 Mar 2020 16:26:43 -0700 Subject: [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 --- .../40percentclub/nano/keymaps/drashna/keymap.c | 20 ++++++++++---------- .../40percentclub/nano/keymaps/drashna/rules.mk | 2 ++ 2 files changed, 12 insertions(+), 10 deletions(-) (limited to 'keyboards/40percentclub/nano/keymaps') diff --git a/keyboards/40percentclub/nano/keymaps/drashna/keymap.c b/keyboards/40percentclub/nano/keymaps/drashna/keymap.c index 668178967..998e55d5b 100644 --- a/keyboards/40percentclub/nano/keymaps/drashna/keymap.c +++ b/keyboards/40percentclub/nano/keymaps/drashna/keymap.c @@ -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); } diff --git a/keyboards/40percentclub/nano/keymaps/drashna/rules.mk b/keyboards/40percentclub/nano/keymaps/drashna/rules.mk index 06110a0a2..2b72a112b 100644 --- a/keyboards/40percentclub/nano/keymaps/drashna/rules.mk +++ b/keyboards/40percentclub/nano/keymaps/drashna/rules.mk @@ -3,3 +3,5 @@ RGBLIGHT_ENABLE = no CONSOLE_ENABLE = no BOOTLOADER = qmk-dfu + +SRC += analog.c -- cgit v1.2.3-70-g09d2