diff options
| author | Lukas Klingsbo <lukas.klingsbo@gmail.com> | 2018-07-24 01:13:11 +0200 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2018-07-23 16:13:11 -0700 |
| commit | 9ce35e823b945aca427f11e1a4ae26d6ea672ff4 (patch) | |
| tree | c3910b45c44d38662d6f4ed62978f04451074592 | |
| parent | 1225120b92411f4fa1a9dc79af2fd85bd5aa6dcc (diff) | |
| download | qmk_firmware-9ce35e823b945aca427f11e1a4ae26d6ea672ff4.tar.gz qmk_firmware-9ce35e823b945aca427f11e1a4ae26d6ea672ff4.zip | |
Keyboard: Base for the nicekey keyboard (#3475)
* Base for the nicekey keyboard
* Fixed formatting of readme
| -rw-r--r-- | keyboards/handwired/nicekey/config.h | 75 | ||||
| -rw-r--r-- | keyboards/handwired/nicekey/keymaps/default/keymap.c | 75 | ||||
| -rw-r--r-- | keyboards/handwired/nicekey/nicekey.c | 1 | ||||
| -rw-r--r-- | keyboards/handwired/nicekey/nicekey.h | 1 | ||||
| -rw-r--r-- | keyboards/handwired/nicekey/readme.md | 18 | ||||
| -rw-r--r-- | keyboards/handwired/nicekey/rules.mk | 61 |
6 files changed, 231 insertions, 0 deletions
diff --git a/keyboards/handwired/nicekey/config.h b/keyboards/handwired/nicekey/config.h new file mode 100644 index 000000000..652711be8 --- /dev/null +++ b/keyboards/handwired/nicekey/config.h | |||
| @@ -0,0 +1,75 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2015 Jun Wako <wakojun@gmail.com> | ||
| 3 | |||
| 4 | This program is free software: you can redistribute it and/or modify | ||
| 5 | it under the terms of the GNU General Public License as published by | ||
| 6 | the Free Software Foundation, either version 2 of the License, or | ||
| 7 | (at your option) any later version. | ||
| 8 | |||
| 9 | This program is distributed in the hope that it will be useful, | ||
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | GNU General Public License for more details. | ||
| 13 | |||
| 14 | You should have received a copy of the GNU General Public License | ||
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 16 | */ | ||
| 17 | |||
| 18 | #ifndef CONFIG_H | ||
| 19 | #define CONFIG_H | ||
| 20 | |||
| 21 | #include "config_common.h" | ||
| 22 | |||
| 23 | /* USB Device descriptor parameter */ | ||
| 24 | #define VENDOR_ID 0xFEED | ||
| 25 | #define PRODUCT_ID 0x6464 | ||
| 26 | #define DEVICE_VER 0x0001 | ||
| 27 | #define MANUFACTURER Lukas | ||
| 28 | #define PRODUCT nicekey | ||
| 29 | #define DESCRIPTION a compliment one key keyboard | ||
| 30 | |||
| 31 | /* key matrix size */ | ||
| 32 | #define MATRIX_ROWS 1 | ||
| 33 | #define MATRIX_COLS 1 | ||
| 34 | |||
| 35 | #define MATRIX_COL_PINS { C6 } | ||
| 36 | #define MATRIX_ROW_PINS { B6 } | ||
| 37 | #define UNUSED_PINS | ||
| 38 | |||
| 39 | /* define if matrix has ghost */ | ||
| 40 | //#define MATRIX_HAS_GHOST | ||
| 41 | |||
| 42 | /* Set 0 if debouncing isn't needed */ | ||
| 43 | #define DEBOUNCE 5 | ||
| 44 | |||
| 45 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ | ||
| 46 | #define LOCKING_SUPPORT_ENABLE | ||
| 47 | /* Locking resynchronize hack */ | ||
| 48 | #define LOCKING_RESYNC_ENABLE | ||
| 49 | |||
| 50 | /* key combination for command */ | ||
| 51 | #define IS_COMMAND() ( \ | ||
| 52 | keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ | ||
| 53 | ) | ||
| 54 | |||
| 55 | |||
| 56 | |||
| 57 | /* | ||
| 58 | * Feature disable options | ||
| 59 | * These options are also useful to firmware size reduction. | ||
| 60 | */ | ||
| 61 | |||
| 62 | /* disable debug print */ | ||
| 63 | //#define NO_DEBUG | ||
| 64 | |||
| 65 | /* disable print */ | ||
| 66 | //#define NO_PRINT | ||
| 67 | |||
| 68 | /* disable action features */ | ||
| 69 | //#define NO_ACTION_LAYER | ||
| 70 | //#define NO_ACTION_TAPPING | ||
| 71 | //#define NO_ACTION_ONESHOT | ||
| 72 | //#define NO_ACTION_MACRO | ||
| 73 | //#define NO_ACTION_FUNCTION | ||
| 74 | |||
| 75 | #endif | ||
diff --git a/keyboards/handwired/nicekey/keymaps/default/keymap.c b/keyboards/handwired/nicekey/keymaps/default/keymap.c new file mode 100644 index 000000000..573237715 --- /dev/null +++ b/keyboards/handwired/nicekey/keymaps/default/keymap.c | |||
| @@ -0,0 +1,75 @@ | |||
| 1 | #include QMK_KEYBOARD_H | ||
| 2 | |||
| 3 | enum custom_keycodes { | ||
| 4 | RANDOM_STRING_MACRO = SAFE_RANGE | ||
| 5 | }; | ||
| 6 | |||
| 7 | const int delay = 100; | ||
| 8 | const char *sentences[] = { | ||
| 9 | "I hope you have a great day!\n", | ||
| 10 | "You are an awesome person.\n", | ||
| 11 | "I wish I knew you better, you seem nice!\n", | ||
| 12 | "Your views restore my faith in humanity\n", | ||
| 13 | "You are as cool as a norm-critical disney princess\n", | ||
| 14 | "You have impeccable manners.\n", | ||
| 15 | "You are making me smile\n", | ||
| 16 | "You are making a difference\n", | ||
| 17 | "You bring out the best in other people\n", | ||
| 18 | "You are all that and a super-size bag of chips.\n", | ||
| 19 | "You are not someone I pretend to not see in public.\n", | ||
| 20 | "Are you a beaver, because damn.\n", | ||
| 21 | "I bet you make babies smile.\n", | ||
| 22 | "You are awkward, in a cute way. Like an elevator ride, but with puppies.\n", | ||
| 23 | "Looking like a complete idiot with you is really fun.\n", | ||
| 24 | "If you cooked something really bad, I would tell you instead of eating it.\n", | ||
| 25 | "I love how passionate you are about your hobby.\n", | ||
| 26 | "Our conversations always make me feel better.\n", | ||
| 27 | "It is amazing how far out of your way you go to help people.\n", | ||
| 28 | "I am so glad that you wrote something here.\n", | ||
| 29 | "Hey you! How nice to see a friendly person in my feed!\n", | ||
| 30 | "I hope we know each other for a long time.\n", | ||
| 31 | "I bet if Britney Spears knew you, 2008 would have gone a lot differently.\n", | ||
| 32 | "I would trust you with my passwords.\n", | ||
| 33 | "You are a great problem solver\n", | ||
| 34 | "I would love to hear you laugh!\n", | ||
| 35 | "Please, have a monologue about your week, I just want to listen to you!\n", | ||
| 36 | "You are very far from being Trump.\n", | ||
| 37 | "I think my dog might like you more than me\n", | ||
| 38 | "I feel like you would be a great person to do a group project with\n", | ||
| 39 | "I bet animals love you\n", | ||
| 40 | "I bet even Kanye would like you more than himself\n", | ||
| 41 | "You are just doing a great job at life\n", | ||
| 42 | "I like how you are challenging me.\n", | ||
| 43 | "You would do be a great mother!\n", | ||
| 44 | "I... Baked bread for you.\n", | ||
| 45 | "Wow. You.\n", | ||
| 46 | "You would not have let that balrog pass!\n", | ||
| 47 | "Thank you.\n", | ||
| 48 | "You would be standing out in a crowd\n", | ||
| 49 | "Your sense of style is amazing.\n", | ||
| 50 | "You have a beautiful mind.\n", | ||
| 51 | "I like that big juicy brain of yours\n", | ||
| 52 | "I would share my cinnamon bun with you\n", | ||
| 53 | "I like you more than i like my moms apple pie\n", | ||
| 54 | "You give me the same feeling as a summers night\n", | ||
| 55 | "I enjoy you more than the click of my mechanical switch\n", | ||
| 56 | "I would let you pop my bubble wrap\n", | ||
| 57 | "Being near you is like being inside of a poem\n" | ||
| 58 | }; | ||
| 59 | |||
| 60 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 61 | if (record->event.pressed) { | ||
| 62 | int sentences_size = sizeof(sentences) / sizeof(sentences[0]); | ||
| 63 | int i = rand() % sentences_size; | ||
| 64 | switch(keycode) { | ||
| 65 | case RANDOM_STRING_MACRO: | ||
| 66 | send_string_with_delay(sentences[i], delay); | ||
| 67 | return false; | ||
| 68 | } | ||
| 69 | } | ||
| 70 | return true; | ||
| 71 | }; | ||
| 72 | |||
| 73 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 74 | {{ RANDOM_STRING_MACRO }} | ||
| 75 | }; | ||
diff --git a/keyboards/handwired/nicekey/nicekey.c b/keyboards/handwired/nicekey/nicekey.c new file mode 100644 index 000000000..9720b0d0c --- /dev/null +++ b/keyboards/handwired/nicekey/nicekey.c | |||
| @@ -0,0 +1 @@ | |||
| #include "nicekey.h" | |||
diff --git a/keyboards/handwired/nicekey/nicekey.h b/keyboards/handwired/nicekey/nicekey.h new file mode 100644 index 000000000..7a4a4835e --- /dev/null +++ b/keyboards/handwired/nicekey/nicekey.h | |||
| @@ -0,0 +1 @@ | |||
| #include "quantum.h" \ No newline at end of file | |||
diff --git a/keyboards/handwired/nicekey/readme.md b/keyboards/handwired/nicekey/readme.md new file mode 100644 index 000000000..a867e907e --- /dev/null +++ b/keyboards/handwired/nicekey/readme.md | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | # nicekey handwired | ||
| 2 | |||
| 3 |  | ||
| 4 | |||
| 5 | |||
| 6 | Custom handwired nicekey, a one key keyboard that writes random compliments. | ||
| 7 | |||
| 8 | Keyboard Maintainer: spydon | ||
| 9 | Hardware Supported: Custom handwired one key | ||
| 10 | Hardware Availability: | ||
| 11 | |||
| 12 | Switch must be connected to pins C6 and B6. | ||
| 13 | |||
| 14 | Make example for this keyboard (after setting up your build environment): | ||
| 15 | |||
| 16 | make handwired/nicekey:default | ||
| 17 | |||
| 18 | See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. | ||
diff --git a/keyboards/handwired/nicekey/rules.mk b/keyboards/handwired/nicekey/rules.mk new file mode 100644 index 000000000..cfa693a73 --- /dev/null +++ b/keyboards/handwired/nicekey/rules.mk | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | |||
| 2 | |||
| 3 | # MCU name | ||
| 4 | MCU = atmega32u4 | ||
| 5 | |||
| 6 | # Processor frequency. | ||
| 7 | # This will define a symbol, F_CPU, in all source code files equal to the | ||
| 8 | # processor frequency in Hz. You can then use this symbol in your source code to | ||
| 9 | # calculate timings. Do NOT tack on a 'UL' at the end, this will be done | ||
| 10 | # automatically to create a 32-bit value in your source code. | ||
| 11 | # | ||
| 12 | # This will be an integer division of F_USB below, as it is sourced by | ||
| 13 | # F_USB after it has run through any CPU prescalers. Note that this value | ||
| 14 | # does not *change* the processor frequency - it should merely be updated to | ||
| 15 | # reflect the processor speed set externally so that the code can use accurate | ||
| 16 | # software delays. | ||
| 17 | F_CPU = 16000000 | ||
| 18 | |||
| 19 | |||
| 20 | # | ||
| 21 | # LUFA specific | ||
| 22 | # | ||
| 23 | # Target architecture (see library "Board Types" documentation). | ||
| 24 | ARCH = AVR8 | ||
| 25 | |||
| 26 | # Input clock frequency. | ||
| 27 | # This will define a symbol, F_USB, in all source code files equal to the | ||
| 28 | # input clock frequency (before any prescaling is performed) in Hz. This value may | ||
| 29 | # differ from F_CPU if prescaling is used on the latter, and is required as the | ||
| 30 | # raw input clock is fed directly to the PLL sections of the AVR for high speed | ||
| 31 | # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' | ||
| 32 | # at the end, this will be done automatically to create a 32-bit value in your | ||
| 33 | # source code. | ||
| 34 | # | ||
| 35 | # If no clock division is performed on the input clock inside the AVR (via the | ||
| 36 | # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. | ||
| 37 | F_USB = $(F_CPU) | ||
| 38 | |||
| 39 | # Interrupt driven control endpoint task(+60) | ||
| 40 | OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT | ||
| 41 | |||
| 42 | |||
| 43 | # Boot Section Size in *bytes* | ||
| 44 | # Teensy halfKay 512 | ||
| 45 | # Teensy++ halfKay 1024 | ||
| 46 | # Atmel DFU loader 4096 | ||
| 47 | # LUFA bootloader 4096 | ||
| 48 | # USBaspLoader 2048 | ||
| 49 | OPT_DEFS += -DBOOTLOADER_SIZE=4096 | ||
| 50 | |||
| 51 | |||
| 52 | # Build Options | ||
| 53 | # comment out to disable the options. | ||
| 54 | # | ||
| 55 | BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) | ||
| 56 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) | ||
| 57 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) | ||
| 58 | CONSOLE_ENABLE = yes # Console for debug(+400) | ||
| 59 | COMMAND_ENABLE = yes # Commands for debug and configuration | ||
| 60 | #SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend | ||
| 61 | #NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA \ No newline at end of file | ||
