Remove use of layout macros for music_map (#20634)

This commit is contained in:
Ryan 2023-04-30 18:58:06 +10:00 committed by GitHub
parent 4b87961689
commit a42d6426d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 192 additions and 64 deletions

View file

@ -47,12 +47,12 @@ led_config_t g_led_config = { {
#endif
#ifdef AUDIO_ENABLE
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT(
30, 31, 32, 33, 34, 35, 35, 36, 37, 38, 39, 40, 41,
18, 9, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
);
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = {
{30, 31, 32, 33, 34, 35, 35, 36, 37, 38, 39, 40, 41},
{18, 19, 20, 21, 22, 23, 0, 25, 25, 26, 27, 28, 29},
{ 6, 7, 8, 9, 10, 11, 0, 12, 13, 14, 15, 16, 17},
{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
};
#endif
#ifdef OLED_ENABLE

View file

@ -17,11 +17,17 @@
#include "quantum.h"
#if defined(AUDIO_ENABLE) && defined(MUSIC_MAP)
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_all(
53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
);
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = {
{ 0, 0, 0, 0, 0, 0, 0, 64, 65, 66, 67},
{ 0, 0, 0, 0, 0, 0, 0, 49, 50, 51, 52},
{ 0, 0, 0, 0, 0, 0, 0, 35, 36, 37, 38},
{ 0, 0, 0, 0, 0, 0, 0, 21, 22, 23, 24},
{ 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11},
{ 0, 0, 0, 0, 0, 0, 59, 60, 61, 62, 63},
{53, 54, 55, 56, 57, 58, 0, 45, 46, 47, 48},
{39, 0, 40, 41, 42, 43, 44, 0, 32, 33, 34},
{25, 0, 26, 27, 28, 29, 30, 31, 0, 19, 20},
{11, 0, 12, 13, 14, 15, 16, 17, 18, 0, 0},
{ 0, 1, 2, 3, 0, 4, 0, 5, 6, 7, 0}
};
#endif

View file

@ -14,15 +14,19 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
#include "quantum.h"
#if defined(AUDIO_ENABLE) && defined(MUSIC_MAP)
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT(
0, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
0, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
0, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0
);
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = {
{ 0, 37, 33, 0, 27, 31, 30, 35, 25, 0},
{17, 0, 21, 0, 15, 19, 18, 23, 13, 0},
{17, 0, 0, 21, 15, 19, 18, 23, 13, 0},
{ 4, 12, 8, 0, 2, 6, 5, 10, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{28, 36, 32, 34, 26, 0, 29, 0, 0, 24},
{16, 24, 20, 22, 14, 0, 0, 0, 0, 12},
{16, 24, 20, 22, 14, 0, 0, 0, 0, 12},
{ 3, 11, 7, 9, 1, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
};
#endif

View file

@ -15,13 +15,15 @@
*/
#include "quantum.h"
#include QMK_KEYBOARD_H
__attribute__ ((weak))
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_ortho_2x2u(
0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 3, 0, 6, 8, 10, 0, 13, 15, 0, 18, 20, 0,
0, 0, 2, 4, 5, 7, 9, 11, 12, 14, 16, 17, 19, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0
);
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = {
{ 0, 0, 0, 0, 0, 0, 0},
{ 0, 1, 3, 0, 6, 8, 10},
{ 0, 0, 2, 4, 5, 7, 9},
{ 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0},
{ 0, 13, 15, 0, 18, 20, 0},
{11, 12, 14, 16, 17, 19, 0},
{ 0, 0, 0, 0, 0, 0, 0}
};

View file

@ -16,8 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
#include "moonlander.h"
keyboard_config_t keyboard_config;
@ -370,14 +368,20 @@ void keyboard_post_init_kb(void) {
#if defined(AUDIO_ENABLE) && defined(MUSIC_MAP)
// clang-format off
__attribute__ ((weak))
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_moonlander(
58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
8, 9, 10, 11, 12, 3, 4, 13, 14, 15, 16, 17,
0, 1, 2, 5, 6, 7
);
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = {
{58, 59, 60, 61, 62, 63, 64},
{44, 45, 46, 47, 48, 49, 50},
{30, 31, 32, 33, 34, 35, 36},
{18, 19, 20, 21, 22, 23, 0},
{ 8, 9, 10, 11, 12, 0, 0},
{ 0, 1, 2, 3, 0, 0, 0},
{65, 66, 67, 68, 69, 70, 71},
{51, 52, 53, 54, 55, 56, 57},
{37, 38, 39, 40, 41, 42, 43},
{ 0, 24, 25, 26, 27, 28, 29},
{ 0, 0, 13, 14, 15, 16, 17},
{ 0, 0, 0, 4, 5, 6, 7}
};
// clang-format on
#endif

View file

@ -356,3 +356,14 @@ const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = {0};
# endif
#endif
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = {
{36, 37, 38, 39, 40, 41},
{24, 25, 26, 27, 28, 29},
{12, 13, 14, 15, 16, 17},
{ 0, 1, 2, 10, 11, 6},
{42, 43, 44, 45, 46, 47},
{30, 31, 32, 33, 34, 35},
{18, 19, 20, 21, 22, 23},
{ 7, 8, 9, 3, 4, 5}
};

View file

@ -140,3 +140,10 @@ const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = {0};
# endif
#endif
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = {
{36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47},
{24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35},
{12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23},
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}
};

View file

@ -1,5 +1,4 @@
#include "quantum.h"
#include QMK_KEYBOARD_H
__attribute__ ((weak))
void matrix_init_kb(void) {
@ -12,13 +11,6 @@ void matrix_init_kb(void) {
matrix_init_user();
}
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_planck_grid(
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
);
#ifdef ENCODER_ENABLE
bool encoder_update_kb(uint8_t index, bool clockwise) {
if (!encoder_update_user(index, clockwise)) { return false; }

View file

@ -13,3 +13,10 @@ const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = {0};
# endif
#endif
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = {
{36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47},
{24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35},
{12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23},
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}
};

View file

@ -13,3 +13,10 @@ const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = {0};
# endif
#endif
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = {
{36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47},
{24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35},
{12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23},
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}
};

View file

@ -13,3 +13,10 @@ const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = {0};
# endif
#endif
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = {
{36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47},
{24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35},
{12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23},
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}
};

View file

@ -13,3 +13,10 @@ const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = {0};
# endif
#endif
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = {
{36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47},
{24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35},
{12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23},
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}
};

View file

@ -13,3 +13,10 @@ const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = {0};
# endif
#endif
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = {
{36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47},
{24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35},
{12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23},
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}
};

View file

@ -60,3 +60,14 @@ const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = {0};
# endif
#endif
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = {
{36, 37, 38, 39, 40, 41},
{24, 25, 26, 27, 28, 29},
{12, 13, 14, 15, 16, 17},
{ 0, 1, 2, 9, 10, 11},
{42, 43, 44, 45, 46, 47},
{30, 31, 32, 33, 34, 35},
{18, 19, 20, 21, 22, 23},
{ 6, 7, 8, 3, 4, 5}
};

View file

@ -61,3 +61,14 @@ const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = {0};
# endif
#endif
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = {
{36, 37, 38, 39, 40, 41},
{24, 25, 26, 27, 28, 29},
{12, 13, 14, 15, 16, 17},
{ 0, 1, 2, 9, 10, 11},
{42, 43, 44, 45, 46, 47},
{30, 31, 32, 33, 34, 35},
{18, 19, 20, 21, 22, 23},
{ 6, 7, 8, 3, 4, 5}
};

View file

@ -30,3 +30,10 @@ const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = {0};
# endif
#endif
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = {
{36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47},
{24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35},
{12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23},
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}
};

View file

@ -1,13 +1,4 @@
#include "quantum.h"
#include QMK_KEYBOARD_H
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_preonic_grid(
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
);
#ifdef ENCODER_ENABLE
bool encoder_update_kb(uint8_t index, bool clockwise) {

View file

@ -34,3 +34,11 @@ void matrix_init_kb(void) {
{{11, 4}, {10, 4}, {9, 4}, {8, 4}, {7, 4}, {6, 4}, {5, 4}, {4, 4}, {3, 4}, {2, 4}, {1, 4}, {0, 4}},
};
#endif
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = {
{48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59},
{36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47},
{24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35},
{12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23},
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}
};

View file

@ -34,3 +34,11 @@ void matrix_init_kb(void) {
{{11, 4}, {10, 4}, {9, 4}, {8, 4}, {7, 4}, {6, 4}, {5, 4}, {4, 4}, {3, 4}, {2, 4}, {1, 4}, {0, 4}},
};
#endif
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = {
{48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59},
{36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47},
{24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35},
{12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23},
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}
};

View file

@ -62,3 +62,16 @@ const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = {0};
# endif
#endif
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = {
{48, 49, 50, 51, 52, 53},
{36, 37, 38, 39, 40, 41},
{24, 25, 26, 27, 28, 29},
{12, 13, 14, 15, 16, 17},
{54, 55, 56, 57, 58, 59},
{42, 43, 44, 45, 46, 47},
{30, 31, 32, 33, 34, 35},
{18, 19, 20, 21, 22, 23},
{ 0, 1, 2, 9, 10, 11},
{ 6, 7, 8, 3, 4, 5}
};

View file

@ -62,3 +62,16 @@ const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = {0};
# endif
#endif
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = {
{48, 49, 50, 51, 52, 53},
{36, 37, 38, 39, 40, 41},
{24, 25, 26, 27, 28, 29},
{12, 13, 14, 15, 16, 17},
{54, 55, 56, 57, 58, 59},
{42, 43, 44, 45, 46, 47},
{30, 31, 32, 33, 34, 35},
{18, 19, 20, 21, 22, 23},
{ 0, 1, 2, 9, 10, 11},
{ 6, 7, 8, 3, 4, 5}
};

View file

@ -17,11 +17,16 @@
#include "quantum.h"
#if defined(AUDIO_ENABLE) && defined(MUSIC_MAP)
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_all(
0,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,
0, 32,33,34,35,36,37,38,39,40,41,42,43,44,45, 46,
0, 17,18,19,20,21,22,23,24,25,26,27,28,29,30, 31,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
);
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = {
{ 0, 47, 49, 51, 53, 55, 57, 59, 61, 0},
{32, 0, 34, 36, 38, 40, 42, 44, 0, 0},
{17, 19, 0, 21, 23, 25, 27, 29, 0, 0},
{ 1, 3, 5, 0, 7, 9, 11, 13, 15, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 48, 50, 52, 54, 0, 56, 58, 60, 62},
{ 0, 33, 35, 37, 39, 41, 0, 43, 45, 46},
{ 0, 18, 20, 22, 24, 26, 28, 0, 30, 31},
{ 0, 2, 4, 6, 8, 10, 12, 14, 0, 16},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
};
#endif