Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add elephant42 keyboard #14336

Merged
merged 4 commits into from
Jul 2, 2022
Merged

Conversation

diastremskii
Copy link

@diastremskii diastremskii commented Sep 6, 2021

This PR adds the elephant42 keyboard

Description

elephant42

This is a split keyboard with 3x5+2 vertically staggered keys and 4 thumb keys.

/cc @illness072. Btw would be great if you could check the keymap please, I took it from the fork, but perhaps something needs to be changed.

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@github-actions github-actions bot added keyboard keymap via Adds via keymap and/or updates keyboard for via support labels Sep 6, 2021
keyboards/elephant42/config.h Outdated Show resolved Hide resolved
keyboards/elephant42/config.h Outdated Show resolved Hide resolved
keyboards/elephant42/keymaps/default/keymap.c Outdated Show resolved Hide resolved
keyboards/elephant42/keymaps/default/keymap.c Outdated Show resolved Hide resolved
keyboards/elephant42/keymaps/default/keymap.c Outdated Show resolved Hide resolved
keyboards/elephant42/keymaps/default/keymap.c Outdated Show resolved Hide resolved
keyboards/elephant42/lib/glcdfont.c Outdated Show resolved Hide resolved
keyboards/elephant42/rules.mk Outdated Show resolved Hide resolved
@diastremskii
Copy link
Author

Thank you for a review! Addressed the comments

@diastremskii
Copy link
Author

diastremskii commented Oct 17, 2021

Ping? 🥺👉 👈

@drashna
Copy link
Member

drashna commented Oct 18, 2021

Ping? 🥺👉 👈

No worries about the ping, it's been a ... .while, so it's absolutely understandable. However ...

keyboards/elephant42/info.json Outdated Show resolved Hide resolved
keyboards/elephant42/keymaps/default/config.h Outdated Show resolved Hide resolved
keyboards/elephant42/config.h Outdated Show resolved Hide resolved
keyboards/elephant42/keymaps/via/config.h Outdated Show resolved Hide resolved
keyboards/elephant42/rules.mk Outdated Show resolved Hide resolved
return true;
}

void oled_task_user(void) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, I'd like this in the keyboard's c file, that way there is an actual default, and if users don't specify one, it will still work just fine. This is especially useful for the QMK Configurator.

Copy link
Author

@diastremskii diastremskii Apr 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, but there is a different number of layers in default and VIA keymaps 🤔
I guess I can add an "empty" layer to default keymap, or would it be all right to leave as it is now?

Copy link
Member

@noroadsleft noroadsleft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally, any oled_task_user() functions need to be bool signature (bool oled_task_user(void)) and return false; before existing.

keyboards/elephant42/rules.mk Outdated Show resolved Hide resolved
@stale
Copy link

stale bot commented Apr 16, 2022

Thank you for your contribution!
This pull request has been automatically marked as stale because it has not had activity in the last 45 days. It will be closed in 30 days if no further activity occurs. Please feel free to give a status update now, or re-open when it's ready.
For maintainers: Please label with awaiting review, breaking_change, in progress, or on hold to prevent the issue from being re-flagged.

@diastremskii
Copy link
Author

@drashna @noroadsleft Thank you for reviews! Addressed the comments

keyboards/elephant42/config.h Outdated Show resolved Hide resolved
LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW
}
};
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#endif
#endif
#ifdef OLED_ENABLE
# define STEPS 32
uint8_t keypresses = 0;
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
keypresses = (keypresses + 1) % STEPS;
}
return process_record_user(keycode, record);
}
bool oled_task_kb(void) {
if (!oled_task_user()) {
return false;
}
if (is_keyboard_master()) {
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";
static char r1[] = " \x98\x99\x9A\x9B";
static char r2[] = " \xB8\xB9\xBA\xBB";
int iconShift = keypresses % STEPS;
if (iconShift > STEPS / 2) {
iconShift = STEPS - iconShift;
}
bool goingLeft = keypresses < STEPS / 2;
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 {
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);
}
return true;
}
#endif

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmmm, sorry, not sure what would a proper way to define it :(
I mean there is a reference to NUMBER_OF_LAYERS (oled_task_kb depends on the number of layers) and different keymaps can have different number of layers 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, might be worth just using 4 for that. the default keymap uses 3, and the via keymap uses 4. So just setting them may be fine. And if a user needs to change them, it can be done simply enough.

Copy link
Member

@noroadsleft noroadsleft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@github-actions
Copy link

Thank you for your contribution!
This pull request has been automatically marked as stale because it has not had activity in the last 45 days. It will be closed in 30 days if no further activity occurs. Please feel free to give a status update now, or re-open when it's ready.
For maintainers: Please label with bug, awaiting review, breaking_change, in progress, or on hold to prevent the issue from being re-flagged.

@github-actions github-actions bot added the stale Issues or pull requests that have become inactive without resolution. label Jun 26, 2022
@tzarc tzarc merged commit f2f88bc into qmk:master Jul 2, 2022
casuanoob pushed a commit to casuanoob/qmk_firmware that referenced this pull request Jul 2, 2022
schattenbrot pushed a commit to schattenbrot/qmk_firmware that referenced this pull request Aug 2, 2022
nolanseaton pushed a commit to nolanseaton/qmk_firmware that referenced this pull request Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keyboard keymap stale Issues or pull requests that have become inactive without resolution. via Adds via keymap and/or updates keyboard for via support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants