summaryrefslogtreecommitdiff
path: root/keyboards/40percentclub/nano
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2020-03-31 16:26:43 -0700
committerGitHub <noreply@github.com>2020-03-31 16:26:43 -0700
commitc67e30459390982f4f1b47f46c62322f1fe9ba87 (patch)
treed3504649cb692e58823bc7589d1a032256d9b0c1 /keyboards/40percentclub/nano
parent8c80475fcc568e04f637ae973086b65a31b5254d (diff)
downloadqmk_firmware-c67e30459390982f4f1b47f46c62322f1fe9ba87.tar.gz
qmk_firmware-c67e30459390982f4f1b47f46c62322f1fe9ba87.zip
[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
Diffstat (limited to 'keyboards/40percentclub/nano')
-rw-r--r--keyboards/40percentclub/nano/keymaps/drashna/keymap.c20
-rw-r--r--keyboards/40percentclub/nano/keymaps/drashna/rules.mk2
2 files changed, 12 insertions, 10 deletions
diff --git a/keyboards/40percentclub/nano/keymaps/drashna/keymap.c b/keyboards/40percentclub/nano/keymaps/drashna/keymap.c
index 668178967b..998e55d5b2 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 06110a0a2e..2b72a112b0 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