Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backlight abstraction and other changes #439

Merged
merged 11 commits into from
Jun 24, 2016
Prev Previous commit
Next Next commit
cleans-up clueboards, readmes to lowercase
  • Loading branch information
jackhumbert committed Jun 24, 2016
commit f55baa477b9810142a2cdc45f669946f5c69f425
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 0 additions & 3 deletions keyboards/clueboard1/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@


# # project specific files
SRC = led.c

# MCU name
MCU = atmega32u4

Expand Down
25 changes: 9 additions & 16 deletions keyboards/clueboard1/clueboard1.c
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
#include "clueboard1.h"

__attribute__ ((weak))
void matrix_init_user(void) {
// leave these blank
}

__attribute__ ((weak))
void matrix_scan_user(void) {
// leave these blank
}

void matrix_init_kb(void) {
matrix_init_user();
}

void matrix_scan_kb(void) {
matrix_scan_user();
void led_set_kb(uint8_t usb_led) {
DDRF |= (1<<0);
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
// Turn capslock on
PORTF |= (1<<0);
} else {
// Turn capslock off
PORTF &= ~(1<<0);
}
}
7 changes: 1 addition & 6 deletions keyboards/clueboard1/clueboard1.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#ifndef CLUEBOARD1_H
#define CLUEBOARD1_H

#include "matrix.h"
#include "keymap.h"
#include <stddef.h>
#include "quantum.h"


/* Clueboard matrix layout
Expand Down Expand Up @@ -46,7 +44,4 @@
{ k40, k41, k42, k43, KC_NO, k45, k46, KC_NO, KC_NO, k49, k4A, k4B, k4C, k4D, k4E, k4F } \
}

void matrix_init_user(void);
void matrix_scan_user(void);

#endif
32 changes: 0 additions & 32 deletions keyboards/clueboard1/led.c

This file was deleted.

6 changes: 0 additions & 6 deletions keyboards/clueboard2/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@


SRC = led.c

# MCU name
#MCU = at90usb1287
MCU = atmega32u4
Expand Down Expand Up @@ -68,10 +66,6 @@ AUDIO_ENABLE ?= no
UNICODE_ENABLE ?= no # Unicode
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID

#ifdef BACKLIGHT_ENABLE
SRC := backlight.c $(SRC)
#endif

ifndef QUANTUM_DIR
include ../../Makefile
endif
41 changes: 0 additions & 41 deletions keyboards/clueboard2/backlight.c

This file was deleted.

79 changes: 51 additions & 28 deletions keyboards/clueboard2/clueboard2.c
Original file line number Diff line number Diff line change
@@ -1,40 +1,63 @@
#include "clueboard2.h"

#ifdef BACKLIGHT_ENABLE
#include "backlight.h"
#endif

__attribute__ ((weak))
void matrix_init_user(void) {
// leave these blank
};

__attribute__ ((weak))
void matrix_scan_user(void) {
// leave these blank
};

void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up
if (matrix_init_user) {
(*matrix_init_user)();
}
matrix_init_user();
led_init_ports();

#ifdef BACKLIGHT_ENABLE
init_backlight_pin();
#endif

// JTAG disable for PORT F. write JTD bit twice within four cycles.
MCUCR |= (1<<JTD);
MCUCR |= (1<<JTD);
};

void matrix_scan_kb(void) {
// put your looping keyboard code here
// runs every cycle (a lot)
if (matrix_scan_user) {
(*matrix_scan_user)();
}
};
void led_init_ports() {
// * Set our LED pins as output
DDRB |= (1<<4);
}

void led_set_kb(uint8_t usb_led) {
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
// Turn capslock on
PORTB |= (1<<4);
} else {
// Turn capslock off
PORTB &= ~(1<<4);
}
}

/* Clueboard 2.0 LED locations:
*
* Capslock: B4, pull high to turn on
* LCtrl: Shared with Capslock, DO NOT INSTALL LED'S IN BOTH
* Page Up: B7, pull high to turn on
* Escape: D6, pull high to turn on
* Arrows: D4, pull high to turn on
*/

void backlight_init_ports(void) {
print("init_backlight_pin()\n");
// Set our LED pins as output
DDRD |= (1<<6); // Esc
DDRB |= (1<<7); // Page Up
DDRD |= (1<<4); // Arrows

// Set our LED pins low
PORTD &= ~(1<<6); // Esc
PORTB &= ~(1<<7); // Page Up
PORTD &= ~(1<<4); // Arrows
}

void backlight_set(uint8_t level) {
if ( level == 0 ) {
// Turn off light
PORTD |= (1<<6); // Esc
PORTB |= (1<<7); // Page Up
PORTD |= (1<<4); // Arrows
} else {
// Turn on light
PORTD &= ~(1<<6); // Esc
PORTB &= ~(1<<7); // Page Up
PORTD &= ~(1<<4); // Arrows
}
}
7 changes: 1 addition & 6 deletions keyboards/clueboard2/clueboard2.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#ifndef CLUEBOARD2_H
#define CLUEBOARD2_H

#include "matrix.h"
#include "keymap.h"
#include <stddef.h>
#include "quantum.h"


/* Clueboard matrix layout
Expand Down Expand Up @@ -51,7 +49,4 @@
{ k90, KC_NO, k92, k93, k94, k95, k96, k97 } \
}

void matrix_init_user(void);
void matrix_scan_user(void);

#endif
4 changes: 0 additions & 4 deletions keyboards/clueboard2/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#include "clueboard2.h"

#ifdef RGBLIGHT_ENABLE
#include "rgblight.h"
#endif

// Used for SHIFT_ESC
#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))

Expand Down
4 changes: 0 additions & 4 deletions keyboards/clueboard2/keymaps/max/keymap.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#include "clueboard2.h"

#ifdef ENABLE_RGBLIGHT
#include "rgblight.h"
#endif

// Used for SHIFT_ESC
#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))

Expand Down
36 changes: 0 additions & 36 deletions keyboards/clueboard2/led.c

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 12 additions & 12 deletions keyboards/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@ QMK runs on a diverse range of keyboards. Some of these keyboards are officially

These keyboards are manufactured by the maintainers of QMK.

### [Ortholinear Keyboards](http://olkb.com) &mdash; Jack Humbert
### Ortholinear Keyboards - Jack Humbert

What makes OLKB keyboards shine is a combo of lean aesthetics, compact size, and killer tactile feel. These are available through [olkb.com](http://olkb.com) as well as through [Massdrop](http://massdrop.com) from time to time, as easy to assemble kits.

* [Planck](/keyboards/planck/) &mdash; A 40% DIY powerhouse of customizability and modification capability. It's a lean, mean, typing machine.
* [Preonic](/keyboards/preonic/) &mdash; Like the Planck, but bigger. 50%.
* [Atomic](/keyboards/atomic/) &mdash; Imagine the size of the Planck. Now imagine the size of the Preonic. Now imagine _bigger_. That is the Atomic. A 60% keyboard.
* [Planck](/keyboards/planck/) - A 40% DIY powerhouse of customizability and modification capability. It's a lean, mean, typing machine.
* [Preonic](/keyboards/preonic/) - Like the Planck, but bigger. 50%.
* [Atomic](/keyboards/atomic/) - Imagine the size of the Planck. Now imagine the size of the Preonic. Now imagine _bigger_. That is the Atomic. A 60% keyboard.

### [ErgoDox EZ](https://ergodox-ez.com) &mdash; Erez Zukerman
### ErgoDox EZ - Erez Zukerman

Made in Taiwan using advanced robotic manufacturing, the ErgoDox EZ is a fully-assembled, premium ergonomic keyboard. Its split design allows you to place both halves shoulder width, and its custom-made wrist rests and tilt/tent kit make for incredibly comfortable typing.
Made in Taiwan using advanced robotic manufacturing, the ErgoDox EZ is a fully-assembled, premium ergonomic keyboard. Its split design allows you to place both halves shoulder width, and its custom-made wrist rests and tilt/tent kit make for incredibly comfortable typing. Available on [ergodox-ez.com](https://ergodox-ez.com).

* [ErgoDox EZ](/keyboards/ergodox_ez/) &mdash; Our one and only product. Yes, it's that awesome. Comes with either printed or blank keycaps, and 7 different keyswitch types.
* [ErgoDox EZ](/keyboards/ergodox_ez/) - Our one and only product. Yes, it's that awesome. Comes with either printed or blank keycaps, and 7 different keyswitch types.

### [Clueboard](http://clueboard.co) &mdash; Zach White
### Clueboard - Zach White

Designed and built in Felton, CA, Clueboards keyboard emphasize quality and locally sourced components.
Designed and built in Felton, CA, Clueboards keyboard emphasize quality and locally sourced components, available on [clueboard.co](http://clueboard.co)

* [Clueboard rev.1](/keyboards/clueboard1/) &mdash; The old Clueboard.
* [Clueboard rev.2](/keyboards/clueboard2/) &mdash; New and improved! The Clueboard, revision 2.
* [Cluepad](/keyboards/cluepad/) &mdash; A mechanical numpad with QMK superpowers.
* [Clueboard rev.1](/keyboards/clueboard1/) - The old Clueboard.
* [Clueboard rev.2](/keyboards/clueboard2/) - New and improved! The Clueboard, revision 2.
* [Cluepad](/keyboards/cluepad/) - A mechanical numpad with QMK superpowers.


## Community-supported QMK Keyboards
Expand Down
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions quantum/quantum.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "config_common.h"
#include <avr/interrupt.h>
#include "led.h"
#include "action_util.h"

extern uint32_t default_layer_state;

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion README.md → readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ QMK is developed and maintained by Jack Humbert of OLKB with contributions from

This documentation is edited and maintained by Erez Zukerman of ErgoDox EZ. If you spot any typos or inaccuracies, please [open an issue](https://github.com/jackhumbert/qmk_firmware/issues/new).

The OLKB product firmwares are maintained by Jack, the Ergodox EZ by Erez, and the Clueboard by [Zach White](https://github.com/skullydazed).
The OLKB product firmwares are maintained by [Jack Humbert](https://github.com/jackhumbert), the Ergodox EZ by [Erez Zukerman](https://github.com/ezuk), and the Clueboard by [Zach White](https://github.com/skullydazed).

## Documentation roadmap

Expand Down
File renamed without changes.