From af56e19270b43e448bb9d9f3176deb8d6dd41a36 Mon Sep 17 00:00:00 2001 From: Patrick Mathern Date: Sat, 26 Oct 2024 22:25:51 -0400 Subject: [PATCH 01/20] Adding Macroflow Macropad --- keyboards/macroflow_original/keyboard.json | 53 ++++ .../keymaps/default/config.h | 3 + .../keymaps/default/keymap.c | 295 ++++++++++++++++++ .../keymaps/default/rules.mk | 3 + keyboards/macroflow_original/readme.md | 27 ++ 5 files changed, 381 insertions(+) create mode 100644 keyboards/macroflow_original/keyboard.json create mode 100644 keyboards/macroflow_original/keymaps/default/config.h create mode 100644 keyboards/macroflow_original/keymaps/default/keymap.c create mode 100644 keyboards/macroflow_original/keymaps/default/rules.mk create mode 100644 keyboards/macroflow_original/readme.md diff --git a/keyboards/macroflow_original/keyboard.json b/keyboards/macroflow_original/keyboard.json new file mode 100644 index 000000000000..249a5a1707e4 --- /dev/null +++ b/keyboards/macroflow_original/keyboard.json @@ -0,0 +1,53 @@ +{ + "manufacturer": "Customacros", + "keyboard_name": "Macroflow Original", + "maintainer": "Patrickemm", + "bootloader": "caterina", + "diode_direction": "COL2ROW", + "features": { + "bootmagic": true, + "command": false, + "console": false, + "extrakey": true, + "mousekey": true, + "nkro": true, + "encoder": true, + "oled": true, + "encodermap": true + }, + "matrix_pins": { + "cols": ["B1", "B3", "B2", "F7"], + "rows": ["E6", "B4", "B5"] + }, + "processor": "atmega32u4", + "url": "https://github.com/Patrickemm", + "usb": { + "device_version": "1.0.0", + "pid": "0x0002", + "vid": "0x504D" + }, + "layouts": { + "LAYOUT_macroflow_2x4": { + "layout": [ + + {"matrix": [0, 0], "x": 0, "y": 0}, + {"matrix": [0, 3], "x": 1, "y": 0}, + + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2} + ] + } + }, + "encoder": { + "rotary": [ + {"pin_b": "F5", "pin_a": "F4"} + ] + } +} \ No newline at end of file diff --git a/keyboards/macroflow_original/keymaps/default/config.h b/keyboards/macroflow_original/keymaps/default/config.h new file mode 100644 index 000000000000..3b8414354fb3 --- /dev/null +++ b/keyboards/macroflow_original/keymaps/default/config.h @@ -0,0 +1,3 @@ +#define DYNAMIC_KEYMAP_LAYER_COUNT 8 +#define ENCODER_RESOLUTION 4 +#define OLED_TIMEOUT 60000 \ No newline at end of file diff --git a/keyboards/macroflow_original/keymaps/default/keymap.c b/keyboards/macroflow_original/keymaps/default/keymap.c new file mode 100644 index 000000000000..6ceca7df2e35 --- /dev/null +++ b/keyboards/macroflow_original/keymaps/default/keymap.c @@ -0,0 +1,295 @@ +#include QMK_KEYBOARD_H + + +// Define the keycode, `QK_USER` avoids collisions with existing keycodes +enum keycodes { + KC_CYCLE_LAYERS = QK_USER, +}; + +enum layer_names { + one, + two, + three, + four, + five, + six, + seven, + eight +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_macroflow_2x4( + KC_0, KC_CYCLE_LAYERS, + KC_1, KC_2, KC_3, KC_4, + KC_5, KC_6, KC_7, KC_8 + ), + [1] = LAYOUT_macroflow_2x4( + KC_9, KC_CYCLE_LAYERS, + KC_A, KC_B, KC_C, KC_D, + KC_E, KC_F, KC_G, KC_H + ), + [2] = LAYOUT_macroflow_2x4( + KC_I, KC_CYCLE_LAYERS, + KC_J, KC_K, KC_L, KC_M, + KC_N, KC_O, KC_P, KC_Q + ), + [3] = LAYOUT_macroflow_2x4( + KC_R, KC_CYCLE_LAYERS, + KC_S, KC_T, KC_U, KC_V, + KC_W, KC_X, KC_Y, KC_Z + ), + [4] = LAYOUT_macroflow_2x4( + KC_TRNS, KC_CYCLE_LAYERS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + [5] = LAYOUT_macroflow_2x4( + KC_TRNS, KC_CYCLE_LAYERS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + [6] = LAYOUT_macroflow_2x4( + KC_TRNS, KC_CYCLE_LAYERS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + [7] = LAYOUT_macroflow_2x4( + KC_TRNS, KC_CYCLE_LAYERS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) +}; + +// 1st layer on the cycle +#define LAYER_CYCLE_START 0 +// Last layer on the cycle +#define LAYER_CYCLE_END 8 + +// Add the behaviour of this new keycode +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_CYCLE_LAYERS: + // Our logic will happen on presses, nothing is done on releases + if (!record->event.pressed) { + // We've already handled the keycode (doing nothing), let QMK know so no further code is run unnecessarily + return false; + } + + uint8_t current_layer = get_highest_layer(layer_state); + + // Check if we are within the range, if not quit + if (current_layer > LAYER_CYCLE_END || current_layer < LAYER_CYCLE_START) { + return false; + } + + uint8_t next_layer = current_layer + 1; + if (next_layer > LAYER_CYCLE_END) { + next_layer = LAYER_CYCLE_START; + } + layer_move(next_layer); + return false; + + // Process other keycodes normally + default: + return true; + } +} + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + [0] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN) }, + [1] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN) }, + [2] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN) }, + [3] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN) }, + [4] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN) }, + [5] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN) }, + [6] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN) }, + [7] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN) } +}; +#endif + +#ifdef OLED_ENABLE + +#ifndef SHOW_LOGO +# define SHOW_LOGO 2500 +#endif +static uint16_t oled_logo_timer = 0; +static bool has_startup_ran = false; + +bool oled_task_user(void) { + if (!has_startup_ran) { + static const char startUp [] PROGMEM = { + // 'startUp', 128x32px + 0, 0, 0,128,192,192,128,128, 0, 0,192,192, 0, 0, 0,192,192, 0, 0,128,128,192,192,128, 0, 0,192,192,192,192,192,192,192, 0, 0,128,128,192,192,128, 0, 0, 0,192,192,128, 0, 0, 0, 0,192,192,128, 0, 0, 0,128,192,192, 0, 0, 0, 0, 0,128,128,192,192,128, 0, 0,128,192,192,192,192,128,128, 0, 0, 0,128,192,192,192,128, 0, 0, 0,128,128,192,192,128, 0, 0, 0, 0, 0, 0, 0,128,192,192,128, 0, 0, 0, 0,128,192,192,128,128, 0, 0,192,192,192, 0, 0, 0, 0,128,192,192, 0,0, + 0, 0,255,255, 1, 1, 1, 31, 30, 0,255,255, 0, 0, 0,255,255, 0, 30,127,241,193,129, 7, 15, 0, 1, 1, 1,255,255, 1, 1, 0,254,255, 1, 1, 1,255,255, 0, 0,255, 63,255,224, 0,128,254, 63,255,255, 0, 0,224,255, 15,127,255,192, 0, 0,254,255, 1, 1, 1, 31, 31, 0,255,255,129,129,129,255,127, 0, 0,255,255, 1, 1, 1,255,255, 0, 30,127,241,193,129, 7, 15, 0, 0, 0, 0,252,255, 3, 1, 1, 3, 31, 30, 0,255,255, 1, 1, 1,255,254, 0,255,255,127,252, 0, 0,240,255,255,255, 0, 0, 0, 0,255,255,128,128,192,252, 60, 0,127,255,128,128,128,255,127, 0,120,248,128,129,131,255,254, 0, 0, 0, 0,255,255, 0, 0, 0,127,255,128,128,128,255,255, 0, 0,255, 0, 3,255,248,255, 15, 0,255,255, 0,248,255, 27, 24, 24, 63,255,224, 0,127,255,128,128,128,252,124, 0,255,255, 3, 1, 3,127,254,240, 0,127,255,128,128,128,255,127, 0,120,248,128,129,131,255,254, 0,128,128, 0, 63,255,192,128,128,224,252, 60, 0,255,255,128,128,128,255,127, 0,255,255, 0, 31,255,252,127, 1,255,255, 0, 0,0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0 + }; + oled_write_raw_P(startUp, sizeof(startUp)); + if (timer_elapsed(oled_logo_timer) >= SHOW_LOGO) { + has_startup_ran = true; + oled_clear(); + } + } else { + static const char PROGMEM layer[4][67+1] = { + { 224,224,224,224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,224,224,224,224,224, 0, 0, 0, 0, 0,224,224,224,128, 0, 0, 0, 0,128,224,224,224, 0, 0, 0,224,224,224,224,224,224,224,224,224,224,224, 0, 0,224,224,224,224,224,224,224,224,224,192,128, 0 }, + { 255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240,255,255,127, 15,127,255,255,240, 0, 0, 0, 0, 3, 15,127,252,240,240,252,127, 15, 3, 0, 0, 0, 0,255,255,255,255,192,192,192,192,192, 0, 0, 0, 0,255,255,255,255,192,192,192,225,255,255,255,127 }, + { 255,255,255,255,192,192,192,192,192,192,192, 0, 0,192,254,255,255,127, 28, 28, 28,127,255,255,254,192, 0, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,129,129,129,129,129,128,128, 0, 0,255,255,255,255, 1, 1, 7,127,255,255,248,192 }, + { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 3, 3, 3, 3, 0, 0, 0, 0, 0, 3, 3, 3, 3, 0, 0, 0, 0, 0, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 3, 3, 3, 3, 0, 0, 0, 0, 3, 3, 3, 3 }, + }; + + static const char PROGMEM layer1[4][30+1] = { + { 128,224,240,240,248,248,248,248,248,248,248,120,120, 56, 56, 24, 24, 24,248,248,248,248,248,248,248,248,240,240,224,128 }, + { 255,255,255,255,255,255,255,255,255,255,255,252,252,252, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255 }, + { 255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255 }, + { 1, 7, 15, 15, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 28, 28, 28, 28, 31, 31, 31, 31, 31, 31, 31, 31, 15, 15, 7, 1 } + }; + + static const char PROGMEM layer2[4][30+1] = { + { 128,224,240,240,248,248,248,248,248,248,120, 56, 24, 24, 24, 24, 24, 24, 56,120,248,248,248,248,248,248,240,240,224,128 }, + { 255,255,255,255,255,255,255,255,255,255,248,248,248,254,255, 63, 6, 0,128,224,255,255,255,255,255,255,255,255,255,255 }, + { 255,255,255,255,255,255,255,255,255,255, 63, 15, 7, 1, 64,112,120,126,127,127,255,255,255,255,255,255,255,255,255,255 }, + { 1, 7, 15, 15, 31, 31, 31, 31, 31, 31, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 31, 31, 31, 31, 31, 31, 15, 15, 7, 1 } + }; + + static const char PROGMEM layer3[4][30+1] = { + { 128,224,240,240,248,248,248,248,248,248,120, 56, 24, 24, 24, 24, 24, 24, 56,120,248,248,248,248,248,248,240,240,224,128 }, + { 255,255,255,255,255,255,255,255,255,255,248,248,248, 62, 63, 63, 30, 0,128,192,255,255,255,255,255,255,255,255,255,255 }, + { 255,255,255,255,255,255,255,255,255,255, 31, 31, 31,126,254,254,124, 0, 0, 1,255,255,255,255,255,255,255,255,255,255 }, + { 1, 7, 15, 15, 31, 31, 31, 31, 31, 31, 30, 28, 24, 24, 24, 24, 24, 24, 28, 30, 31, 31, 31, 31, 31, 31, 15, 15, 7, 1 } + }; + + static const char PROGMEM layer4[4][30+1] = { + { 128,224,240,240,248,248,248,248,248,248,248,248,248,248,120, 24, 24, 24, 24,248,248,248,248,248,248,248,240,240,224,128 }, + { 255,255,255,255,255,255,255,255,255,255,255, 63, 7, 1,192,240, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255 }, + { 255,255,255,255,255,255,255,255,255,255,192,192,192,194,195,195, 0, 0, 0,195,195,255,255,255,255,255,255,255,255,255 }, + { 1, 7, 15, 15, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 28, 28, 28, 31, 31, 31, 31, 31, 31, 31, 15, 15, 7, 1 } + }; + + static const char PROGMEM layer5[4][30+1] = { + { 128,224,240,240,248,248,248,248,248,248, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,248,248,248,248,248,248,240,240,224,128 }, + { 255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0,143,143,143, 15, 15, 31,255,255,255,255,255,255,255,255,255,255 }, + { 255,255,255,255,255,255,255,255,255,255,142, 14, 14, 30,127,127,127, 0, 0, 0,224,255,255,255,255,255,255,255,255,255 }, + { 1, 7, 15, 15, 31, 31, 31, 31, 31, 31, 31, 30, 28, 28, 28, 28, 28, 28, 30, 31, 31, 31, 31, 31, 31, 31, 15, 15, 7, 1 } + }; + + static const char PROGMEM layer6[4][30+1] = { + { 128,224,240,240,248,248,248,248,248,248,248, 56, 24, 24, 24, 24, 24, 24, 24, 56,248,248,248,248,248,248,240,240,224,128 }, + { 255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0, 31, 31, 31, 24, 24, 56,255,255,255,255,255,255,255,255,255,255 }, + { 255,255,255,255,255,255,255,255,255,255,128, 0, 0, 0,127,127,127, 0, 0, 0,128,255,255,255,255,255,255,255,255,255 }, + { 1, 7, 15, 15, 31, 31, 31, 31, 31, 31, 31, 30, 28, 28, 28, 28, 28, 28, 28, 30, 31, 31, 31, 31, 31, 31, 15, 15, 7, 1 } + }; + + static const char PROGMEM layer7[4][30+1] = { + { 128,224,240,240,248,248,248,248,248,248, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,248,248,248,248,248,248,240,240,224,128 }, + { 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 31, 3, 0,128,248,255,255,255,255,255,255,255,255,255,255 }, + { 255,255,255,255,255,255,255,255,255,255,255,255,127, 15, 1, 0,192,252,255,255,255,255,255,255,255,255,255,255,255,255 }, + { 1, 7, 15, 15, 31, 31, 31, 31, 31, 31, 31, 31, 28, 28, 28, 28, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 15, 15, 7, 1 } + }; + + static const char PROGMEM layer8[4][30+1] = { + { 128,224,240,240,248,248,248,248,248,248,248, 56, 24, 24, 24, 24, 24, 24, 24, 56,248,248,248,248,248,248,240,240,224,128 }, + { 255,255,255,255,255,255,255,255,255,255,224,128, 0, 0, 31, 31, 31, 0, 0,128,224,255,255,255,255,255,255,255,255,255 }, + { 255,255,255,255,255,255,255,255,255,255,129, 0, 0, 0,126,126,126, 0, 0, 0,129,255,255,255,255,255,255,255,255,255 }, + { 1, 7, 15, 15, 31, 31, 31, 31, 31, 31, 31, 30, 28, 28, 28, 28, 28, 28, 28, 30, 31, 31, 31, 31, 31, 31, 15, 15, 7, 1 } + }; + + oled_set_cursor(1, 0); // start pos + oled_write_raw_P(layer[0], sizeof(layer[0])); + oled_set_cursor(1, 1); // move to next line + oled_write_raw_P(layer[1], sizeof(layer[1])); + oled_set_cursor(1, 2); // move to next line + oled_write_raw_P(layer[2], sizeof(layer[2])); + oled_set_cursor(1, 3); // move to next line + oled_write_raw_P(layer[3], sizeof(layer[3])); + + switch (get_highest_layer(layer_state)) { + case one : + oled_set_cursor(16, 0); // move 20 columns out + oled_write_raw_P(layer1[0], sizeof(layer1[0])); + oled_set_cursor(16, 1); // move 20 columns out + oled_write_raw_P(layer1[1], sizeof(layer1[1])); + oled_set_cursor(16, 2); // move 20 columns out + oled_write_raw_P(layer1[2], sizeof(layer1[2])); + oled_set_cursor(16, 3); // move 20 columns out + oled_write_raw_P(layer1[3], sizeof(layer1[3])); + break; + case two : + oled_set_cursor(16, 0); // move 20 columns out + oled_write_raw_P(layer2[0], sizeof(layer2[0])); + oled_set_cursor(16, 1); // move 20 columns out + oled_write_raw_P(layer2[1], sizeof(layer2[1])); + oled_set_cursor(16, 2); // move 20 columns out + oled_write_raw_P(layer2[2], sizeof(layer2[2])); + oled_set_cursor(16, 3); // move 20 columns out + oled_write_raw_P(layer2[3], sizeof(layer2[3])); + break; + case three : + oled_set_cursor(16, 0); // move 20 columns out + oled_write_raw_P(layer3[0], sizeof(layer3[0])); + oled_set_cursor(16, 1); // move 20 columns out + oled_write_raw_P(layer3[1], sizeof(layer3[1])); + oled_set_cursor(16, 2); // move 20 columns out + oled_write_raw_P(layer3[2], sizeof(layer3[2])); + oled_set_cursor(16, 3); // move 20 columns out + oled_write_raw_P(layer3[3], sizeof(layer3[3])); + break; + case four : + oled_set_cursor(16, 0); // move 20 columns out + oled_write_raw_P(layer4[0], sizeof(layer4[0])); + oled_set_cursor(16, 1); // move 20 columns out + oled_write_raw_P(layer4[1], sizeof(layer4[1])); + oled_set_cursor(16, 2); // move 20 columns out + oled_write_raw_P(layer4[2], sizeof(layer4[2])); + oled_set_cursor(16, 3); // move 20 columns out + oled_write_raw_P(layer4[3], sizeof(layer4[3])); + break; + case five : + oled_set_cursor(16, 0); // move 20 columns out + oled_write_raw_P(layer5[0], sizeof(layer5[0])); + oled_set_cursor(16, 1); // move 20 columns out + oled_write_raw_P(layer5[1], sizeof(layer5[1])); + oled_set_cursor(16, 2); // move 20 columns out + oled_write_raw_P(layer5[2], sizeof(layer5[2])); + oled_set_cursor(16, 3); // move 20 columns out + oled_write_raw_P(layer5[3], sizeof(layer5[3])); + break; + case six : + oled_set_cursor(16, 0); // move 20 columns out + oled_write_raw_P(layer6[0], sizeof(layer6[0])); + oled_set_cursor(16, 1); // move 20 columns out + oled_write_raw_P(layer6[1], sizeof(layer6[1])); + oled_set_cursor(16, 2); // move 20 columns out + oled_write_raw_P(layer6[2], sizeof(layer6[2])); + oled_set_cursor(16, 3); // move 20 columns out + oled_write_raw_P(layer6[3], sizeof(layer6[3])); + break; + case seven : + oled_set_cursor(16, 0); // move 20 columns out + oled_write_raw_P(layer7[0], sizeof(layer7[0])); + oled_set_cursor(16, 1); // move 20 columns out + oled_write_raw_P(layer7[1], sizeof(layer7[1])); + oled_set_cursor(16, 2); // move 20 columns out + oled_write_raw_P(layer7[2], sizeof(layer7[2])); + oled_set_cursor(16, 3); // move 20 columns out + oled_write_raw_P(layer7[3], sizeof(layer7[3])); + break; + case eight : + oled_set_cursor(16, 0); // move 20 columns out + oled_write_raw_P(layer8[0], sizeof(layer8[0])); + oled_set_cursor(16, 1); // move 20 columns out + oled_write_raw_P(layer8[1], sizeof(layer8[1])); + oled_set_cursor(16, 2); // move 20 columns out + oled_write_raw_P(layer8[2], sizeof(layer8[2])); + oled_set_cursor(16, 3); // move 20 columns out + oled_write_raw_P(layer8[3], sizeof(layer8[3])); + break; + } + } + return false; +} + +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_180; + } + +#endif \ No newline at end of file diff --git a/keyboards/macroflow_original/keymaps/default/rules.mk b/keyboards/macroflow_original/keymaps/default/rules.mk new file mode 100644 index 000000000000..e7b321af133a --- /dev/null +++ b/keyboards/macroflow_original/keymaps/default/rules.mk @@ -0,0 +1,3 @@ +VIA_ENABLE = yes +ENCODER_MAP_ENABLE = yes +OLED_ENABLE = yes \ No newline at end of file diff --git a/keyboards/macroflow_original/readme.md b/keyboards/macroflow_original/readme.md new file mode 100644 index 000000000000..e5ca67b4dae5 --- /dev/null +++ b/keyboards/macroflow_original/readme.md @@ -0,0 +1,27 @@ +# macroflow_original + +![macroflow_original](imgur.com image replace me!) + +*A 2x4 macropad with a built in encoder and OLED screen* + +* Keyboard Maintainer: [Patrickemm](https://github.com/Patrickemm) +* Hardware Supported: *ATmega32U4* +* Hardware Availability: *https://www.microchip.com/en-us/product/atmega32u4* + +Make example for this keyboard (after setting up your build environment): + + make macroflow_original:default + +Flashing example for this keyboard: + + make macroflow_original: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). + +## Bootloader + +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 +* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available From d32390a217354823f75610025ac21b36debf2f31 Mon Sep 17 00:00:00 2001 From: Patrick Mathern Date: Sun, 27 Oct 2024 09:42:23 -0400 Subject: [PATCH 02/20] Macroflow_Macropad --- keyboards/macroflow_original/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/macroflow_original/readme.md b/keyboards/macroflow_original/readme.md index e5ca67b4dae5..d53ea71421dd 100644 --- a/keyboards/macroflow_original/readme.md +++ b/keyboards/macroflow_original/readme.md @@ -1,6 +1,6 @@ # macroflow_original -![macroflow_original](imgur.com image replace me!) +![macroflow_original](https://imgur.com/a/lA0W1GW) *A 2x4 macropad with a built in encoder and OLED screen* From f50e487be95baccd81461a2a2f906ab0e83f3f82 Mon Sep 17 00:00:00 2001 From: Patrick Mathern Date: Sun, 27 Oct 2024 09:55:41 -0400 Subject: [PATCH 03/20] Macroflow_Macropad --- keyboards/macroflow_original/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/macroflow_original/readme.md b/keyboards/macroflow_original/readme.md index d53ea71421dd..f38802cebcd7 100644 --- a/keyboards/macroflow_original/readme.md +++ b/keyboards/macroflow_original/readme.md @@ -1,6 +1,6 @@ # macroflow_original -![macroflow_original](https://imgur.com/a/lA0W1GW) +
Macroflow Original White
*A 2x4 macropad with a built in encoder and OLED screen* From 9f8ba59ac14b99f8cee00d6cb03cf48559ebc9b0 Mon Sep 17 00:00:00 2001 From: Patrick Mathern Date: Sun, 27 Oct 2024 10:00:41 -0400 Subject: [PATCH 04/20] Adding My Macropad --- keyboards/macroflow_original/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/macroflow_original/readme.md b/keyboards/macroflow_original/readme.md index f38802cebcd7..d53ea71421dd 100644 --- a/keyboards/macroflow_original/readme.md +++ b/keyboards/macroflow_original/readme.md @@ -1,6 +1,6 @@ # macroflow_original -
Macroflow Original White
+![macroflow_original](https://imgur.com/a/lA0W1GW) *A 2x4 macropad with a built in encoder and OLED screen* From b06605d3a5f1cad6a02c775979fc06e5b3493942 Mon Sep 17 00:00:00 2001 From: Patrick Mathern Date: Sun, 27 Oct 2024 10:06:14 -0400 Subject: [PATCH 05/20] Adding Macroflow Macropad --- keyboards/macroflow_original/readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/keyboards/macroflow_original/readme.md b/keyboards/macroflow_original/readme.md index d53ea71421dd..cf65356becd9 100644 --- a/keyboards/macroflow_original/readme.md +++ b/keyboards/macroflow_original/readme.md @@ -1,6 +1,7 @@ # macroflow_original ![macroflow_original](https://imgur.com/a/lA0W1GW) +i.imgur.com/macroflow_original main photo.png *A 2x4 macropad with a built in encoder and OLED screen* From a47feed49ecc8b05f168bef8b17d874939d1b469 Mon Sep 17 00:00:00 2001 From: Patrick Mathern Date: Sun, 27 Oct 2024 10:08:04 -0400 Subject: [PATCH 06/20] Adding Macroflow Macropad --- keyboards/macroflow_original/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/macroflow_original/readme.md b/keyboards/macroflow_original/readme.md index cf65356becd9..0e442acf0e55 100644 --- a/keyboards/macroflow_original/readme.md +++ b/keyboards/macroflow_original/readme.md @@ -1,7 +1,7 @@ # macroflow_original ![macroflow_original](https://imgur.com/a/lA0W1GW) -i.imgur.com/macroflow_original main photo.png +i.imgur.com/lA0W1GW.png *A 2x4 macropad with a built in encoder and OLED screen* From f7bfe55a6468103a5671793b67b8df500bf997c8 Mon Sep 17 00:00:00 2001 From: Patrick Mathern Date: Sun, 27 Oct 2024 10:10:08 -0400 Subject: [PATCH 07/20] Adding Macroflow Macropad --- keyboards/macroflow_original/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/macroflow_original/readme.md b/keyboards/macroflow_original/readme.md index 0e442acf0e55..53f790cccb9e 100644 --- a/keyboards/macroflow_original/readme.md +++ b/keyboards/macroflow_original/readme.md @@ -1,7 +1,7 @@ # macroflow_original ![macroflow_original](https://imgur.com/a/lA0W1GW) -i.imgur.com/lA0W1GW.png +i.imgur.com/macroflow-original-white-lA0W1GW?third_party=1.png *A 2x4 macropad with a built in encoder and OLED screen* From bdc2c2dd43ed47642e6dd638c632d2dc6cb3f53c Mon Sep 17 00:00:00 2001 From: Patrick Mathern Date: Sun, 27 Oct 2024 10:16:02 -0400 Subject: [PATCH 08/20] Adding Macroflow Macropad --- keyboards/macroflow_original/readme.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/keyboards/macroflow_original/readme.md b/keyboards/macroflow_original/readme.md index 53f790cccb9e..f8973318a751 100644 --- a/keyboards/macroflow_original/readme.md +++ b/keyboards/macroflow_original/readme.md @@ -1,7 +1,6 @@ # macroflow_original -![macroflow_original](https://imgur.com/a/lA0W1GW) -i.imgur.com/macroflow-original-white-lA0W1GW?third_party=1.png +![Imgur](https://i.imgur.com/kDNVTI4l.jpeg) *A 2x4 macropad with a built in encoder and OLED screen* From 35b35df7ec6878c61577d3847e2f2ad0d6232ef4 Mon Sep 17 00:00:00 2001 From: Patrick Mathern Date: Sun, 27 Oct 2024 10:27:44 -0400 Subject: [PATCH 09/20] Adding Macroflow Macropad --- keyboards/macroflow_original/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/macroflow_original/readme.md b/keyboards/macroflow_original/readme.md index f8973318a751..5d25c3365083 100644 --- a/keyboards/macroflow_original/readme.md +++ b/keyboards/macroflow_original/readme.md @@ -1,6 +1,6 @@ # macroflow_original -![Imgur](https://i.imgur.com/kDNVTI4l.jpeg) +![Imgur](https://i.imgur.com/hIytJTl.png) *A 2x4 macropad with a built in encoder and OLED screen* From 00e8f38ace3b469a0bc93a946d4c1435560767c0 Mon Sep 17 00:00:00 2001 From: Patrick Mathern Date: Sun, 27 Oct 2024 17:29:06 -0400 Subject: [PATCH 10/20] Added License Headers --- keyboards/macroflow_original/keymaps/default/config.h | 3 +++ keyboards/macroflow_original/keymaps/default/keymap.c | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/keyboards/macroflow_original/keymaps/default/config.h b/keyboards/macroflow_original/keymaps/default/config.h index 3b8414354fb3..81e9639751a2 100644 --- a/keyboards/macroflow_original/keymaps/default/config.h +++ b/keyboards/macroflow_original/keymaps/default/config.h @@ -1,3 +1,6 @@ +// Copyright 2024 Patrick Mathern (@Patrickemm) +// SPDX-License-Identifier: GPL-2.0-or-later + #define DYNAMIC_KEYMAP_LAYER_COUNT 8 #define ENCODER_RESOLUTION 4 #define OLED_TIMEOUT 60000 \ No newline at end of file diff --git a/keyboards/macroflow_original/keymaps/default/keymap.c b/keyboards/macroflow_original/keymaps/default/keymap.c index 6ceca7df2e35..b4f6ae8ded41 100644 --- a/keyboards/macroflow_original/keymaps/default/keymap.c +++ b/keyboards/macroflow_original/keymaps/default/keymap.c @@ -1,5 +1,7 @@ -#include QMK_KEYBOARD_H +// Copyright 2024 Patrick Mathern (@Patrickemm) +// SPDX-License-Identifier: GPL-2.0-or-later +#include QMK_KEYBOARD_H // Define the keycode, `QK_USER` avoids collisions with existing keycodes enum keycodes { From 7033d079fead590519c63a4bca616355319cdc9d Mon Sep 17 00:00:00 2001 From: Patrick Mathern Date: Mon, 28 Oct 2024 16:57:12 -0400 Subject: [PATCH 11/20] Updated code for merge --- keyboards/macroflow_original/keyboard.json | 13 +- .../keymaps/default/config.h | 6 - .../keymaps/default/keymap.c | 207 +----------------- .../keymaps/default/rules.mk | 4 +- .../macroflow_original/macroflow_original.c | 194 ++++++++++++++++ keyboards/macroflow_original/readme.md | 2 +- 6 files changed, 212 insertions(+), 214 deletions(-) delete mode 100644 keyboards/macroflow_original/keymaps/default/config.h create mode 100644 keyboards/macroflow_original/macroflow_original.c diff --git a/keyboards/macroflow_original/keyboard.json b/keyboards/macroflow_original/keyboard.json index 249a5a1707e4..dacb28fc8f7a 100644 --- a/keyboards/macroflow_original/keyboard.json +++ b/keyboards/macroflow_original/keyboard.json @@ -2,32 +2,31 @@ "manufacturer": "Customacros", "keyboard_name": "Macroflow Original", "maintainer": "Patrickemm", - "bootloader": "caterina", "diode_direction": "COL2ROW", "features": { "bootmagic": true, - "command": false, - "console": false, "extrakey": true, "mousekey": true, "nkro": true, "encoder": true, - "oled": true, - "encodermap": true + "oled": true }, "matrix_pins": { "cols": ["B1", "B3", "B2", "F7"], "rows": ["E6", "B4", "B5"] }, - "processor": "atmega32u4", + "development_board": "promicro", "url": "https://github.com/Patrickemm", "usb": { "device_version": "1.0.0", "pid": "0x0002", "vid": "0x504D" }, + "dynamic_keymap": { + "layer_count": 8 + }, "layouts": { - "LAYOUT_macroflow_2x4": { + "LAYOUT": { "layout": [ {"matrix": [0, 0], "x": 0, "y": 0}, diff --git a/keyboards/macroflow_original/keymaps/default/config.h b/keyboards/macroflow_original/keymaps/default/config.h deleted file mode 100644 index 81e9639751a2..000000000000 --- a/keyboards/macroflow_original/keymaps/default/config.h +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright 2024 Patrick Mathern (@Patrickemm) -// SPDX-License-Identifier: GPL-2.0-or-later - -#define DYNAMIC_KEYMAP_LAYER_COUNT 8 -#define ENCODER_RESOLUTION 4 -#define OLED_TIMEOUT 60000 \ No newline at end of file diff --git a/keyboards/macroflow_original/keymaps/default/keymap.c b/keyboards/macroflow_original/keymaps/default/keymap.c index b4f6ae8ded41..72e01938aba0 100644 --- a/keyboards/macroflow_original/keymaps/default/keymap.c +++ b/keyboards/macroflow_original/keymaps/default/keymap.c @@ -1,6 +1,7 @@ // Copyright 2024 Patrick Mathern (@Patrickemm) // SPDX-License-Identifier: GPL-2.0-or-later +#include "quantum.h" #include QMK_KEYBOARD_H // Define the keycode, `QK_USER` avoids collisions with existing keycodes @@ -8,55 +9,44 @@ enum keycodes { KC_CYCLE_LAYERS = QK_USER, }; -enum layer_names { - one, - two, - three, - four, - five, - six, - seven, - eight -}; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_macroflow_2x4( + [0] = LAYOUT( KC_0, KC_CYCLE_LAYERS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8 ), - [1] = LAYOUT_macroflow_2x4( + [1] = LAYOUT( KC_9, KC_CYCLE_LAYERS, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H ), - [2] = LAYOUT_macroflow_2x4( + [2] = LAYOUT( KC_I, KC_CYCLE_LAYERS, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, KC_P, KC_Q ), - [3] = LAYOUT_macroflow_2x4( + [3] = LAYOUT( KC_R, KC_CYCLE_LAYERS, KC_S, KC_T, KC_U, KC_V, KC_W, KC_X, KC_Y, KC_Z ), - [4] = LAYOUT_macroflow_2x4( + [4] = LAYOUT( KC_TRNS, KC_CYCLE_LAYERS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), - [5] = LAYOUT_macroflow_2x4( + [5] = LAYOUT( KC_TRNS, KC_CYCLE_LAYERS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), - [6] = LAYOUT_macroflow_2x4( + [6] = LAYOUT( KC_TRNS, KC_CYCLE_LAYERS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), - [7] = LAYOUT_macroflow_2x4( + [7] = LAYOUT( KC_TRNS, KC_CYCLE_LAYERS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS @@ -66,7 +56,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // 1st layer on the cycle #define LAYER_CYCLE_START 0 // Last layer on the cycle -#define LAYER_CYCLE_END 8 +#define LAYER_CYCLE_END 7 // Add the behaviour of this new keycode bool process_record_user(uint16_t keycode, keyrecord_t *record) { @@ -113,183 +103,6 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { #ifdef OLED_ENABLE -#ifndef SHOW_LOGO -# define SHOW_LOGO 2500 -#endif -static uint16_t oled_logo_timer = 0; -static bool has_startup_ran = false; - -bool oled_task_user(void) { - if (!has_startup_ran) { - static const char startUp [] PROGMEM = { - // 'startUp', 128x32px - 0, 0, 0,128,192,192,128,128, 0, 0,192,192, 0, 0, 0,192,192, 0, 0,128,128,192,192,128, 0, 0,192,192,192,192,192,192,192, 0, 0,128,128,192,192,128, 0, 0, 0,192,192,128, 0, 0, 0, 0,192,192,128, 0, 0, 0,128,192,192, 0, 0, 0, 0, 0,128,128,192,192,128, 0, 0,128,192,192,192,192,128,128, 0, 0, 0,128,192,192,192,128, 0, 0, 0,128,128,192,192,128, 0, 0, 0, 0, 0, 0, 0,128,192,192,128, 0, 0, 0, 0,128,192,192,128,128, 0, 0,192,192,192, 0, 0, 0, 0,128,192,192, 0,0, - 0, 0,255,255, 1, 1, 1, 31, 30, 0,255,255, 0, 0, 0,255,255, 0, 30,127,241,193,129, 7, 15, 0, 1, 1, 1,255,255, 1, 1, 0,254,255, 1, 1, 1,255,255, 0, 0,255, 63,255,224, 0,128,254, 63,255,255, 0, 0,224,255, 15,127,255,192, 0, 0,254,255, 1, 1, 1, 31, 31, 0,255,255,129,129,129,255,127, 0, 0,255,255, 1, 1, 1,255,255, 0, 30,127,241,193,129, 7, 15, 0, 0, 0, 0,252,255, 3, 1, 1, 3, 31, 30, 0,255,255, 1, 1, 1,255,254, 0,255,255,127,252, 0, 0,240,255,255,255, 0, 0, 0, 0,255,255,128,128,192,252, 60, 0,127,255,128,128,128,255,127, 0,120,248,128,129,131,255,254, 0, 0, 0, 0,255,255, 0, 0, 0,127,255,128,128,128,255,255, 0, 0,255, 0, 3,255,248,255, 15, 0,255,255, 0,248,255, 27, 24, 24, 63,255,224, 0,127,255,128,128,128,252,124, 0,255,255, 3, 1, 3,127,254,240, 0,127,255,128,128,128,255,127, 0,120,248,128,129,131,255,254, 0,128,128, 0, 63,255,192,128,128,224,252, 60, 0,255,255,128,128,128,255,127, 0,255,255, 0, 31,255,252,127, 1,255,255, 0, 0,0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0 - }; - oled_write_raw_P(startUp, sizeof(startUp)); - if (timer_elapsed(oled_logo_timer) >= SHOW_LOGO) { - has_startup_ran = true; - oled_clear(); - } - } else { - static const char PROGMEM layer[4][67+1] = { - { 224,224,224,224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,224,224,224,224,224, 0, 0, 0, 0, 0,224,224,224,128, 0, 0, 0, 0,128,224,224,224, 0, 0, 0,224,224,224,224,224,224,224,224,224,224,224, 0, 0,224,224,224,224,224,224,224,224,224,192,128, 0 }, - { 255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240,255,255,127, 15,127,255,255,240, 0, 0, 0, 0, 3, 15,127,252,240,240,252,127, 15, 3, 0, 0, 0, 0,255,255,255,255,192,192,192,192,192, 0, 0, 0, 0,255,255,255,255,192,192,192,225,255,255,255,127 }, - { 255,255,255,255,192,192,192,192,192,192,192, 0, 0,192,254,255,255,127, 28, 28, 28,127,255,255,254,192, 0, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,129,129,129,129,129,128,128, 0, 0,255,255,255,255, 1, 1, 7,127,255,255,248,192 }, - { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 3, 3, 3, 3, 0, 0, 0, 0, 0, 3, 3, 3, 3, 0, 0, 0, 0, 0, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 3, 3, 3, 3, 0, 0, 0, 0, 3, 3, 3, 3 }, - }; - - static const char PROGMEM layer1[4][30+1] = { - { 128,224,240,240,248,248,248,248,248,248,248,120,120, 56, 56, 24, 24, 24,248,248,248,248,248,248,248,248,240,240,224,128 }, - { 255,255,255,255,255,255,255,255,255,255,255,252,252,252, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255 }, - { 255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255 }, - { 1, 7, 15, 15, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 28, 28, 28, 28, 31, 31, 31, 31, 31, 31, 31, 31, 15, 15, 7, 1 } - }; - - static const char PROGMEM layer2[4][30+1] = { - { 128,224,240,240,248,248,248,248,248,248,120, 56, 24, 24, 24, 24, 24, 24, 56,120,248,248,248,248,248,248,240,240,224,128 }, - { 255,255,255,255,255,255,255,255,255,255,248,248,248,254,255, 63, 6, 0,128,224,255,255,255,255,255,255,255,255,255,255 }, - { 255,255,255,255,255,255,255,255,255,255, 63, 15, 7, 1, 64,112,120,126,127,127,255,255,255,255,255,255,255,255,255,255 }, - { 1, 7, 15, 15, 31, 31, 31, 31, 31, 31, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 31, 31, 31, 31, 31, 31, 15, 15, 7, 1 } - }; - - static const char PROGMEM layer3[4][30+1] = { - { 128,224,240,240,248,248,248,248,248,248,120, 56, 24, 24, 24, 24, 24, 24, 56,120,248,248,248,248,248,248,240,240,224,128 }, - { 255,255,255,255,255,255,255,255,255,255,248,248,248, 62, 63, 63, 30, 0,128,192,255,255,255,255,255,255,255,255,255,255 }, - { 255,255,255,255,255,255,255,255,255,255, 31, 31, 31,126,254,254,124, 0, 0, 1,255,255,255,255,255,255,255,255,255,255 }, - { 1, 7, 15, 15, 31, 31, 31, 31, 31, 31, 30, 28, 24, 24, 24, 24, 24, 24, 28, 30, 31, 31, 31, 31, 31, 31, 15, 15, 7, 1 } - }; - - static const char PROGMEM layer4[4][30+1] = { - { 128,224,240,240,248,248,248,248,248,248,248,248,248,248,120, 24, 24, 24, 24,248,248,248,248,248,248,248,240,240,224,128 }, - { 255,255,255,255,255,255,255,255,255,255,255, 63, 7, 1,192,240, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255 }, - { 255,255,255,255,255,255,255,255,255,255,192,192,192,194,195,195, 0, 0, 0,195,195,255,255,255,255,255,255,255,255,255 }, - { 1, 7, 15, 15, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 28, 28, 28, 31, 31, 31, 31, 31, 31, 31, 15, 15, 7, 1 } - }; - - static const char PROGMEM layer5[4][30+1] = { - { 128,224,240,240,248,248,248,248,248,248, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,248,248,248,248,248,248,240,240,224,128 }, - { 255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0,143,143,143, 15, 15, 31,255,255,255,255,255,255,255,255,255,255 }, - { 255,255,255,255,255,255,255,255,255,255,142, 14, 14, 30,127,127,127, 0, 0, 0,224,255,255,255,255,255,255,255,255,255 }, - { 1, 7, 15, 15, 31, 31, 31, 31, 31, 31, 31, 30, 28, 28, 28, 28, 28, 28, 30, 31, 31, 31, 31, 31, 31, 31, 15, 15, 7, 1 } - }; - - static const char PROGMEM layer6[4][30+1] = { - { 128,224,240,240,248,248,248,248,248,248,248, 56, 24, 24, 24, 24, 24, 24, 24, 56,248,248,248,248,248,248,240,240,224,128 }, - { 255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0, 31, 31, 31, 24, 24, 56,255,255,255,255,255,255,255,255,255,255 }, - { 255,255,255,255,255,255,255,255,255,255,128, 0, 0, 0,127,127,127, 0, 0, 0,128,255,255,255,255,255,255,255,255,255 }, - { 1, 7, 15, 15, 31, 31, 31, 31, 31, 31, 31, 30, 28, 28, 28, 28, 28, 28, 28, 30, 31, 31, 31, 31, 31, 31, 15, 15, 7, 1 } - }; - - static const char PROGMEM layer7[4][30+1] = { - { 128,224,240,240,248,248,248,248,248,248, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,248,248,248,248,248,248,240,240,224,128 }, - { 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 31, 3, 0,128,248,255,255,255,255,255,255,255,255,255,255 }, - { 255,255,255,255,255,255,255,255,255,255,255,255,127, 15, 1, 0,192,252,255,255,255,255,255,255,255,255,255,255,255,255 }, - { 1, 7, 15, 15, 31, 31, 31, 31, 31, 31, 31, 31, 28, 28, 28, 28, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 15, 15, 7, 1 } - }; - - static const char PROGMEM layer8[4][30+1] = { - { 128,224,240,240,248,248,248,248,248,248,248, 56, 24, 24, 24, 24, 24, 24, 24, 56,248,248,248,248,248,248,240,240,224,128 }, - { 255,255,255,255,255,255,255,255,255,255,224,128, 0, 0, 31, 31, 31, 0, 0,128,224,255,255,255,255,255,255,255,255,255 }, - { 255,255,255,255,255,255,255,255,255,255,129, 0, 0, 0,126,126,126, 0, 0, 0,129,255,255,255,255,255,255,255,255,255 }, - { 1, 7, 15, 15, 31, 31, 31, 31, 31, 31, 31, 30, 28, 28, 28, 28, 28, 28, 28, 30, 31, 31, 31, 31, 31, 31, 15, 15, 7, 1 } - }; - - oled_set_cursor(1, 0); // start pos - oled_write_raw_P(layer[0], sizeof(layer[0])); - oled_set_cursor(1, 1); // move to next line - oled_write_raw_P(layer[1], sizeof(layer[1])); - oled_set_cursor(1, 2); // move to next line - oled_write_raw_P(layer[2], sizeof(layer[2])); - oled_set_cursor(1, 3); // move to next line - oled_write_raw_P(layer[3], sizeof(layer[3])); - - switch (get_highest_layer(layer_state)) { - case one : - oled_set_cursor(16, 0); // move 20 columns out - oled_write_raw_P(layer1[0], sizeof(layer1[0])); - oled_set_cursor(16, 1); // move 20 columns out - oled_write_raw_P(layer1[1], sizeof(layer1[1])); - oled_set_cursor(16, 2); // move 20 columns out - oled_write_raw_P(layer1[2], sizeof(layer1[2])); - oled_set_cursor(16, 3); // move 20 columns out - oled_write_raw_P(layer1[3], sizeof(layer1[3])); - break; - case two : - oled_set_cursor(16, 0); // move 20 columns out - oled_write_raw_P(layer2[0], sizeof(layer2[0])); - oled_set_cursor(16, 1); // move 20 columns out - oled_write_raw_P(layer2[1], sizeof(layer2[1])); - oled_set_cursor(16, 2); // move 20 columns out - oled_write_raw_P(layer2[2], sizeof(layer2[2])); - oled_set_cursor(16, 3); // move 20 columns out - oled_write_raw_P(layer2[3], sizeof(layer2[3])); - break; - case three : - oled_set_cursor(16, 0); // move 20 columns out - oled_write_raw_P(layer3[0], sizeof(layer3[0])); - oled_set_cursor(16, 1); // move 20 columns out - oled_write_raw_P(layer3[1], sizeof(layer3[1])); - oled_set_cursor(16, 2); // move 20 columns out - oled_write_raw_P(layer3[2], sizeof(layer3[2])); - oled_set_cursor(16, 3); // move 20 columns out - oled_write_raw_P(layer3[3], sizeof(layer3[3])); - break; - case four : - oled_set_cursor(16, 0); // move 20 columns out - oled_write_raw_P(layer4[0], sizeof(layer4[0])); - oled_set_cursor(16, 1); // move 20 columns out - oled_write_raw_P(layer4[1], sizeof(layer4[1])); - oled_set_cursor(16, 2); // move 20 columns out - oled_write_raw_P(layer4[2], sizeof(layer4[2])); - oled_set_cursor(16, 3); // move 20 columns out - oled_write_raw_P(layer4[3], sizeof(layer4[3])); - break; - case five : - oled_set_cursor(16, 0); // move 20 columns out - oled_write_raw_P(layer5[0], sizeof(layer5[0])); - oled_set_cursor(16, 1); // move 20 columns out - oled_write_raw_P(layer5[1], sizeof(layer5[1])); - oled_set_cursor(16, 2); // move 20 columns out - oled_write_raw_P(layer5[2], sizeof(layer5[2])); - oled_set_cursor(16, 3); // move 20 columns out - oled_write_raw_P(layer5[3], sizeof(layer5[3])); - break; - case six : - oled_set_cursor(16, 0); // move 20 columns out - oled_write_raw_P(layer6[0], sizeof(layer6[0])); - oled_set_cursor(16, 1); // move 20 columns out - oled_write_raw_P(layer6[1], sizeof(layer6[1])); - oled_set_cursor(16, 2); // move 20 columns out - oled_write_raw_P(layer6[2], sizeof(layer6[2])); - oled_set_cursor(16, 3); // move 20 columns out - oled_write_raw_P(layer6[3], sizeof(layer6[3])); - break; - case seven : - oled_set_cursor(16, 0); // move 20 columns out - oled_write_raw_P(layer7[0], sizeof(layer7[0])); - oled_set_cursor(16, 1); // move 20 columns out - oled_write_raw_P(layer7[1], sizeof(layer7[1])); - oled_set_cursor(16, 2); // move 20 columns out - oled_write_raw_P(layer7[2], sizeof(layer7[2])); - oled_set_cursor(16, 3); // move 20 columns out - oled_write_raw_P(layer7[3], sizeof(layer7[3])); - break; - case eight : - oled_set_cursor(16, 0); // move 20 columns out - oled_write_raw_P(layer8[0], sizeof(layer8[0])); - oled_set_cursor(16, 1); // move 20 columns out - oled_write_raw_P(layer8[1], sizeof(layer8[1])); - oled_set_cursor(16, 2); // move 20 columns out - oled_write_raw_P(layer8[2], sizeof(layer8[2])); - oled_set_cursor(16, 3); // move 20 columns out - oled_write_raw_P(layer8[3], sizeof(layer8[3])); - break; - } - } - return false; -} - oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_180; } diff --git a/keyboards/macroflow_original/keymaps/default/rules.mk b/keyboards/macroflow_original/keymaps/default/rules.mk index e7b321af133a..a40474b4d5c7 100644 --- a/keyboards/macroflow_original/keymaps/default/rules.mk +++ b/keyboards/macroflow_original/keymaps/default/rules.mk @@ -1,3 +1 @@ -VIA_ENABLE = yes -ENCODER_MAP_ENABLE = yes -OLED_ENABLE = yes \ No newline at end of file +ENCODER_MAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/macroflow_original/macroflow_original.c b/keyboards/macroflow_original/macroflow_original.c new file mode 100644 index 000000000000..ae77d4835f60 --- /dev/null +++ b/keyboards/macroflow_original/macroflow_original.c @@ -0,0 +1,194 @@ +#include "quantum.h" + +static uint16_t oled_logo_timer = 0; +static bool has_startup_ran = false; + +#ifndef SHOW_LOGO +# define SHOW_LOGO 2500 +#endif + +enum layer_names { + one, + two, + three, + four, + five, + six, + seven, + eight +}; + +bool oled_task_kb(void) { + if (!oled_task_user()) { + return false; + } + if (!has_startup_ran) { + static const char startUp [] PROGMEM = { + // 'startUp', 128x32px + 0, 0, 0,128,192,192,128,128, 0, 0,192,192, 0, 0, 0,192,192, 0, 0,128,128,192,192,128, 0, 0,192,192,192,192,192,192,192, 0, 0,128,128,192,192,128, 0, 0, 0,192,192,128, 0, 0, 0, 0,192,192,128, 0, 0, 0,128,192,192, 0, 0, 0, 0, 0,128,128,192,192,128, 0, 0,128,192,192,192,192,128,128, 0, 0, 0,128,192,192,192,128, 0, 0, 0,128,128,192,192,128, 0, 0, 0, 0, 0, 0, 0,128,192,192,128, 0, 0, 0, 0,128,192,192,128,128, 0, 0,192,192,192, 0, 0, 0, 0,128,192,192, 0,0, + 0, 0,255,255, 1, 1, 1, 31, 30, 0,255,255, 0, 0, 0,255,255, 0, 30,127,241,193,129, 7, 15, 0, 1, 1, 1,255,255, 1, 1, 0,254,255, 1, 1, 1,255,255, 0, 0,255, 63,255,224, 0,128,254, 63,255,255, 0, 0,224,255, 15,127,255,192, 0, 0,254,255, 1, 1, 1, 31, 31, 0,255,255,129,129,129,255,127, 0, 0,255,255, 1, 1, 1,255,255, 0, 30,127,241,193,129, 7, 15, 0, 0, 0, 0,252,255, 3, 1, 1, 3, 31, 30, 0,255,255, 1, 1, 1,255,254, 0,255,255,127,252, 0, 0,240,255,255,255, 0, 0, 0, 0,255,255,128,128,192,252, 60, 0,127,255,128,128,128,255,127, 0,120,248,128,129,131,255,254, 0, 0, 0, 0,255,255, 0, 0, 0,127,255,128,128,128,255,255, 0, 0,255, 0, 3,255,248,255, 15, 0,255,255, 0,248,255, 27, 24, 24, 63,255,224, 0,127,255,128,128,128,252,124, 0,255,255, 3, 1, 3,127,254,240, 0,127,255,128,128,128,255,127, 0,120,248,128,129,131,255,254, 0,128,128, 0, 63,255,192,128,128,224,252, 60, 0,255,255,128,128,128,255,127, 0,255,255, 0, 31,255,252,127, 1,255,255, 0, 0,0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0 + }; + oled_write_raw_P(startUp, sizeof(startUp)); + if (timer_elapsed(oled_logo_timer) >= SHOW_LOGO) { + has_startup_ran = true; + oled_clear(); + } + } else { + static const char PROGMEM layerImage[4][67+1] = { + { 224,224,224,224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,224,224,224,224,224, 0, 0, 0, 0, 0,224,224,224,128, 0, 0, 0, 0,128,224,224,224, 0, 0, 0,224,224,224,224,224,224,224,224,224,224,224, 0, 0,224,224,224,224,224,224,224,224,224,192,128, 0 }, + { 255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240,255,255,127, 15,127,255,255,240, 0, 0, 0, 0, 3, 15,127,252,240,240,252,127, 15, 3, 0, 0, 0, 0,255,255,255,255,192,192,192,192,192, 0, 0, 0, 0,255,255,255,255,192,192,192,225,255,255,255,127 }, + { 255,255,255,255,192,192,192,192,192,192,192, 0, 0,192,254,255,255,127, 28, 28, 28,127,255,255,254,192, 0, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,129,129,129,129,129,128,128, 0, 0,255,255,255,255, 1, 1, 7,127,255,255,248,192 }, + { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 3, 3, 3, 3, 0, 0, 0, 0, 0, 3, 3, 3, 3, 0, 0, 0, 0, 0, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 3, 3, 3, 3, 0, 0, 0, 0, 3, 3, 3, 3 }, + }; + + static const char PROGMEM layer1[4][30+1] = { + { 128,224,240,240,248,248,248,248,248,248,248,120,120, 56, 56, 24, 24, 24,248,248,248,248,248,248,248,248,240,240,224,128 }, + { 255,255,255,255,255,255,255,255,255,255,255,252,252,252, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255 }, + { 255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255 }, + { 1, 7, 15, 15, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 28, 28, 28, 28, 31, 31, 31, 31, 31, 31, 31, 31, 15, 15, 7, 1 } + }; + + static const char PROGMEM layer2[4][30+1] = { + { 128,224,240,240,248,248,248,248,248,248,120, 56, 24, 24, 24, 24, 24, 24, 56,120,248,248,248,248,248,248,240,240,224,128 }, + { 255,255,255,255,255,255,255,255,255,255,248,248,248,254,255, 63, 6, 0,128,224,255,255,255,255,255,255,255,255,255,255 }, + { 255,255,255,255,255,255,255,255,255,255, 63, 15, 7, 1, 64,112,120,126,127,127,255,255,255,255,255,255,255,255,255,255 }, + { 1, 7, 15, 15, 31, 31, 31, 31, 31, 31, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 31, 31, 31, 31, 31, 31, 15, 15, 7, 1 } + }; + + static const char PROGMEM layer3[4][30+1] = { + { 128,224,240,240,248,248,248,248,248,248,120, 56, 24, 24, 24, 24, 24, 24, 56,120,248,248,248,248,248,248,240,240,224,128 }, + { 255,255,255,255,255,255,255,255,255,255,248,248,248, 62, 63, 63, 30, 0,128,192,255,255,255,255,255,255,255,255,255,255 }, + { 255,255,255,255,255,255,255,255,255,255, 31, 31, 31,126,254,254,124, 0, 0, 1,255,255,255,255,255,255,255,255,255,255 }, + { 1, 7, 15, 15, 31, 31, 31, 31, 31, 31, 30, 28, 24, 24, 24, 24, 24, 24, 28, 30, 31, 31, 31, 31, 31, 31, 15, 15, 7, 1 } + }; + + static const char PROGMEM layer4[4][30+1] = { + { 128,224,240,240,248,248,248,248,248,248,248,248,248,248,120, 24, 24, 24, 24,248,248,248,248,248,248,248,240,240,224,128 }, + { 255,255,255,255,255,255,255,255,255,255,255, 63, 7, 1,192,240, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255 }, + { 255,255,255,255,255,255,255,255,255,255,192,192,192,194,195,195, 0, 0, 0,195,195,255,255,255,255,255,255,255,255,255 }, + { 1, 7, 15, 15, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 28, 28, 28, 31, 31, 31, 31, 31, 31, 31, 15, 15, 7, 1 } + }; + + static const char PROGMEM layer5[4][30+1] = { + { 128,224,240,240,248,248,248,248,248,248, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,248,248,248,248,248,248,240,240,224,128 }, + { 255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0,143,143,143, 15, 15, 31,255,255,255,255,255,255,255,255,255,255 }, + { 255,255,255,255,255,255,255,255,255,255,142, 14, 14, 30,127,127,127, 0, 0, 0,224,255,255,255,255,255,255,255,255,255 }, + { 1, 7, 15, 15, 31, 31, 31, 31, 31, 31, 31, 30, 28, 28, 28, 28, 28, 28, 30, 31, 31, 31, 31, 31, 31, 31, 15, 15, 7, 1 } + }; + + static const char PROGMEM layer6[4][30+1] = { + { 128,224,240,240,248,248,248,248,248,248,248, 56, 24, 24, 24, 24, 24, 24, 24, 56,248,248,248,248,248,248,240,240,224,128 }, + { 255,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0, 31, 31, 31, 24, 24, 56,255,255,255,255,255,255,255,255,255,255 }, + { 255,255,255,255,255,255,255,255,255,255,128, 0, 0, 0,127,127,127, 0, 0, 0,128,255,255,255,255,255,255,255,255,255 }, + { 1, 7, 15, 15, 31, 31, 31, 31, 31, 31, 31, 30, 28, 28, 28, 28, 28, 28, 28, 30, 31, 31, 31, 31, 31, 31, 15, 15, 7, 1 } + }; + + static const char PROGMEM layer7[4][30+1] = { + { 128,224,240,240,248,248,248,248,248,248, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,248,248,248,248,248,248,240,240,224,128 }, + { 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 31, 3, 0,128,248,255,255,255,255,255,255,255,255,255,255 }, + { 255,255,255,255,255,255,255,255,255,255,255,255,127, 15, 1, 0,192,252,255,255,255,255,255,255,255,255,255,255,255,255 }, + { 1, 7, 15, 15, 31, 31, 31, 31, 31, 31, 31, 31, 28, 28, 28, 28, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 15, 15, 7, 1 } + }; + + static const char PROGMEM layer8[4][30+1] = { + { 128,224,240,240,248,248,248,248,248,248,248, 56, 24, 24, 24, 24, 24, 24, 24, 56,248,248,248,248,248,248,240,240,224,128 }, + { 255,255,255,255,255,255,255,255,255,255,224,128, 0, 0, 31, 31, 31, 0, 0,128,224,255,255,255,255,255,255,255,255,255 }, + { 255,255,255,255,255,255,255,255,255,255,129, 0, 0, 0,126,126,126, 0, 0, 0,129,255,255,255,255,255,255,255,255,255 }, + { 1, 7, 15, 15, 31, 31, 31, 31, 31, 31, 31, 30, 28, 28, 28, 28, 28, 28, 28, 30, 31, 31, 31, 31, 31, 31, 15, 15, 7, 1 } + }; + + oled_set_cursor(1, 0); // start pos + oled_write_raw_P(layerImage[0], sizeof(layerImage[0])); + oled_set_cursor(1, 1); // move to next line + oled_write_raw_P(layerImage[1], sizeof(layerImage[1])); + oled_set_cursor(1, 2); // move to next line + oled_write_raw_P(layerImage[2], sizeof(layerImage[2])); + oled_set_cursor(1, 3); // move to next line + oled_write_raw_P(layerImage[3], sizeof(layerImage[3])); + + switch (get_highest_layer(layer_state)) { + case one : + oled_set_cursor(16, 0); // move 20 columns out + oled_write_raw_P(layer1[0], sizeof(layer1[0])); + oled_set_cursor(16, 1); // move 20 columns out + oled_write_raw_P(layer1[1], sizeof(layer1[1])); + oled_set_cursor(16, 2); // move 20 columns out + oled_write_raw_P(layer1[2], sizeof(layer1[2])); + oled_set_cursor(16, 3); // move 20 columns out + oled_write_raw_P(layer1[3], sizeof(layer1[3])); + break; + case two : + oled_set_cursor(16, 0); // move 20 columns out + oled_write_raw_P(layer2[0], sizeof(layer2[0])); + oled_set_cursor(16, 1); // move 20 columns out + oled_write_raw_P(layer2[1], sizeof(layer2[1])); + oled_set_cursor(16, 2); // move 20 columns out + oled_write_raw_P(layer2[2], sizeof(layer2[2])); + oled_set_cursor(16, 3); // move 20 columns out + oled_write_raw_P(layer2[3], sizeof(layer2[3])); + break; + case three : + oled_set_cursor(16, 0); // move 20 columns out + oled_write_raw_P(layer3[0], sizeof(layer3[0])); + oled_set_cursor(16, 1); // move 20 columns out + oled_write_raw_P(layer3[1], sizeof(layer3[1])); + oled_set_cursor(16, 2); // move 20 columns out + oled_write_raw_P(layer3[2], sizeof(layer3[2])); + oled_set_cursor(16, 3); // move 20 columns out + oled_write_raw_P(layer3[3], sizeof(layer3[3])); + break; + case four : + oled_set_cursor(16, 0); // move 20 columns out + oled_write_raw_P(layer4[0], sizeof(layer4[0])); + oled_set_cursor(16, 1); // move 20 columns out + oled_write_raw_P(layer4[1], sizeof(layer4[1])); + oled_set_cursor(16, 2); // move 20 columns out + oled_write_raw_P(layer4[2], sizeof(layer4[2])); + oled_set_cursor(16, 3); // move 20 columns out + oled_write_raw_P(layer4[3], sizeof(layer4[3])); + break; + case five : + oled_set_cursor(16, 0); // move 20 columns out + oled_write_raw_P(layer5[0], sizeof(layer5[0])); + oled_set_cursor(16, 1); // move 20 columns out + oled_write_raw_P(layer5[1], sizeof(layer5[1])); + oled_set_cursor(16, 2); // move 20 columns out + oled_write_raw_P(layer5[2], sizeof(layer5[2])); + oled_set_cursor(16, 3); // move 20 columns out + oled_write_raw_P(layer5[3], sizeof(layer5[3])); + break; + case six : + oled_set_cursor(16, 0); // move 20 columns out + oled_write_raw_P(layer6[0], sizeof(layer6[0])); + oled_set_cursor(16, 1); // move 20 columns out + oled_write_raw_P(layer6[1], sizeof(layer6[1])); + oled_set_cursor(16, 2); // move 20 columns out + oled_write_raw_P(layer6[2], sizeof(layer6[2])); + oled_set_cursor(16, 3); // move 20 columns out + oled_write_raw_P(layer6[3], sizeof(layer6[3])); + break; + case seven : + oled_set_cursor(16, 0); // move 20 columns out + oled_write_raw_P(layer7[0], sizeof(layer7[0])); + oled_set_cursor(16, 1); // move 20 columns out + oled_write_raw_P(layer7[1], sizeof(layer7[1])); + oled_set_cursor(16, 2); // move 20 columns out + oled_write_raw_P(layer7[2], sizeof(layer7[2])); + oled_set_cursor(16, 3); // move 20 columns out + oled_write_raw_P(layer7[3], sizeof(layer7[3])); + break; + case eight : + oled_set_cursor(16, 0); // move 20 columns out + oled_write_raw_P(layer8[0], sizeof(layer8[0])); + oled_set_cursor(16, 1); // move 20 columns out + oled_write_raw_P(layer8[1], sizeof(layer8[1])); + oled_set_cursor(16, 2); // move 20 columns out + oled_write_raw_P(layer8[2], sizeof(layer8[2])); + oled_set_cursor(16, 3); // move 20 columns out + oled_write_raw_P(layer8[3], sizeof(layer8[3])); + break; + } + } + return false; + return true; +} \ No newline at end of file diff --git a/keyboards/macroflow_original/readme.md b/keyboards/macroflow_original/readme.md index 5d25c3365083..9c3eb53ea5fa 100644 --- a/keyboards/macroflow_original/readme.md +++ b/keyboards/macroflow_original/readme.md @@ -6,7 +6,7 @@ * Keyboard Maintainer: [Patrickemm](https://github.com/Patrickemm) * Hardware Supported: *ATmega32U4* -* Hardware Availability: *https://www.microchip.com/en-us/product/atmega32u4* +* Hardware Availability: *https://keeb.io/products/pro-micro-usb-c-version-5v-16mhz-arduino-compatible-atmega32u4* Make example for this keyboard (after setting up your build environment): From 00d0630b0f7ed2949750fb6c0ccb4bee28e3dd26 Mon Sep 17 00:00:00 2001 From: Patrick Mathern Date: Mon, 28 Oct 2024 21:31:07 -0400 Subject: [PATCH 12/20] Added License Header --- keyboards/macroflow_original/macroflow_original.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/keyboards/macroflow_original/macroflow_original.c b/keyboards/macroflow_original/macroflow_original.c index ae77d4835f60..ca664ad56e1e 100644 --- a/keyboards/macroflow_original/macroflow_original.c +++ b/keyboards/macroflow_original/macroflow_original.c @@ -1,3 +1,6 @@ +// Copyright 2024 Patrick Mathern (@Patrickemm) +// SPDX-License-Identifier: GPL-2.0-or-later + #include "quantum.h" static uint16_t oled_logo_timer = 0; From d4374bfe46abfc105d64ed437570f1dcf001c2e5 Mon Sep 17 00:00:00 2001 From: Patrick Mathern Date: Wed, 30 Oct 2024 17:17:55 -0400 Subject: [PATCH 13/20] Added Encoder Map --- keyboards/macroflow_original/keyboard.json | 1 + 1 file changed, 1 insertion(+) diff --git a/keyboards/macroflow_original/keyboard.json b/keyboards/macroflow_original/keyboard.json index dacb28fc8f7a..20edb712cb36 100644 --- a/keyboards/macroflow_original/keyboard.json +++ b/keyboards/macroflow_original/keyboard.json @@ -9,6 +9,7 @@ "mousekey": true, "nkro": true, "encoder": true, + "encodermap": true, "oled": true }, "matrix_pins": { From c07e6a46458ea5f6fe44de61dd7e027fb3cef47c Mon Sep 17 00:00:00 2001 From: Patrick Mathern Date: Wed, 30 Oct 2024 18:32:40 -0400 Subject: [PATCH 14/20] Updated Files --- keyboards/macroflow_original/keyboard.json | 1 - keyboards/macroflow_original/keymaps/default/keymap.c | 9 --------- keyboards/macroflow_original/macroflow_original.c | 5 ++++- keyboards/macroflow_original/readme.md | 4 ++-- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/keyboards/macroflow_original/keyboard.json b/keyboards/macroflow_original/keyboard.json index 20edb712cb36..dacb28fc8f7a 100644 --- a/keyboards/macroflow_original/keyboard.json +++ b/keyboards/macroflow_original/keyboard.json @@ -9,7 +9,6 @@ "mousekey": true, "nkro": true, "encoder": true, - "encodermap": true, "oled": true }, "matrix_pins": { diff --git a/keyboards/macroflow_original/keymaps/default/keymap.c b/keyboards/macroflow_original/keymaps/default/keymap.c index 72e01938aba0..aa7cf69c123e 100644 --- a/keyboards/macroflow_original/keymaps/default/keymap.c +++ b/keyboards/macroflow_original/keymaps/default/keymap.c @@ -1,7 +1,6 @@ // Copyright 2024 Patrick Mathern (@Patrickemm) // SPDX-License-Identifier: GPL-2.0-or-later -#include "quantum.h" #include QMK_KEYBOARD_H // Define the keycode, `QK_USER` avoids collisions with existing keycodes @@ -99,12 +98,4 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { [6] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN) }, [7] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN) } }; -#endif - -#ifdef OLED_ENABLE - -oled_rotation_t oled_init_user(oled_rotation_t rotation) { - return OLED_ROTATION_180; - } - #endif \ No newline at end of file diff --git a/keyboards/macroflow_original/macroflow_original.c b/keyboards/macroflow_original/macroflow_original.c index ca664ad56e1e..e82e276b8bab 100644 --- a/keyboards/macroflow_original/macroflow_original.c +++ b/keyboards/macroflow_original/macroflow_original.c @@ -21,6 +21,10 @@ enum layer_names { eight }; +oled_rotation_t oled_init_kb(oled_rotation_t rotation) { + return OLED_ROTATION_180; +} + bool oled_task_kb(void) { if (!oled_task_user()) { return false; @@ -193,5 +197,4 @@ bool oled_task_kb(void) { } } return false; - return true; } \ No newline at end of file diff --git a/keyboards/macroflow_original/readme.md b/keyboards/macroflow_original/readme.md index 9c3eb53ea5fa..a38fefa86634 100644 --- a/keyboards/macroflow_original/readme.md +++ b/keyboards/macroflow_original/readme.md @@ -5,8 +5,8 @@ *A 2x4 macropad with a built in encoder and OLED screen* * Keyboard Maintainer: [Patrickemm](https://github.com/Patrickemm) -* Hardware Supported: *ATmega32U4* -* Hardware Availability: *https://keeb.io/products/pro-micro-usb-c-version-5v-16mhz-arduino-compatible-atmega32u4* +* Hardware Supported: *Pro Micro compatible development board* +* Hardware Availability: *https://www.ebay.com/usr/handycache* Make example for this keyboard (after setting up your build environment): From 7e06bc8136b96b638b9041834f9849c0406d5100 Mon Sep 17 00:00:00 2001 From: Patrick Mathern Date: Wed, 30 Oct 2024 19:38:21 -0400 Subject: [PATCH 15/20] Fixed Matrix --- keyboards/macroflow_original/keyboard.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/macroflow_original/keyboard.json b/keyboards/macroflow_original/keyboard.json index dacb28fc8f7a..5f1bbad11687 100644 --- a/keyboards/macroflow_original/keyboard.json +++ b/keyboards/macroflow_original/keyboard.json @@ -30,7 +30,7 @@ "layout": [ {"matrix": [0, 0], "x": 0, "y": 0}, - {"matrix": [0, 3], "x": 1, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0}, {"matrix": [1, 0], "x": 0, "y": 1}, {"matrix": [1, 1], "x": 1, "y": 1}, From 702a9dfa8b76f1b72937d66a9d53a94473d47d1b Mon Sep 17 00:00:00 2001 From: Patrickemm Date: Thu, 5 Dec 2024 23:15:32 -0500 Subject: [PATCH 16/20] Update keyboards/macroflow_original/keyboard.json Co-authored-by: Drashna Jaelre --- keyboards/macroflow_original/keyboard.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/macroflow_original/keyboard.json b/keyboards/macroflow_original/keyboard.json index 5f1bbad11687..58cabba08eff 100644 --- a/keyboards/macroflow_original/keyboard.json +++ b/keyboards/macroflow_original/keyboard.json @@ -49,4 +49,4 @@ {"pin_b": "F5", "pin_a": "F4"} ] } -} \ No newline at end of file +} From 340ea4b3e596374bfee0b0d55d44bbc05432ff51 Mon Sep 17 00:00:00 2001 From: Patrickemm Date: Thu, 5 Dec 2024 23:15:50 -0500 Subject: [PATCH 17/20] Update keyboards/macroflow_original/keymaps/default/keymap.c Co-authored-by: Drashna Jaelre --- .../macroflow_original/keymaps/default/keymap.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/keyboards/macroflow_original/keymaps/default/keymap.c b/keyboards/macroflow_original/keymaps/default/keymap.c index aa7cf69c123e..8b7bc521abb6 100644 --- a/keyboards/macroflow_original/keymaps/default/keymap.c +++ b/keyboards/macroflow_original/keymaps/default/keymap.c @@ -90,12 +90,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #if defined(ENCODER_MAP_ENABLE) const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { [0] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN) }, - [1] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN) }, - [2] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN) }, - [3] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN) }, - [4] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN) }, - [5] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN) }, - [6] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN) }, - [7] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN) } + [1] = { ENCODER_CCW_CW(_______, _______) }, + [2] = { ENCODER_CCW_CW(_______, _______) }, + [3] = { ENCODER_CCW_CW(_______, _______) }, + [4] = { ENCODER_CCW_CW(_______, _______) }, + [5] = { ENCODER_CCW_CW(_______, _______) }, + [6] = { ENCODER_CCW_CW(_______, _______) }, + [7] = { ENCODER_CCW_CW(_______, _______) } }; #endif \ No newline at end of file From 04725712453ca596ae9bceb1b5b89b887935e3da Mon Sep 17 00:00:00 2001 From: Patrickemm Date: Thu, 5 Dec 2024 23:16:01 -0500 Subject: [PATCH 18/20] Update keyboards/macroflow_original/keymaps/default/keymap.c Co-authored-by: Drashna Jaelre --- keyboards/macroflow_original/keymaps/default/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/macroflow_original/keymaps/default/keymap.c b/keyboards/macroflow_original/keymaps/default/keymap.c index 8b7bc521abb6..76ef39bf5a7d 100644 --- a/keyboards/macroflow_original/keymaps/default/keymap.c +++ b/keyboards/macroflow_original/keymaps/default/keymap.c @@ -98,4 +98,4 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { [6] = { ENCODER_CCW_CW(_______, _______) }, [7] = { ENCODER_CCW_CW(_______, _______) } }; -#endif \ No newline at end of file +#endif From 7c83ea82469b68dd2d3e7828aa82e72a5c63facc Mon Sep 17 00:00:00 2001 From: Patrickemm Date: Thu, 5 Dec 2024 23:16:08 -0500 Subject: [PATCH 19/20] Update keyboards/macroflow_original/keymaps/default/rules.mk Co-authored-by: Drashna Jaelre --- keyboards/macroflow_original/keymaps/default/rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/macroflow_original/keymaps/default/rules.mk b/keyboards/macroflow_original/keymaps/default/rules.mk index a40474b4d5c7..ee325681483f 100644 --- a/keyboards/macroflow_original/keymaps/default/rules.mk +++ b/keyboards/macroflow_original/keymaps/default/rules.mk @@ -1 +1 @@ -ENCODER_MAP_ENABLE = yes \ No newline at end of file +ENCODER_MAP_ENABLE = yes From ee3f83ab3689d781061b5c514e0d646a18a62847 Mon Sep 17 00:00:00 2001 From: Patrickemm Date: Thu, 5 Dec 2024 23:16:15 -0500 Subject: [PATCH 20/20] Update keyboards/macroflow_original/macroflow_original.c Co-authored-by: Drashna Jaelre --- keyboards/macroflow_original/macroflow_original.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/macroflow_original/macroflow_original.c b/keyboards/macroflow_original/macroflow_original.c index e82e276b8bab..fd91fd510e5a 100644 --- a/keyboards/macroflow_original/macroflow_original.c +++ b/keyboards/macroflow_original/macroflow_original.c @@ -197,4 +197,4 @@ bool oled_task_kb(void) { } } return false; -} \ No newline at end of file +}