-
-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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 Model-B keyboard #24681
base: master
Are you sure you want to change the base?
Add Model-B keyboard #24681
Conversation
#define MTNS 0 | ||
#define INFO 1 | ||
#define LOGO 2 | ||
#define MEW 3 | ||
#define CEL 4 | ||
#define RAY 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#define MTNS 0 | |
#define INFO 1 | |
#define LOGO 2 | |
#define MEW 3 | |
#define CEL 4 | |
#define RAY 5 | |
enum oled_modes { | |
MTNS, INFO, LOGO, MEW, CEL, RAY | |
}; | |
} | ||
|
||
// run this whenever the oled needs to update | ||
bool oled_task_user(void) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bool oled_task_user(void) { | |
bool oled_task_kb(void) { | |
if (!oled_task_user()) { | |
return false; | |
} |
|
||
// what happens on sleep/power down | ||
void suspend_power_down_user(void) { | ||
oled_off(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is handled internally.
// what happens on sleep/power down | |
void suspend_power_down_user(void) { | |
oled_off(); | |
} |
} | ||
|
||
// run this on boot/reset | ||
bool shutdown_user(bool jump_to_bootloader) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bool shutdown_user(bool jump_to_bootloader) { | |
bool shutdown_kb(bool jump_to_bootloader) { | |
if (!shutdown_user(jump_to_bootloader) { | |
return false; | |
} |
} | ||
|
||
// change depending on if OLED_MOD is pressed | ||
bool process_record_user(uint16_t keycode, keyrecord_t *record) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |
bool process_record_kb(uint16_t keycode, keyrecord_t *record) { | |
if (!process_record_user(keycode, record)) { | |
return false; | |
} |
switch (get_highest_layer(layer_state)) { | ||
case 0: | ||
oled_invert(false); | ||
break; | ||
case 1: | ||
oled_invert(true); | ||
break; | ||
default: | ||
oled_invert(false); | ||
break; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For most of these switches, you don't need to explicitly define each case. Eg, since case 0 and default are the same, you can specify just case 1 and default. Case 0 will be covered by "default", and you have less code.
This isn't a required change, just a suggestion.
|
||
void eeconfig_init_kb(void) { | ||
keyboard_config.raw = 0; | ||
keyboard_config.display_mode_saved = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you wanted info as the default? So this is probably from my suggestion.
keyboard_config.display_mode_saved = 2; | |
keyboard_config.display_mode_saved = INFO; |
Description
Addition of Model-B, a 75% keyboard. Supports SSD1306 displays and rotary encoders. Six sample screens are baked in for simplicity.
Types of Changes
Issues Fixed or Closed by This PR
Checklist