Compare commits

...

2 Commits

Author SHA1 Message Date
Mark 213b56a132
Moved fft table definitions 2022-07-11 10:39:06 -07:00
Mark cbacb36de2
Updated README 2022-07-09 20:34:55 -07:00
6 changed files with 63 additions and 62 deletions

View File

@ -4,10 +4,11 @@ This repository contains everything required to build qmk firmware.
### TODO
- **Core:**
- Better build/flash command
- Warning when directory is moved
- **Keyboard:**
- Random FFT animation
-------------------------------------------------

View File

@ -4,44 +4,7 @@ RGB_MATRIX_EFFECT(FFT_ANIM)
#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS
static int8_t fft_array_to_col[4][14] = {
// Each number represets a bin and a height:
// x % bin_height = height,
// x / bin_height = bin
//
// Indices are [col][row].
// Right side
{ 29, 34, 39, 44, 49,
28, 33, 38, 43, 48,
27, 32, 37, 42},{47,
26, 31, 36, 41, 46,
30, 35, 40, 45,
// Left side, mirrored
24, 19, 14, 9},{ 4,
23, 18, 13, 8, 3,
22, 17, 12, 7, 2,
21, 16, 11},{ 6, 1,
20, 15, 10, 5, 0,
// No keys here, fill array length
0, 0, 0, 0, 0, 0, 0}
};
static int8_t fft_col_to_array[10][5] = {
{ 47, 43, 38, 33, 28 },
{ 46, 42, 37, 32, 27 },
{ 45, 41, 36, 31, 26 },
{ 44, 40, 35, 30, 25 },
{ -1, 39, 34, 29, 24 },
{ -1, 15, 10, 5, 0 },
{ 20, 16, 11, 6, 1 },
{ 21, 17, 12, 7, 2 },
{ 22, 18, 13, 8, 3 },
{ 23, 19, 14, 9, 4 }
};
#include "extra_mappings.h"
// TODO:
// Dynamic color settings

View File

@ -0,0 +1,48 @@
#include "extra_mappings.h"
// Maps fft columns to leds.
// fft_col_to_array[i] returns an array of leds in the ith bin of the fft.
// Negative indices are "invisible" leds.
// Use them when your keyboard has gaps.
//
// This layout is for the Ergodox EZ.
const int8_t fft_col_to_array[10][5] = {
{ 47, 43, 38, 33, 28 },
{ 46, 42, 37, 32, 27 },
{ 45, 41, 36, 31, 26 },
{ 44, 40, 35, 30, 25 },
{ -1, 39, 34, 29, 24 },
{ -1, 15, 10, 5, 0 },
{ 20, 16, 11, 6, 1 },
{ 21, 17, 12, 7, 2 },
{ 22, 18, 13, 8, 3 },
{ 23, 19, 14, 9, 4 }
};
// This is the inverse of fft_col_to_array.
//
// Each number represets a bin and a height:
// x % bin_height = height,
// x / bin_height = bin
//
// Indices are [col][row].
const int8_t fft_array_to_col[4][14] = {
// Right side
{ 29, 34, 39, 44, 49,
28, 33, 38, 43, 48,
27, 32, 37, 42},{47,
26, 31, 36, 41, 46,
30, 35, 40, 45,
// Left side, mirrored
24, 19, 14, 9},{ 4,
23, 18, 13, 8, 3,
22, 17, 12, 7, 2,
21, 16, 11},{ 6, 1,
20, 15, 10, 5, 0,
// No keys here, fill array length
0, 0, 0, 0, 0, 0, 0}
};

View File

@ -0,0 +1,6 @@
#pragma once
#include <stdint.h>
extern const int8_t fft_array_to_col[4][14];
extern const int8_t fft_col_to_array[10][5];

View File

@ -1,6 +1,5 @@
#include "rawhid.h"
uint8_t hid_anim_data[32];
#include "extra_mappings.h"
// See rawhid.h for prococol documentation
void raw_hid_receive(uint8_t *data, uint8_t length) {
@ -58,26 +57,9 @@ void hid_send_state() {
raw_hid_send(packet, RAW_EPSIZE);
}
#ifdef RGB_MATRIX_FRAMEBUFFER_EFFECTS
// Maps fft columns to leds.
// fft_col_to_array[i] returns an array of leds in the ith bin of the fft.
// Negative indices are "invisible" leds.
// Use them when your keyboard has gaps.
//
// This layout is for the Ergodox EZ.
static int8_t fft_col_to_array[10][5] = {
{ 47, 43, 38, 33, 28 },
{ 46, 42, 37, 32, 27 },
{ 45, 41, 36, 31, 26 },
{ 44, 40, 35, 30, 25 },
{ -1, 39, 34, 29, 24 },
{ -1, 15, 10, 5, 0 },
{ 20, 16, 11, 6, 1 },
{ 21, 17, 12, 7, 2 },
{ 22, 18, 13, 8, 3 },
{ 23, 19, 14, 9, 4 }
};
#ifdef RGB_MATRIX_FRAMEBUFFER_EFFECTS
#define FFT_PER_KEY 50

View File

@ -38,7 +38,8 @@ DEBOUNCE_TYPE = sym_eager_pr
SRC += \
matrix.c \
led_i2c.c \
rawhid.c
rawhid.c \
extra_mappings.c
QUANTUM_LIB_SRC += i2c_master.c