diff --git a/keyboards/momokai/tap_trio_pro/analogkeys.h b/keyboards/momokai/tap_trio_pro/analogkeys.h index d855a3345ca..75fd4017ca2 100644 --- a/keyboards/momokai/tap_trio_pro/analogkeys.h +++ b/keyboards/momokai/tap_trio_pro/analogkeys.h @@ -36,12 +36,5 @@ typedef struct { int16_t offset; bool is_analog; bool continuous_dynamic_actuation; - // uint16_t SMA_buffer[1<<(SMA_FILTER_SAMPLE_EXPONENT)]; - uint8_t SMA_samplesExponent; - uint8_t SMA_samples; - uint16_t *SMA_buffer; - uint32_t SMA_sum; - uint8_t SMA_index; - bool SMA_filled; } hybrid_key_t; extern hybrid_key_t keys[MATRIX_ROWS][MATRIX_COLS]; diff --git a/keyboards/momokai/tap_trio_pro/config.h b/keyboards/momokai/tap_trio_pro/config.h index e9e0704bf57..738f8935276 100644 --- a/keyboards/momokai/tap_trio_pro/config.h +++ b/keyboards/momokai/tap_trio_pro/config.h @@ -14,12 +14,3 @@ #define CALIBRATION_RANGE 255 -#define DEBOUNCE 16 - -//this configuration for the SMA filter, default is 4 for 2^4 = 16 samples -#define SMA_FILTER_SAMPLE_EXPONENT 4 - -#define I2C1_SCL_PIN GP19 -#define I2C1_SDA_PIN GP18 -#define OLED_BRIGHTNESS 128 -#define OLED_UPDATE_INTERVAL 1000 diff --git a/keyboards/momokai/tap_trio_pro/keyboard.json b/keyboards/momokai/tap_trio_pro/keyboard.json index bdf19928a10..4c58f756451 100644 --- a/keyboards/momokai/tap_trio_pro/keyboard.json +++ b/keyboards/momokai/tap_trio_pro/keyboard.json @@ -19,9 +19,6 @@ "matrix": [1, 0] }, "debounce": 0, - "build": { - "lto": true - }, "matrix_pins": { "direct": [ ["GP28", "GP27", "GP26" ], diff --git a/keyboards/momokai/tap_trio_pro/lut.c b/keyboards/momokai/tap_trio_pro/lut.c index 5954e2bbac8..4271ee5945e 100644 --- a/keyboards/momokai/tap_trio_pro/lut.c +++ b/keyboards/momokai/tap_trio_pro/lut.c @@ -5,21 +5,17 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "scanfunctions.h" #include "util.h" -#if !defined(MIN) -# define MIN(x, y) (((x) < (y)) ? (x) : (y)) -#endif - -#if !defined(MAX) -# define MAX(x, y) (((x) > (y)) ? (x) : (y)) -#endif - - // /* Equation parameters for the sensor-magnet linearity mapping */ + +//https://www.desmos.com/calculator/qtbbjbsyvi + +// These are values when there were 400 steps // const double lut_a = -366.805673399; // const double lut_b = 0.00617870508512; // const double lut_c = -1.49468890703; // const double lut_d = 2094.38794157; +//Values for 256 steps const double lut_a = -0.203212; const double lut_b = 0.00955995; const double lut_c = 5.99691; diff --git a/keyboards/momokai/tap_trio_pro/matrix.c b/keyboards/momokai/tap_trio_pro/matrix.c index 0746380af68..252484182b9 100644 --- a/keyboards/momokai/tap_trio_pro/matrix.c +++ b/keyboards/momokai/tap_trio_pro/matrix.c @@ -8,9 +8,7 @@ #include "quantum.h" #include "analog.h" #include "lut.h" -#include "debounce.h" #include "scanfunctions.h" -#include "sma.c" #include "quantum/matrix.h" @@ -121,11 +119,4 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) { return memcmp(previous_matrix, current_matrix, sizeof(previous_matrix)) != 0; } -uint8_t matrix_scan(void) { - bool changed = matrix_scan_custom(raw_matrix); - changed = debounce(raw_matrix, matrix, MATRIX_ROWS, changed); - matrix_scan_kb(); - return (uint8_t)changed; -} - diff --git a/keyboards/momokai/tap_trio_pro/readme.md b/keyboards/momokai/tap_trio_pro/readme.md index 2069f6826fa..c1db565ced5 100644 --- a/keyboards/momokai/tap_trio_pro/readme.md +++ b/keyboards/momokai/tap_trio_pro/readme.md @@ -1,20 +1,20 @@ -# momokai/hall_effect +# momokai/tap_trio_pro -![momokai/hall_effect](imgur.com image replace me!) +![momokai/tap_trio_pro](imgur.com image replace me!) -*A short description of the keyboard/project* +Tap trio pro, a 6 key macropad with 3 hall effect switches * Keyboard Maintainer: [peepeetee](https://github.com/peepeetee) -* Hardware Supported: *The PCBs, controllers supported* +* Hardware Supported: Tap trio pro * Hardware Availability: *Links to where you can find this hardware* Make example for this keyboard (after setting up your build environment): - make momokai/hall_effect:default + make momokai/tap_trio_pro:default Flashing example for this keyboard: - make momokai/hall_effect:default:flash + make momokai/tap_trio_pro:default:flash See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). @@ -22,6 +22,6 @@ See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_to Enter the bootloader in 3 ways: -* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard -* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead +* **Bootmagic reset**: Hold down the key at (1,0) in the matrix (the left most micro switch) and plug in the keyboard +* **Physical reset button**: Hold down the BOOT1 button on the back of the PCB While plugging it in * **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available diff --git a/keyboards/momokai/tap_trio_pro/sma.c b/keyboards/momokai/tap_trio_pro/sma.c deleted file mode 100644 index eda3d229555..00000000000 --- a/keyboards/momokai/tap_trio_pro/sma.c +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright 2024 peepeetee (@peepeetee) 2024 minisbett (@minisbett) -SPDX-License-Identifier: GPL-2.0-or-later */ - -#include -#include "analogkeys.h" - - - -void initialize_SMA_filter(hybrid_key_t key, uint8_t samplesExponent) { - key.SMA_samplesExponent = samplesExponent; - key.SMA_samples = 1 << samplesExponent; - key.SMA_buffer = malloc((key.SMA_samples)*sizeof(uint16_t)); - for (int i = 0; i < key.SMA_samples; i++) { - key.SMA_buffer[i] = 0; - } - printf("%s\n", "SMA_buffer test print"); - key.SMA_sum = 0; - key.SMA_index = 0; -} - -uint16_t SMA_filter(hybrid_key_t key, uint16_t value) { - key.SMA_sum = key.SMA_sum - key.SMA_buffer[key.SMA_index] + value; - key.SMA_buffer[key.SMA_index] = value; - key.SMA_index = (key.SMA_index + 1) % key.SMA_samples; - if (!key.SMA_filled) { - if (key.SMA_index == 0) { - key.SMA_filled = true; - } - } - - printf("%s\n", "SMA_filter test print"); - printf("%s\n", "SMA_sum and SMA_index:"); - printf("%lu\n", key.SMA_sum); - printf("%x\n", key.SMA_index); - for(int i = 0; i < key.SMA_samples; i++) { - printf("%u\n", key.SMA_buffer[i]); - } - printf("%s\n", "current value:"); - printf("%x\n", key.SMA_buffer[key.SMA_index]); - return key.SMA_sum >> key.SMA_samplesExponent; -} - - - - diff --git a/keyboards/momokai/tap_trio_pro/sma.h b/keyboards/momokai/tap_trio_pro/sma.h deleted file mode 100644 index b22f5dccf40..00000000000 --- a/keyboards/momokai/tap_trio_pro/sma.h +++ /dev/null @@ -1,8 +0,0 @@ - -#pragma once -#include -#include "analogkeys.h" - -void initialize_SMA_filter(hybrid_key_t key, uint8_t samplesExponent); - -uint16_t SMA_filter(hybrid_key_t key, uint16_t value);