summaryrefslogtreecommitdiff
path: root/keyboards/40percentclub
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/40percentclub')
-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