Compare commits

..

No commits in common. "213b56a1323c6dc98a11c34912ddb09c68a42a12" and "9c7159dc364c303a7fbfa448428f0e5273ae0f69" have entirely different histories.

6 changed files with 62 additions and 63 deletions

View File

@ -4,11 +4,10 @@ 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,7 +4,44 @@ RGB_MATRIX_EFFECT(FFT_ANIM)
#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS
#include "extra_mappings.h"
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 }
};
// TODO:
// Dynamic color settings

View File

@ -1,48 +0,0 @@
#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

@ -1,6 +0,0 @@
#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,5 +1,6 @@
#include "rawhid.h"
#include "extra_mappings.h"
uint8_t hid_anim_data[32];
// See rawhid.h for prococol documentation
void raw_hid_receive(uint8_t *data, uint8_t length) {
@ -57,9 +58,26 @@ 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 }
};
#define FFT_PER_KEY 50

View File

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