summaryrefslogtreecommitdiffstats
path: root/keyboards/ut47/ut47.c
diff options
context:
space:
mode:
authorCarlos <filoxo@users.noreply.github.com>2018-04-24 22:19:04 +0200
committerDrashna Jaelre <drashna@live.com>2018-04-24 22:19:04 +0200
commit32446eeeb6d846da4f3d742035eed7d49f91597d (patch)
treede5d5639ac34d2a91a5a9c0f61ee741be6cd18f5 /keyboards/ut47/ut47.c
parent1feb42a1088e868cb963f35cc72d180733304db4 (diff)
downloadqmk_firmware-32446eeeb6d846da4f3d742035eed7d49f91597d.tar.gz
qmk_firmware-32446eeeb6d846da4f3d742035eed7d49f91597d.tar.xz
UT47 layout (#2791)
* Add new project files for UT47 * Copy over keymap and related files * Add LED_controls.ino * Add README instructions * Attempt sending press byte data * Disable mousekeys * Enable sending serial data to LED controller * Update LED mode names * Remove extra file * Add LED enable flag * Update READMEs with more info * Credit original author * Update copyrights * Update docs * Changed based on review * Move layout screenshot to Imgur * Append to src * Enable mousekeys to fix bad keycodes * Additional changes based on feedback * Fix fn layer keys
Diffstat (limited to 'keyboards/ut47/ut47.c')
-rw-r--r--keyboards/ut47/ut47.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/keyboards/ut47/ut47.c b/keyboards/ut47/ut47.c
new file mode 100644
index 000000000..f467fd130
--- /dev/null
+++ b/keyboards/ut47/ut47.c
@@ -0,0 +1,50 @@
+/* Copyright 2018 Carlos Filoteo
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+#include "ut47.h"
+#ifdef LED_ENABLE
+ #include "protocol/serial.h"
+#endif
+
+void matrix_init_kb(void) {
+ // put your keyboard start-up code here
+ // runs once when the firmware starts up
+
+ matrix_init_user();
+}
+
+void matrix_scan_kb(void) {
+ // put your looping keyboard code here
+ // runs every cycle (a lot)
+
+ matrix_scan_user();
+}
+
+bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
+ // put your per-action keyboard code here
+ // runs for every action, just before processing by the firmware
+ if (record->event.pressed) {
+ #ifdef LED_ENABLE
+ serial_send((record->event.key.row*16)+record->event.key.col);
+ #endif
+ }
+ return process_record_user(keycode, record);
+}
+
+void led_set_kb(uint8_t usb_led) {
+ // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
+
+ led_set_user(usb_led);
+}