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

[Keyboard] Add MIIIW BlackIO83 #21970

Merged
merged 7 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improve the code
  • Loading branch information
ArthurCyy committed Sep 20, 2023
commit 6b7030efcb0cdb2c6fe547558b8465ebd405f7fd
19 changes: 18 additions & 1 deletion keyboards/miiiw/blackio83/blackio83.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,23 @@ static void POWER_EnterSleep(void) {
extern void ws2812_poweron(void);
extern void ws2812_poweroff(void);

static bool p_setup = false;
static bool s_init = false;
void ws2812_poweron(void) {
if(p_setup) return;
p_setup = true;
s_init = false;
setPinOutput(RGB_EN_PIN);
writePinHigh(RGB_EN_PIN);
}

void ws2812_poweroff(void) {
if(!p_setup) return;
p_setup = false;
setPinInputLow(WS2812_DI_PIN);
writePinLow(RGB_EN_PIN);
}

void keyboard_pre_init_kb() {
keyboard_pre_init_user();

Expand Down Expand Up @@ -80,7 +97,7 @@ void keyboard_post_init_kb(void) {
loop10hz_token = defer_exec(LOOP_10HZ_PERIOD, loop_10Hz, NULL);
}

void shutdown_user(void) {
__attribute__((weak)) void shutdown_user(void) {
#ifdef RGB_MATRIX_ENABLE
rgb_matrix_set_suspend_state(true);
Copy link
Member

Choose a reason for hiding this comment

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

Clever. Though, this would only work if suspend is enabled for rgb matrix, in general. If it's not... then it won't do anything.

#endif // RGB_MATRIX_ENABLE
Expand Down
10 changes: 2 additions & 8 deletions keyboards/miiiw/blackio83/blackio83.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,10 @@
#define XXX KC_NO

enum custom_keycodes {
#ifdef VIA_ENABLE
DEV_BT1 = SAFE_RANGE,
#endif
DEV_BT1 = QK_KB,
DEV_BT2,
DEV_BT3,
DEV_RF24,
ALT_TAB,
RGB_RST,
NEW_SAFE_RANGE
};

#undef SAFE_RANGE
#define SAFE_RANGE NEW_SAFE_RANGE
};
32 changes: 0 additions & 32 deletions keyboards/miiiw/blackio83/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,6 @@
// EEPROM i2c chip
#define EEPROM_I2C_24LC256

/* RGB Matrix */
#ifdef RGB_MATRIX_ENABLE
# define RGB_MATRIX_KEYPRESSES // reacts to keypresses
# define RGB_MATRIX_FRAMEBUFFER_EFFECTS
# define RGB_MATRIX_LED_FLUSH_LIMIT 26
//# define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
# define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 160 // limits maximum brightness of LEDs to 150 out of 255. Higher may cause the controller to crash.
# define RGB_MATRIX_HUE_STEP 36
# define RGB_MATRIX_SAT_STEP 8
# define RGB_MATRIX_VAL_STEP 32
# define RGB_MATRIX_SPD_STEP 60
# define RGB_MATRIX_DEFAULT_HUE 170
# define RGB_MATRIX_DEFAULT_SPD (RGB_MATRIX_SPD_STEP + 15)

/* Disable the animations you don't want/need. You will need to disable a good number of these *
* because they take up a lot of space. Disable until you can successfully compile your firmware. */
// RGB Matrix Animation modes. Explicitly enabled
Expand Down Expand Up @@ -72,21 +57,4 @@
# define ENABLE_RGB_MATRIX_PIXEL_RAIN
# define ENABLE_RGB_MATRIX_PIXEL_FLOW
# define ENABLE_RGB_MATRIX_PIXEL_FRACTAL
// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined
# define ENABLE_RGB_MATRIX_TYPING_HEATMAP
# define ENABLE_RGB_MATRIX_DIGITAL_RAIN
// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
# define ENABLE_RGB_MATRIX_SPLASH
# define ENABLE_RGB_MATRIX_MULTISPLASH
# define ENABLE_RGB_MATRIX_SOLID_SPLASH
# define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
#define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_SOLID_COLOR
#endif
1 change: 0 additions & 1 deletion keyboards/miiiw/blackio83/halconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,3 @@
#define USB_USE_WAIT TRUE

#include_next <halconf.h>

Loading