From fab7ade07c82dd9595b0d57782752aee774a25a3 Mon Sep 17 00:00:00 2001 From: Deddia Permana Date: Wed, 6 Sep 2023 19:33:44 +0700 Subject: [PATCH 1/9] added oled boot logo dp3000 macropad --- keyboards/dp3000/dp3000.c | 77 +++++++++++++++++++++++++++++++++++---- 1 file changed, 69 insertions(+), 8 deletions(-) diff --git a/keyboards/dp3000/dp3000.c b/keyboards/dp3000/dp3000.c index 3d99670fe36d..a1b3095c1b1d 100644 --- a/keyboards/dp3000/dp3000.c +++ b/keyboards/dp3000/dp3000.c @@ -15,20 +15,81 @@ */ #include "quantum.h" -bool oled_task_kb(void) { - if (!oled_task_user()) { - return false; - } +#define LOGO_TIMEOUT 3000 +#define CUSTOM_OLED_TIMEOUT 30000 + +static uint32_t logo_timer = 0; +static bool display_logo = true; + +void dp3000_logo(void) { + static const char PROGMEM dp3000_logo[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0x60, 0x7c, 0x7c, 0x60, 0x60, 0x60, 0x60, + 0x7c, 0x7c, 0x60, 0x60, 0x60, 0x60, 0x7c, 0x7c, 0x60, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x86, 0x86, 0x86, 0xff, 0xff, 0x00, 0x00, 0xf8, 0xf8, 0x18, 0x18, 0xf0, 0xe0, + 0x00, 0x00, 0xf8, 0xf8, 0x18, 0x18, 0xf8, 0xf0, 0x00, 0x00, 0xff, 0xff, 0x86, 0x86, 0x86, 0x00, + 0x00, 0x00, 0x00, 0x18, 0x18, 0x98, 0x98, 0xf8, 0xf0, 0x00, 0xf0, 0xf8, 0x18, 0x18, 0xf8, 0xf0, + 0x00, 0xf0, 0xf8, 0x18, 0x18, 0xf8, 0xf0, 0x00, 0xf0, 0xf8, 0x18, 0x18, 0xf8, 0xf0, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x61, 0x61, 0x61, 0xff, 0xff, 0x00, 0x00, 0x1f, 0x1f, 0x18, 0x18, 0x0f, 0x07, + 0x00, 0x00, 0x1f, 0x1f, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0xff, 0xff, 0x61, 0x61, 0x61, 0x00, + 0x00, 0x00, 0x00, 0x18, 0x18, 0x19, 0x19, 0x1f, 0x0f, 0x00, 0x0f, 0x1f, 0x18, 0x18, 0x1f, 0x0f, + 0x00, 0x0f, 0x1f, 0x18, 0x18, 0x1f, 0x0f, 0x00, 0x0f, 0x1f, 0x18, 0x18, 0x1f, 0x0f, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, 0x06, 0x3e, 0x3e, 0x06, 0x06, 0x06, 0x06, + 0x3e, 0x3e, 0x06, 0x06, 0x06, 0x06, 0x3e, 0x3e, 0x06, 0x07, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + oled_write_raw_P(dp3000_logo, sizeof(dp3000_logo)); +} + +void default_status(void) { + oled_set_cursor(0, 0); oled_write_P(PSTR("LAYER: "), false); oled_write_char('0' + get_highest_layer(layer_state), false); - - led_t led_state = host_keyboard_led_state(); oled_set_cursor(0, 1); + oled_write_P(PSTR("LOCK: "), false); + led_t led_state = host_keyboard_led_state(); oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); - oled_set_cursor(0, 2); oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); - oled_set_cursor(0, 3); oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); +} + +bool oled_task_kb(void) { + if (!oled_task_user()) { + return false; + } + if (timer_elapsed32(logo_timer) > LOGO_TIMEOUT) { + display_logo = false; + oled_clear(); + logo_timer = timer_read32(); + } + if (last_input_activity_elapsed() > CUSTOM_OLED_TIMEOUT) { + oled_off(); + }else { + oled_on(); + } + if (display_logo) { + dp3000_logo(); + } else { + default_status(); + } return false; } From 5b82c12facbf0190002d4fb26c58b7c118f908d8 Mon Sep 17 00:00:00 2001 From: Deddia Permana Date: Fri, 8 Sep 2023 18:53:19 +0700 Subject: [PATCH 2/9] Update dp3000.c --- keyboards/dp3000/dp3000.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/dp3000/dp3000.c b/keyboards/dp3000/dp3000.c index a1b3095c1b1d..e62289f38ca3 100644 --- a/keyboards/dp3000/dp3000.c +++ b/keyboards/dp3000/dp3000.c @@ -63,7 +63,7 @@ void default_status(void) { oled_set_cursor(0, 0); oled_write_P(PSTR("LAYER: "), false); oled_write_char('0' + get_highest_layer(layer_state), false); - oled_set_cursor(0, 1); + oled_advance_page(true); oled_write_P(PSTR("LOCK: "), false); led_t led_state = host_keyboard_led_state(); oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); From db564f7e96e78fc1bdb7c88c63240e2e323053b3 Mon Sep 17 00:00:00 2001 From: Deddia Permana Date: Fri, 8 Sep 2023 21:13:45 +0700 Subject: [PATCH 3/9] Update dp3000.c --- keyboards/dp3000/dp3000.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/keyboards/dp3000/dp3000.c b/keyboards/dp3000/dp3000.c index e62289f38ca3..6daeaa56630e 100644 --- a/keyboards/dp3000/dp3000.c +++ b/keyboards/dp3000/dp3000.c @@ -16,7 +16,6 @@ #include "quantum.h" #define LOGO_TIMEOUT 3000 -#define CUSTOM_OLED_TIMEOUT 30000 static uint32_t logo_timer = 0; static bool display_logo = true; @@ -75,15 +74,10 @@ bool oled_task_kb(void) { if (!oled_task_user()) { return false; } - if (timer_elapsed32(logo_timer) > LOGO_TIMEOUT) { + if (display_logo && timer_elapsed32(logo_timer) > LOGO_TIMEOUT) { display_logo = false; oled_clear(); - logo_timer = timer_read32(); - } - if (last_input_activity_elapsed() > CUSTOM_OLED_TIMEOUT) { - oled_off(); - }else { - oled_on(); + logo_timer = 0; } if (display_logo) { dp3000_logo(); From 70df98c8cc496e92dce5f83a53d5ed9a00664544 Mon Sep 17 00:00:00 2001 From: Deddia Permana Date: Fri, 8 Sep 2023 21:14:13 +0700 Subject: [PATCH 4/9] Update config.h --- keyboards/dp3000/config.h | 1 + 1 file changed, 1 insertion(+) diff --git a/keyboards/dp3000/config.h b/keyboards/dp3000/config.h index 26e9f037f58d..854685fde9e8 100644 --- a/keyboards/dp3000/config.h +++ b/keyboards/dp3000/config.h @@ -17,6 +17,7 @@ #pragma once +#define OLED_TIMEOUT 30000 #define RGB_MATRIX_LED_COUNT 8 #define RGB_MATRIX_SOLID_REACTIVE_GRADIENT_MODE #define RGB_MATRIX_KEYPRESSES From defe1d6f0ddcc42d018d87c3e729a62942607426 Mon Sep 17 00:00:00 2001 From: Deddia Permana Date: Sat, 9 Sep 2023 05:28:22 +0700 Subject: [PATCH 5/9] Update config.h --- keyboards/dp3000/config.h | 1 - 1 file changed, 1 deletion(-) diff --git a/keyboards/dp3000/config.h b/keyboards/dp3000/config.h index 854685fde9e8..26e9f037f58d 100644 --- a/keyboards/dp3000/config.h +++ b/keyboards/dp3000/config.h @@ -17,7 +17,6 @@ #pragma once -#define OLED_TIMEOUT 30000 #define RGB_MATRIX_LED_COUNT 8 #define RGB_MATRIX_SOLID_REACTIVE_GRADIENT_MODE #define RGB_MATRIX_KEYPRESSES From 60afa243c1ffc830f4cab284066461bb271e1f53 Mon Sep 17 00:00:00 2001 From: Deddia Permana Date: Sat, 9 Sep 2023 05:29:22 +0700 Subject: [PATCH 6/9] add `post_config.h` --- keyboards/dp3000/post_config.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 keyboards/dp3000/post_config.h diff --git a/keyboards/dp3000/post_config.h b/keyboards/dp3000/post_config.h new file mode 100644 index 000000000000..9d9c69537cc7 --- /dev/null +++ b/keyboards/dp3000/post_config.h @@ -0,0 +1,22 @@ +/* + * Copyright 2023 deddia permana (@depermana12) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#if !defined(OLED_TIMEOUT) +# define OLED_TIMEOUT 30000 +#endif From 404a43e6834054ba7cafd36882b958394f969581 Mon Sep 17 00:00:00 2001 From: Deddia Permana Date: Sat, 9 Sep 2023 05:49:23 +0700 Subject: [PATCH 7/9] reformating --- keyboards/dp3000/post_config.h | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 keyboards/dp3000/post_config.h diff --git a/keyboards/dp3000/post_config.h b/keyboards/dp3000/post_config.h deleted file mode 100644 index 9d9c69537cc7..000000000000 --- a/keyboards/dp3000/post_config.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2023 deddia permana (@depermana12) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#if !defined(OLED_TIMEOUT) -# define OLED_TIMEOUT 30000 -#endif From 85da12870ef6cdbe9ce899cd88109c9ca8f7c4d8 Mon Sep 17 00:00:00 2001 From: Deddia Permana Date: Sat, 9 Sep 2023 05:50:08 +0700 Subject: [PATCH 8/9] reformating `post_config.h` --- keyboards/dp3000/post_config.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 keyboards/dp3000/post_config.h diff --git a/keyboards/dp3000/post_config.h b/keyboards/dp3000/post_config.h new file mode 100644 index 000000000000..9d9c69537cc7 --- /dev/null +++ b/keyboards/dp3000/post_config.h @@ -0,0 +1,22 @@ +/* + * Copyright 2023 deddia permana (@depermana12) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#if !defined(OLED_TIMEOUT) +# define OLED_TIMEOUT 30000 +#endif From 9e999fddde55e2ca730657fdd205cea4f75cb02e Mon Sep 17 00:00:00 2001 From: depermana12 Date: Sat, 9 Sep 2023 06:51:42 +0700 Subject: [PATCH 9/9] update post_config.h --- keyboards/dp3000/post_config.h | 44 +++++++++++++++++----------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/keyboards/dp3000/post_config.h b/keyboards/dp3000/post_config.h index 9d9c69537cc7..ef2ce27e2190 100644 --- a/keyboards/dp3000/post_config.h +++ b/keyboards/dp3000/post_config.h @@ -1,22 +1,22 @@ -/* - * Copyright 2023 deddia permana (@depermana12) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#if !defined(OLED_TIMEOUT) -# define OLED_TIMEOUT 30000 -#endif +/* + * Copyright 2023 deddia permana (@depermana12) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#if !defined(OLED_TIMEOUT) +# define OLED_TIMEOUT 30000 +#endif