From 8ddebce2d7d42eedbafae5b92dff1af229115fac Mon Sep 17 00:00:00 2001 From: jamesofarrell Date: Mon, 28 May 2018 13:48:59 +1000 Subject: Add Canoe support (#3063) * Adding Canoe support * fix readme * Remove usless comment * fixing issues --- keyboards/canoe/canoe.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 keyboards/canoe/canoe.c (limited to 'keyboards/canoe/canoe.c') diff --git a/keyboards/canoe/canoe.c b/keyboards/canoe/canoe.c new file mode 100644 index 000000000..6a6756234 --- /dev/null +++ b/keyboards/canoe/canoe.c @@ -0,0 +1,45 @@ +/* +Copyright 2017 Luiz Ribeiro + +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 . +*/ + +#include "canoe.h" +#include "rgblight.h" + +#include + +#include "action_layer.h" +#include "i2c.h" +#include "quantum.h" + +extern rgblight_config_t rgblight_config; + +void rgblight_set(void) { + if (!rgblight_config.enable) { + for (uint8_t i = 0; i < RGBLED_NUM; i++) { + led[i].r = 0; + led[i].g = 0; + led[i].b = 0; + } + } + + i2c_init(); + i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM); +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { + rgblight_task(); +} -- cgit v1.2.3 From 6009ca2d4a76cc3fa66fd9b1339ebe9b11775ffc Mon Sep 17 00:00:00 2001 From: Dan Hertz Date: Tue, 29 May 2018 04:22:43 +0100 Subject: Update Canoe ps2avr board (#3066) * Add Percent Canoe keyboard * Fix row of nonus backslash * Update info.json to be correct for canoe * Change LAYOUT_ISO to LAYOUT_iso * Remove bootloader key in info.json --- keyboards/canoe/canoe.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'keyboards/canoe/canoe.c') diff --git a/keyboards/canoe/canoe.c b/keyboards/canoe/canoe.c index 6a6756234..bc69df2e5 100644 --- a/keyboards/canoe/canoe.c +++ b/keyboards/canoe/canoe.c @@ -16,14 +16,33 @@ along with this program. If not, see . */ #include "canoe.h" +#ifdef BACKLIGHT_ENABLE +#include "backlight.h" +#endif +#ifdef RGBLIGHT_ENABLE +#include "i2c.h" #include "rgblight.h" +#endif -#include +#ifdef BACKLIGHT_ENABLE +void backlight_set(uint8_t level) { + if (level == 0) { + // Turn out the lights + PORTD &= ~(1<<0 | 1<<1 | 1<<4 | 1<<6); + } else { + // Turn on the lights + PORTD |= (1<<0 | 1<<1 | 1<<4 | 1<<6); + } +} -#include "action_layer.h" -#include "i2c.h" -#include "quantum.h" +void backlight_init_ports(void) { + DDRD |= (1<<0 | 1<<1 | 1<<4 | 1<<6); + PORTD &= ~(1<<0 | 1<<1 | 1<<4 | 1<<6); +} + +#endif +#ifdef RGBLIGHT_ENABLE extern rgblight_config_t rgblight_config; void rgblight_set(void) { @@ -43,3 +62,4 @@ __attribute__ ((weak)) void matrix_scan_user(void) { rgblight_task(); } +#endif -- cgit v1.2.3 From d27855665a349f9afe5c1b457461078f85cf6ffb Mon Sep 17 00:00:00 2001 From: Kenneth Aloysius Date: Fri, 1 Jun 2018 01:32:05 +1000 Subject: Updated matrix.c for some PS2AVRGB boards and templates for new_project script (#2992) * Add M6-A keymap * Update XD60 keymap * Update XD60 keymap readme * Update JJ40 and Let's Split keymaps * Add readme for M6-A * Fix typo, update JJ40 README * Update jj40 readme * Cleanup jj40 keymap * Revert Let's Split QWERTY layer to default before #2010 * Update numpad layers * Fix: Let's Split keymap getting stuck mods due to having keycodes assigned on the Raise layer * Keep ASCII art consistent with keymap * Staryu: initial port * Add personal keymap * Added and updated READMEs * Fix: default keymap for staryu * Rudimentary backlight support. * Enabled mousekeys for default keymap * use QMK_KEYBOARD_H and LAYOUT * Update readme.md for NIU mini: flash using avrdude * Fix missing linebreaks for Staryu README * Update readme.md * Update PS2AVRGB boards with new matrix.c * Update canoe matrix.c; untested * Fix canoe.c for building (needs matrix_scan_user and matrix_init_user) * Add personal Iris keymap * Update keymap * Update keymap * Update keymap, disable backlighting and underglow * Move PrintScreen button * Add README --- keyboards/canoe/canoe.c | 49 ++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 40 insertions(+), 9 deletions(-) (limited to 'keyboards/canoe/canoe.c') diff --git a/keyboards/canoe/canoe.c b/keyboards/canoe/canoe.c index bc69df2e5..a7427e152 100644 --- a/keyboards/canoe/canoe.c +++ b/keyboards/canoe/canoe.c @@ -42,24 +42,55 @@ void backlight_init_ports(void) { #endif +// for keyboard subdirectory level init functions +// @Override +void matrix_init_kb(void) { + // call user level keymaps, if any + matrix_init_user(); +} + #ifdef RGBLIGHT_ENABLE extern rgblight_config_t rgblight_config; +// custom RGB driver void rgblight_set(void) { - if (!rgblight_config.enable) { - for (uint8_t i = 0; i < RGBLED_NUM; i++) { - led[i].r = 0; - led[i].g = 0; - led[i].b = 0; - } + if (!rgblight_config.enable) { + for (uint8_t i=0; i