diff options
author | Maarten Dekkers <maartenwut@gmail.com> | 2020-01-13 21:16:27 +0100 |
---|---|---|
committer | Drashna Jaelre <drashna@live.com> | 2020-01-13 12:16:27 -0800 |
commit | 94ea13e73de3f41c724406c9ec38760109037651 (patch) | |
tree | 9801b4c366b6adcc535e3bd3204fa401ac10709a /keyboards/maartenwut/minitomic/minitomic.c | |
parent | 240e1ef6fd4b3356f3d21a50b0a0ad6c0673b1dd (diff) | |
download | firmware-94ea13e73de3f41c724406c9ec38760109037651.tar.gz firmware-94ea13e73de3f41c724406c9ec38760109037651.tar.bz2 firmware-94ea13e73de3f41c724406c9ec38760109037651.zip |
[Keyboard] Add minitomic keyboard (#7140)
* Add minitomic keyboard
* Small change to readme
* Make changes necessary for merging
Remove extra comma in info.json, move caps lock led status from keymap to keyboard, removes unused keys on full space bar layout, cleans up rules.mk and update readme blurb.
* Update readme.md
* Update led function, fix spacing and remove custom keycodes
Removes the custom keycodes in default keymap, fixes spacing in keymap and minitomic.c and puts the new led function in as well
Diffstat (limited to 'keyboards/maartenwut/minitomic/minitomic.c')
-rw-r--r-- | keyboards/maartenwut/minitomic/minitomic.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/keyboards/maartenwut/minitomic/minitomic.c b/keyboards/maartenwut/minitomic/minitomic.c new file mode 100644 index 000000000..71447b196 --- /dev/null +++ b/keyboards/maartenwut/minitomic/minitomic.c @@ -0,0 +1,50 @@ +/* Copyright 2019 Maarten Dekkers <maartenwut@gmail.com> + * + * 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 "minitomic.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); + led_init_ports(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +void led_init_ports(void) { + //Set led pin as output, then high (off) + writePinHigh(C7); +} + +bool led_update_kb(led_t led_state) { + bool res = led_update_user(led_state); + if(res) { + // writePin sets the pin high for 1 and low for 0. + // In this example the pins are inverted, setting + // it low/0 turns it on, and high/1 turns the LED off. + // This behavior depends on whether the LED is between the pin + // and VCC or the pin and GND. + writePin(C7, !led_state.caps_lock); + } + return res; +} + |