Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
diastremskii authored and root committed Apr 20, 2022
1 parent 99cf576 commit 1dccb41
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 65 deletions.
16 changes: 10 additions & 6 deletions keyboards/elephant42/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
# define RGBLIGHT_SAT_STEP 8
# define RGBLIGHT_VAL_STEP 8
# define RGBLIGHT_LIMIT_VAL 170 /* The maximum brightness level */
# define RGBLIGHT_ANIMATIONS
# define RGBLIGHT_EFFECT_BREATHING
# define RGBLIGHT_EFFECT_RAINBOW_MOOD
# define RGBLIGHT_EFFECT_RAINBOW_SWIRL
# define RGBLIGHT_EFFECT_SNAKE
# define RGBLIGHT_EFFECT_KNIGHT
# define RGBLIGHT_EFFECT_CHRISTMAS
# define RGBLIGHT_EFFECT_STATIC_GRADIENT
# define RGBLIGHT_EFFECT_RGB_TEST
# define RGBLIGHT_EFFECT_ALTERNATING
# define RGBLIGHT_EFFECT_TWINKLE
#endif

#ifdef RGB_MATRIX_ENABLE
Expand All @@ -79,11 +88,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* define if matrix has ghost (lacks anti-ghosting diodes) */
//#define MATRIX_HAS_GHOST

/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE

/* disable these deprecated features by default */
#define NO_ACTION_MACRO
#define NO_ACTION_FUNCTION
39 changes: 16 additions & 23 deletions keyboards/elephant42/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,9 @@
*/
#include QMK_KEYBOARD_H

#ifdef OLED_ENABLE
# include <stdio.h>
# include <string.h>
#endif

#define KC_VU KC__VOLUP
#define KC_VD KC__VOLDOWN
#define KC_MU KC__MUTE
#define KC_VU KC_AUDIO_VOL_UP
#define KC_VD KC_AUDIO_VOL_DOWN
#define KC_MU KC_AUDIO_MUTE
#define KC_LSPC LT(_LOWER, KC_SPC)
#define KC_RSPC LT(_RAISE, KC_SPC)

Expand Down Expand Up @@ -87,7 +82,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {

void oled_task_user(void) {
if (is_keyboard_master()) {
char disp[21 * 4];
static char layer_names[NUMBER_OF_LAYERS][10] = {"Default", "Lower", "Raise"};
static char l1[] = " \x94\x95\x96\x97";
static char l2[] = " \xB4\xB5\xB6\xB7";
Expand All @@ -99,21 +93,20 @@ void oled_task_user(void) {
}
bool goingLeft = keypresses < STEPS / 2;

strcpy(disp, "Layer: ");
strcat(disp, layer_names[get_highest_layer(layer_state)]);
strcat(disp, "\n\n");
strcat(disp, (goingLeft ? l1 : r1) + iconShift);
strcat(disp, "\n");
strcat(disp, (goingLeft ? l2 : r2) + iconShift);
strcat(disp, "\n");

oled_write(disp, false);
oled_write_P(PSTR("Layer: "), false);
oled_write_ln(layer_names[get_highest_layer(layer_state)], false);
oled_advance_page(true);
oled_write_ln((goingLeft ? l1 : r1) + iconShift, false);
oled_write_ln((goingLeft ? l2 : r2) + iconShift, false);
} else {
static char *logo = "\n"
"\x8f\x90\x91\x92\x93\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\n"
"\xaf\xb0\xb1\xb2\xb3\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\n"
"\xcf\xd0\xd1\xd2\xd3\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\n";
oled_write(logo, false);
oled_advance_page(true);
static const char PROGMEM logo[] = {
0x8f,0x90,0x91,0x92,0x93,0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x0a,
0xaf,0xb0,0xb1,0xb2,0xb3,0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0x0a,
0xcf,0xd0,0xd1,0xd2,0xd3,0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0
};

oled_write_ln_P(logo, false);
}
}
#endif
39 changes: 16 additions & 23 deletions keyboards/elephant42/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,9 @@
*/
#include QMK_KEYBOARD_H

#ifdef OLED_ENABLE
# include <stdio.h>
# include <string.h>
#endif

#define KC_VU KC__VOLUP
#define KC_VD KC__VOLDOWN
#define KC_MU KC__MUTE
#define KC_VU KC_AUDIO_VOL_UP
#define KC_VD KC_AUDIO_VOL_DOWN
#define KC_MU KC_AUDIO_MUTE
#define KC_LSPC LT(_LOWER, KC_SPC)
#define KC_RSPC LT(_RAISE, KC_SPC)

Expand Down Expand Up @@ -100,7 +95,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {

void oled_task_user(void) {
if (is_keyboard_master()) {
char disp[21 * 4];
static char layer_names[NUMBER_OF_LAYERS][10] = {"Default", "Lower", "Raise", "Adjust"};
static char l1[] = " \x94\x95\x96\x97";
static char l2[] = " \xB4\xB5\xB6\xB7";
Expand All @@ -112,21 +106,20 @@ void oled_task_user(void) {
}
bool goingLeft = keypresses < STEPS / 2;

strcpy(disp, "Layer: ");
strcat(disp, layer_names[get_highest_layer(layer_state)]);
strcat(disp, "\n\n");
strcat(disp, (goingLeft ? l1 : r1) + iconShift);
strcat(disp, "\n");
strcat(disp, (goingLeft ? l2 : r2) + iconShift);
strcat(disp, "\n");

oled_write(disp, false);
oled_write_P(PSTR("Layer: "), false);
oled_write_ln(layer_names[get_highest_layer(layer_state)], false);
oled_advance_page(true);
oled_write_ln((goingLeft ? l1 : r1) + iconShift, false);
oled_write_ln((goingLeft ? l2 : r2) + iconShift, false);
} else {
static char *logo = "\n"
"\x8f\x90\x91\x92\x93\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\n"
"\xaf\xb0\xb1\xb2\xb3\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\n"
"\xcf\xd0\xd1\xd2\xd3\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\n";
oled_write(logo, false);
oled_advance_page(true);
static const char PROGMEM logo[] = {
0x8f,0x90,0x91,0x92,0x93,0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x0a,
0xaf,0xb0,0xb1,0xb2,0xb3,0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0x0a,
0xcf,0xd0,0xd1,0xd2,0xd3,0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0
};

oled_write_ln_P(logo, false);
}
}
#endif
13 changes: 2 additions & 11 deletions keyboards/elephant42/lib/glcdfont.c
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0.
// See gfxfont.h for newer custom bitmap font info.

#ifndef FONT5X7_H
#define FONT5X7_H
#pragma once

#ifdef __AVR__
#include <avr/io.h>
#include <avr/pgmspace.h>
#elif defined(ESP8266)
#include <pgmspace.h>
#else
#define PROGMEM
#endif
#include "progmem.h"

static const unsigned char font[] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
Expand Down Expand Up @@ -239,4 +231,3 @@ static const unsigned char font[] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
#endif // FONT5X7_H
3 changes: 3 additions & 0 deletions keyboards/elephant42/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@ See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_to

## 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 `RESET` if it is available
4 changes: 2 additions & 2 deletions keyboards/elephant42/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ BOOTLOADER = caterina
# Build Options
# change yes to no to disable
#
BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
MOUSEKEY_ENABLE = no # Mouse keys
EXTRAKEY_ENABLE = no # Audio control and System control
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = no # Console for debug
COMMAND_ENABLE = no # Commands for debug and configuration
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
Expand Down

0 comments on commit 1dccb41

Please sign in to comment.