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

pulling from tmk #6

Merged
merged 47 commits into from
Mar 16, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
1a9cec9
Documentation: small mistake
cub-uanic Nov 20, 2014
60acd89
Fixing typo in console mode
bswinnerton Nov 30, 2014
a6d33e2
Added support for The Ghost Squid controller used for CM XT keyboard.
vovcacik Dec 28, 2014
02a9f8a
Update other_projects.md - added TMK/Ergodox
cub-uanic Jan 3, 2015
05795cb
Compensate timer during prower down
tmk Nov 26, 2014
9179246
Fix USB plug-in while BT mode falls to be enumerated
tmk Nov 26, 2014
20caf67
Fix lufa sendchar() infinite wait loop
tmk Nov 29, 2014
570bcb2
Add LUFA device state to command info
tmk Nov 29, 2014
de29f98
Update MEMO
tmk Nov 29, 2014
825be9d
Disable input buffer for ADC
tmk Dec 2, 2014
25aee43
Clean ADC code of battery_voltage()
tmk Dec 2, 2014
2d7973f
Fix: enable digital input for PF5
tmk Dec 2, 2014
86f82dd
Add wait for charging capacitance of ADC S/H
tmk Dec 3, 2014
ebe4373
Fix power saving while USB suspended
tmk Dec 3, 2014
160e02d
Change RN42 state display
tmk Dec 8, 2014
884c2ab
Update doc
tmk Dec 11, 2014
a679928
Fxi layer stuck of keymap_hasu
tmk Jan 5, 2015
4f121de
rn42: Add rn42_getc and rn42_gets
tmk Jan 10, 2015
1b95b3c
rn42: Add commands for RN-42
tmk Jan 10, 2015
3b3af3b
Increase buffer of rn42_gets() and change rn42_linked()
tmk Jan 11, 2015
2626a32
Use pgmspace for RN-42 commands
tmk Jan 11, 2015
517817b
rn42: Update doc
tmk Jan 15, 2015
65a2ce9
Merge branch 'rn42'
tmk Jan 15, 2015
3e88e8b
hhkb: Fix layer stuck of keymap_hasu
tmk Jan 15, 2015
ce66988
hhkb_rn42: Move doc
tmk Jan 15, 2015
099701d
hhkb: Integrate RN-42 support, remove hhkb_rn42
tmk Jan 16, 2015
c610bae
Merge branch 'rn42_integrate'
tmk Jan 16, 2015
f31cbc7
Changed hotkey for bootloader jump
xauser Nov 12, 2014
d9b5f51
Added NerD 60% support
xauser Nov 11, 2014
2d74020
Added NerD 80% (TKL) support
xauser Nov 23, 2014
07b54cb
Added missing keyboards to main README
xauser Dec 14, 2014
40fd75e
hhkb: Update RN-42 docs
tmk Jan 17, 2015
d32b955
Merge branch 'forhasu' of https://github.com/xauser/tmk_keyboard into…
tmk Jan 19, 2015
507e063
Revert "Changed hotkey for bootloader jump"
tmk Jan 19, 2015
8279226
Merge branch 'xauser-forhasu'
tmk Jan 19, 2015
1cda7b7
Fix typo 'keyobard' #166
tmk Jan 19, 2015
703ca9d
Merge pull request #164 from cub-uanic/patch-2
tmk Jan 19, 2015
a5122d5
Merge branch 'ghost_squid' of https://github.com/vovcacik/tmk_keyboar…
tmk Jan 19, 2015
2e75b13
Merge branch 'vovcacik-ghost_squid'
tmk Jan 19, 2015
aa95d6f
Merge pull request #151 from bswinnerton/typo-fix
tmk Jan 19, 2015
c1ac7f1
Merge pull request #148 from cub-uanic/patch-1
tmk Jan 19, 2015
771347c
Add external projects using tmk_keyboard
tmk Jan 19, 2015
012ec9e
NerD, turn BRK into PAUS to get bootloader jump back.
xauser Jan 19, 2015
e0f3274
Kitten Paw, fix main README link to project.
xauser Jan 20, 2015
e872dd2
Merge pull request #176 from xauser/forhasu
tmk Jan 25, 2015
abf482d
Fix call parameter of suspend_power_down()
tmk Jan 26, 2015
c35c428
infinity: For production model and add SpaceFn
tmk Mar 5, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ You can find some keyboard specific projects under `converter` and `keyboard` di
* [KMAC](keyboard/kmac/) - Korean custom keyboard
* [Lightsaber](keyboard/lightsaber/) - Korean custom keyboard
* [Infinity](keyboard/infinity/) - Massdrop [Infinity keyboard][Infinity]
* [NerD](keyboard/nerd/) - Korean custom keyboard
* [KittenPaw](keyboard/kitten_paw) - Custom Majestouch controller
* [Lightpad](keyboard/lightpad) - Korean custom keypad
* [ghost_squid](keyboard/ghost_squid/) - [The Ghost Squid][ghost_squid] controller for [Cooler Master QuickFire XT][cmxt]

### Extenal projects using tmk_keyboard
* [ErgoDox_cub-uanic][cub-uanic] - Split Ergonomic Keyboard [ErgoDox][ergodox_org]
* [mcdox][mcdox_tmk] - [mcdox][mcdox]


[GH_macway]: http://geekhack.org/showwiki.php?title=Island:11930
[GH_hhkb]: http://geekhack.org/showwiki.php?title=Island:12047
Expand All @@ -74,6 +83,12 @@ You can find some keyboard specific projects under `converter` and `keyboard` di
[Sun]: http://en.wikipedia.org/wiki/Sun-3
[IIGS]: http://en.wikipedia.org/wiki/Apple_IIGS
[Infinity]: https://www.massdrop.com/buy/infinity-keyboard-kit
[ghost_squid]: http://deskthority.net/wiki/Costar_replacement_controllers#The_Ghost_Squid
[cmxt]: http://gaming.coolermaster.com/en/products/keyboards/quickfirext/
[ergodox_org]: http://ergodox.org/
[cub-uanic]: https://github.com/cub-uanic/tmk_keyboard/tree/master/keyboard/ergodox
[mcdox]: https://github.com/DavidMcEwan/mcdox
[mcdox_tmk]: https://github.com/DavidMcEwan/tmk_keyboard/tree/master/keyboard/mcdox



Expand Down Expand Up @@ -278,4 +293,4 @@ Coding Style

Other Keyboard Firmware Projects
------------------
See [doc/other_projects.md](doc/other_projects.md).
You can learn a lot about keyboard firmware from these. See [doc/other_projects.md](doc/other_projects.md).
27 changes: 16 additions & 11 deletions common/avr/suspend.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "backlight.h"
#include "suspend_avr.h"
#include "suspend.h"
#include "timer.h"
#ifdef PROTOCOL_LUFA
#include "lufa.h"
#endif
Expand Down Expand Up @@ -52,11 +53,13 @@ void suspend_idle(uint8_t time)
* WDTO_4S
* WDTO_8S
*/
void suspend_power_down(uint8_t wdto)
static uint8_t wdt_timeout = 0;
static void power_down(uint8_t wdto)
{
#ifdef PROTOCOL_LUFA
if (USB_DeviceState == DEVICE_STATE_Configured) return;
#endif
wdt_timeout = wdto;

// Watchdog Interrupt Mode
wdt_intr_enable(wdto);
Expand All @@ -67,7 +70,6 @@ void suspend_power_down(uint8_t wdto)
// - prescale clock
// - BOD disable
// - Power Reduction Register PRR

set_sleep_mode(SLEEP_MODE_PWR_DOWN);
sleep_enable();
sei();
Expand All @@ -78,6 +80,11 @@ void suspend_power_down(uint8_t wdto)
wdt_disable();
}

void suspend_power_down(void)
{
power_down(WDTO_15MS);
}

bool suspend_wakeup_condition(void)
{
matrix_power_up();
Expand All @@ -103,15 +110,13 @@ void suspend_wakeup_init(void)
/* watchdog timeout */
ISR(WDT_vect)
{
/* wakeup from MCU sleep mode */
/*
// blink LED
static uint8_t led_state = 0;
static uint8_t led_count = 0;
led_count++;
if ((led_count & 0x07) == 0) {
led_set((led_state ^= (1<<USB_LED_CAPS_LOCK)));
// compensate timer for sleep
switch (wdt_timeout) {
case WDTO_15MS:
timer_count += 15 + 2; // WDTO_15MS + 2(from observation)
break;
default:
;
}
*/
}
#endif
12 changes: 6 additions & 6 deletions common/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ static bool command_common(uint8_t code)
#endif
" " STR(BOOTLOADER_SIZE) "\n");

print("GCC: " STR(__GNUC__) "." STR(__GNUC_MINOR__) "." STR(__GNUC_PATCHLEVEL__)
print("GCC: " STR(__GNUC__) "." STR(__GNUC_MINOR__) "." STR(__GNUC_PATCHLEVEL__)
" AVR-LIBC: " __AVR_LIBC_VERSION_STRING__
" AVR_ARCH: avr" STR(__AVR_ARCH__) "\n");
break;
Expand Down Expand Up @@ -542,12 +542,12 @@ static void mousekey_console_help(void)
print("4: select mk_time_to_max\n");
print("5: select mk_wheel_max_speed\n");
print("6: select mk_wheel_time_to_max\n");
print("p: print prameters\n");
print("p: print parameters\n");
print("d: set default values\n");
print("up: increase prameters(+1)\n");
print("down: decrease prameters(-1)\n");
print("pgup: increase prameters(+10)\n");
print("pgdown: decrease prameters(-10)\n");
print("up: increase parameters(+1)\n");
print("down: decrease parameters(-1)\n");
print("pgup: increase parameters(+10)\n");
print("pgdown: decrease parameters(-10)\n");
print("\nspeed = delta * max_speed * (repeat / time_to_max)\n");
print("where delta: cursor="); pdec(MOUSEKEY_MOVE_DELTA);
print(", wheel="); pdec(MOUSEKEY_WHEEL_DELTA); print("\n");
Expand Down
2 changes: 1 addition & 1 deletion common/suspend.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


void suspend_idle(uint8_t timeout);
void suspend_power_down(uint8_t timeout);
void suspend_power_down(void);
bool suspend_wakeup_condition(void);
void suspend_wakeup_init(void);

Expand Down
2 changes: 1 addition & 1 deletion converter/adb_usb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ modifiers except for GUI key(Windows/Command).
And most ADB keyboard has no diodes in its matrix so they are not NKRO,
though ADB protocol itself supports it. See protocol/adb.c for more info.

If keyobard has ISO layout you need to use ISO keymap with `make KEYMAP=iso`. With ANSI
If keyboard has ISO layout you need to use ISO keymap with `make KEYMAP=iso`. With ANSI
keymap you will suffer from swapped keys problem.

https://github.com/tmk/tmk_keyboard/issues/35
Expand Down
2 changes: 1 addition & 1 deletion doc/keycode.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ KC_F12 45 Keyboard F12
KC_PSCREEN KC_PSCR 46 Keyboard PrintScreen1
KC_SCKLOCK KC_SLCK 47 Keyboard Scroll Lock11
KC_PAUSE KC_PAUS 48 Keyboard Pause1
KC_INSERT KC_INT 49 Keyboard Insert1
KC_INSERT KC_INS 49 Keyboard Insert1
KC_HOME 4A Keyboard Home1
KC_PGUP 4B Keyboard PageUp1
KC_DELETE KC_DELETE 4C Keyboard Delete Forward
Expand Down
1 change: 1 addition & 0 deletions doc/other_projects.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Other Keyboard Firmware Projects
## ErgoDox[Ergo][Split][USB][AVR]
- <http://geekhack.org/index.php?topic=22780.0>
- <https://github.com/benblazak/ergodox-firmware>
- <https://github.com/cub-uanic/tmk_keyboard>

## Suka's keyboard collection[Ergo][Split][3DPrinting][USB][AVR]
- <http://deskthority.net/workshop-f7/my-diy-keyboard-collection-or-how-i-became-a-kb-geek-t2534.html>
Expand Down
117 changes: 117 additions & 0 deletions keyboard/ghost_squid/Makefile.lufa
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
#----------------------------------------------------------------------------
# On command line:
#
# make all = Make software.
#
# make clean = Clean out built project files.
#
# make coff = Convert ELF to AVR COFF.
#
# make extcoff = Convert ELF to AVR Extended COFF.
#
# make program = Download the hex file to the device.
# Please customize your programmer settings(PROGRAM_CMD)
#
# make teensy = Download the hex file to the device, using teensy_loader_cli.
# (must have teensy_loader_cli installed).
#
# make dfu = Download the hex file to the device, using dfu-programmer (must
# have dfu-programmer installed).
#
# make flip = Download the hex file to the device, using Atmel FLIP (must
# have Atmel FLIP installed).
#
# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
# (must have dfu-programmer installed).
#
# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
# (must have Atmel FLIP installed).
#
# make debug = Start either simulavr or avarice as specified for debugging,
# with avr-gdb or avr-insight as the front end for debugging.
#
# make filename.s = Just compile filename.c into the assembler code only.
#
# make filename.i = Create a preprocessed source file for use in submitting
# bug reports to the GCC project.
#
# To rebuild project do "make clean" then "make all".
#----------------------------------------------------------------------------

# Target file name (without extension).
TARGET = ghostsquid_lufa

# Directory common source filess exist
TOP_DIR = ../..

# Directory keyboard dependent files exist
TARGET_DIR = .

# List C source files here. (C dependencies are automatically generated.)
SRC = keymap.c \
matrix.c \
led.c

CONFIG_H = config.h

# MCU name
MCU = atmega32u2

# Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
#
# This will be an integer division of F_USB below, as it is sourced by
# F_USB after it has run through any CPU prescalers. Note that this value
# does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate
# software delays.
F_CPU = 16000000

#
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH = AVR8

# Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the
# input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
# at the end, this will be done automatically to create a 32-bit value in your
# source code.
#
# If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU)


# Build Options
# comment out to disable the options.
#
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
#CONSOLE_ENABLE = yes # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA


# Boot Section Size in bytes
# Teensy halfKay 512
# Atmel DFU loader 4096
# LUFA bootloader 4096
OPT_DEFS += -DBOOTLOADER_SIZE=4096

# Search Path
VPATH += $(TARGET_DIR)
VPATH += $(TOP_DIR)

include $(TOP_DIR)/protocol/lufa.mk
include $(TOP_DIR)/common.mk
include $(TOP_DIR)/rules.mk
20 changes: 20 additions & 0 deletions keyboard/ghost_squid/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The Ghost Squid controller
==========================
Custom controller for the Cooler Master QuickFire XT keyboard designed by bpiphany.

*Note that this is not the official firmware*

Build
-----
Move to this directory then just run `make` like:

$ make -f Makefile.lufa

At the moment only the LUFA stack is supported.


Bootloader
---------
To enter bootloader by hardware use a magnet above the controller before connecting the usb cable.

It is still possible to use Boot Magic and Command (LSFT+RSFT+PAUS) to access the bootloader though.
43 changes: 43 additions & 0 deletions keyboard/ghost_squid/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
Copyright 2014 Ralf Schmitt <ralf@bunkertor.net>

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/>.
*/

#ifndef CONFIG_H
#define CONFIG_H

/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED // 0x2516 (original CM XT value)
#define PRODUCT_ID 0x001A
#define DEVICE_VER 0x0000
#define MANUFACTURER Cooler Master
#define PRODUCT Cooler Master QuickFire XT

/* message strings */
#define DESCRIPTION t.m.k. keyboard firmware for Cooler Master QuickFire XT

/* matrix size */
#define MATRIX_ROWS 8
#define MATRIX_COLS 18

/* Set 0 if need no debouncing */
#define DEBOUNCE 5

/* key combination for command */
#define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)

#endif
Loading