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

updating dev #11

Merged
merged 218 commits into from
Apr 7, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
218 commits
Select commit Hold shift + click to select a range
6bf8000
added serial mouse driver for Microsoft and Mousesystems mice
rhaberkorn Jul 27, 2014
388fe60
fixed PS/2 keyboard converter config
rhaberkorn Jul 27, 2014
7dde35d
integrated serial mouse drivers as a feature into the firmware archit…
rhaberkorn Jul 27, 2014
0bfba7a
factored out serial_mouse_init() into serial_mouse.h
rhaberkorn Jul 27, 2014
eb90284
serial_mouse: simplified clipping of X/Y/V/H changes below -127 using…
rhaberkorn Jul 27, 2014
03fd4a6
updated copyrights: serial_mouse.h, serial_mouse_microsoft.c and seri…
rhaberkorn Jul 27, 2014
2e0e21d
Port action_* to mbed
yashikno Jun 16, 2014
54aee16
Fix timer.h to include AVR specific header
yashikno Jun 25, 2014
ea60dae
Fix for new API(key_t to keypos_t)
yashikno Jun 25, 2014
4069776
Add initial files for RN-42
yashikno Jun 25, 2014
47bc301
Ad hoc fix of command API
yashikno Jun 30, 2014
be19b2b
Change buffer size: 256 bytes
yashikno Jun 30, 2014
31a298f
Add RN-42 Bluetooth module support
yashikno Jun 30, 2014
cd86104
Fix consumer key bug
yashikno Jul 1, 2014
faf9adb
Change keymap for rn42
yashikno Jul 1, 2014
6cec158
Update TODO
yashikno Jul 1, 2014
1619d68
Update MEMO.txt
yashikno Jul 7, 2014
01fa462
Fix configure mode of RN-42
yashikno Jul 7, 2014
862f519
Add software UART and battery monitor
yashikno Jul 14, 2014
fa545c8
Fix rn42.h API
yashikno Jul 17, 2014
b4e4f59
Add rn42_task
yashikno Jul 17, 2014
59ea5e0
Mkdir rn42
yashikno Jul 18, 2014
50bcaa6
Clean up mbed_onekey
yashikno Jul 19, 2014
3e78754
Add flow control by firmware to serial_uart
yashikno Jul 20, 2014
4b2b32a
Add rn42_lined(): connection status(GPIO2)
yashikno Jul 23, 2014
21e68fb
Add help message
yashikno Jul 23, 2014
ae28b16
Add battery monitor and LED control
yashikno Jul 28, 2014
f441ad0
Add initial setting of Linked pin
yashikno Jul 28, 2014
e4b9541
Add connection indicator
yashikno Jul 28, 2014
17f22da
Update MEMO.txt
yashikno Jul 28, 2014
523cc6a
Add build option and Sun specific commands
yashikno Aug 1, 2014
4f22a45
Add support for HHKB JP
yashikno Aug 20, 2014
28c1bf2
Add files missing for JP support.
yashikno Aug 24, 2014
af19f56
Support for Lightpad keypad
xauser Aug 23, 2014
10eb70a
Merge pull request #134 from xauser/master
tmk Aug 25, 2014
b316f19
Merge branch 'serial-mouse' of git://github.com/rhaberkorn/tmk_keyboa…
yashikno Aug 25, 2014
8b9c61a
Revert ps2_usb/Makefile and config.h
yashikno Aug 26, 2014
8f5f25f
Revert lufa/lufa.c
yashikno Aug 26, 2014
c4530ab
Add serial_mouse_task in keyboard.c
yashikno Aug 26, 2014
c672cbc
Add option 7bit data to serial_soft.c
yashikno Aug 26, 2014
4799c99
Add serialmouser_usb project
yashikno Aug 26, 2014
b9e2653
Merge branch 'rhaberkorn-serial-mouse'
yashikno Aug 26, 2014
807ed33
Fix rn42_linked() to use pullup
yashikno Aug 30, 2014
02939ab
Add battery management
yashikno Sep 3, 2014
3b81ffc
Monitor battery and alert low voltage
yashikno Sep 4, 2014
38714e8
Update MEMO and remove a build option to save flash
yashikno Sep 4, 2014
d8dd18b
Improve rn42_task time resolution
yashikno Sep 5, 2014
c35e3e8
usb_usb: Remove mention of merged usb_hid branch
scottjad Sep 15, 2014
a59dea5
usb_usb: Remove mention of downloading LUFA
scottjad Sep 15, 2014
2015027
Add FET swtich for battery ADC
yashikno Sep 19, 2014
ea524d7
Adhoc fix compile error of usb_usb
yashikno Sep 22, 2014
e3f4f7d
Merge branch 'scottjad-master' into usb_usb_fix
yashikno Sep 22, 2014
dd3ab65
Merge branch 'usb_usb_fix'
yashikno Sep 22, 2014
bfd2d96
Add keyboard LED control via Bluetooth
yashikno Sep 22, 2014
27967f2
Add TMK converter support to Next converter
yashikno Sep 24, 2014
8cec0bc
Fix typo of variable name
yashikno Sep 24, 2014
821c719
Add action 'Momentary switching with Modifiers'
yashikno Sep 29, 2014
6c06b90
Add power control of key switch board
yashikno Oct 2, 2014
9391504
fixed vusb variant of converter ps2usb
0mark Nov 13, 2014
c49cb01
Merge pull request #142 from 0mark/master
tmk Nov 13, 2014
7b0b8ee
ignore files with trailing ~
tufty Nov 11, 2014
8180709
Fix for 'unnamed field in initializer' GCC bug(Fix #143)
yashikno Nov 14, 2014
a58b9dd
Add initializer of debug_config for GCC < 4.6.0(#144)
yashikno Nov 14, 2014
1961641
Merge branch 'action_fix'
yashikno Nov 17, 2014
09e6f71
adb_usb: Remove old comment of Makefile
yashikno Nov 19, 2014
eb90ed6
ps2_usb: Fix README
tmk Nov 20, 2014
c2d830c
USB initialize when plug-in during battery powered
yashikno Nov 20, 2014
1a9cec9
Documentation: small mistake
cub-uanic Nov 20, 2014
608ebe2
Matrix power saving
yashikno Nov 23, 2014
1f96eda
Remove MCU dependent code from common/keyboard.c
yashikno Nov 23, 2014
60096e1
Update doc
yashikno Nov 23, 2014
3639509
Merge branch 'rn42' into merge_rn42
yashikno Nov 24, 2014
a996396
Fix debug.h
yashikno Nov 24, 2014
e2077ca
Change key_t to keypos_t
yashikno Nov 24, 2014
ed52ebb
Merge branch 'merge_rn42'
yashikno Nov 24, 2014
b92ea1f
Fix endpoint buffer setting for AT90USB82/162.
yashikno Nov 22, 2012
cc5693e
Merge branch 'u2_fix'
yashikno Nov 24, 2014
4192bce
hhkb: Change keymap and bootmagic salt key
tmk Nov 25, 2014
60acd89
Fixing typo in console mode
bswinnerton Nov 30, 2014
f6f698d
usb_usb: Update for new core layout
tmk Dec 5, 2014
6c27cba
init
jackhumbert Dec 8, 2014
1c6770f
init
jackhumbert Dec 8, 2014
9de992b
Change USB PID
tmk Dec 10, 2014
0a9d9b8
Fix print init; print_set_sendchar in main
tmk Dec 10, 2014
4b69ed2
Remove submodule USB_Host_Shield_2.0
tmk Dec 10, 2014
0a181c7
Add submodule legitimate USB_Host_Shield_2.0
tmk Dec 10, 2014
c9674d3
Add USB Hub support
tmk Dec 10, 2014
27795b6
Change debug print config
tmk Dec 10, 2014
30864ea
Update README
tmk Dec 10, 2014
b47450d
Merge branch 'usb_usb_hub'
tmk Dec 10, 2014
a0d6bb1
usb_usb: Add SpaceFn and hasu keymap
tmk Dec 10, 2014
d9a1b90
led
jackhumbert Dec 11, 2014
5cc0d35
Update keymap_planck.c
charlesmartin Dec 11, 2014
e4c4d6a
Merge pull request #1 from charlesmartin/patch-2
jackhumbert Dec 11, 2014
4a8b9b8
Update keymap_planck.c
jackhumbert Dec 12, 2014
4e3397c
Update matrix.c
jackhumbert Dec 12, 2014
79849ee
Update keymap_common.h
jackhumbert Dec 12, 2014
ed8d9a0
added planck folder
jackhumbert Dec 14, 2014
bb25960
[ps2,terminal_usb] Quick fix for build problem
tmk Dec 24, 2014
5a8dbc6
Add keycode for Fast Forward & Rewind
mumchristmas Dec 26, 2014
af556d3
Remove unwanted white space
tmk Dec 26, 2014
6a97efc
Merge branch 'mumchristmas-Apple_media_key_fix' #160
tmk Dec 26, 2014
a6d33e2
Added support for The Ghost Squid controller used for CM XT keyboard.
vovcacik Dec 28, 2014
2e17aa2
usb_usb: update README
tmk Dec 30, 2014
22d99f2
Fix modifier stuck of Lock command(#127)
tmk Jan 1, 2015
06527bd
bluefruit, pjrc: Update protocols for new API
tmk Jan 3, 2015
02a9f8a
Update other_projects.md - added TMK/Ergodox
cub-uanic Jan 3, 2015
8f1e311
Ad hoc fix of print and debug for mbed
tmk Dec 12, 2014
75a59e4
Update makefiles to mbed-sdk 14666bb
tmk Dec 14, 2014
5419130
Fix ps2 protocol build using ps2_io.h
tmk Dec 14, 2014
e259a72
Add keyboard/infinity
tmk Jan 2, 2015
d5e5dbd
Add openocd config files for K20
tmk Jan 2, 2015
4acde45
Fix linker script for NVIC vector on RAM
tmk Jan 3, 2015
c6e533c
infinity: Move project specific files to local
tmk Jan 3, 2015
d0fefb7
infinity: Add initial files for keyboard support
tmk Jan 4, 2015
3dbb762
Merge branch 'mbed_infinity'
tmk Jan 4, 2015
2de5379
Update keymap_jack.c
jackhumbert Jan 5, 2015
33e2a62
dotcom
jackhumbert Jan 5, 2015
d6f2f87
dotcom
jackhumbert Jan 5, 2015
10a6b2c
hhkb: Add Makefile.jp for HHKB JP
tmk Jan 10, 2015
42fe422
names
jackhumbert Jan 12, 2015
98f486a
atomic
jackhumbert Jan 12, 2015
2e0d872
sean
jackhumbert Jan 13, 2015
173dbe3
Create keymap_shane.c
jackhumbert Jan 15, 2015
4225f03
Merge branch 'planck-jack'
jackhumbert Jan 15, 2015
a54da1b
Merge remote-tracking branch 'upstream/master'
jackhumbert Jan 15, 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
a7a8087
Update README.md
jackhumbert Jan 15, 2015
3e88e8b
hhkb: Fix layer stuck of keymap_hasu
tmk Jan 15, 2015
ce66988
hhkb_rn42: Move doc
tmk Jan 15, 2015
83a3d7a
Update README.md
jackhumbert Jan 16, 2015
099701d
hhkb: Integrate RN-42 support, remove hhkb_rn42
tmk Jan 16, 2015
c610bae
Merge branch 'rn42_integrate'
tmk Jan 16, 2015
e7289bb
KC_INSERT should be KC_INS
nathanrosspowell 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
6f735ca
Update README.md
jackhumbert Jan 23, 2015
adf7b56
subproject commit?
jackhumbert Jan 23, 2015
09655cc
Create keymap_nathan.c
jackhumbert Jan 23, 2015
6cae907
Create keymap_matthew.c
jackhumbert Jan 23, 2015
438ff34
defined KEYMAP_GRID for grid layouts
pepers Jan 23, 2015
1d3f3cd
Merge pull request #3 from pepers/master
jackhumbert Jan 23, 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
b8c9195
defined semi-standard and short space layouts
pepers Jan 27, 2015
46b38fa
Merge pull request #4 from pepers/master
jackhumbert Jan 27, 2015
24218b5
Merge branch 'master' of https://github.com/jackhumbert/tmk_keyboard
jackhumbert Feb 5, 2015
4a3c083
sean
jackhumbert Feb 15, 2015
a4d091e
joe
jackhumbert Feb 20, 2015
cf4363c
joe
jackhumbert Feb 20, 2015
88cc5ce
joe
jackhumbert Feb 20, 2015
7884125
joe
jackhumbert Feb 20, 2015
64dc478
vlad
jackhumbert Feb 21, 2015
a538f71
led oops
jackhumbert Feb 24, 2015
ea6de22
brett
jackhumbert Feb 26, 2015
ceff938
simon
jackhumbert Mar 3, 2015
c35c428
infinity: For production model and add SpaceFn
tmk Mar 5, 2015
0fcb3b6
brett
jackhumbert Mar 5, 2015
15b9bce
Initial commit for Planck PCB Rev 1.
Mar 16, 2015
b80b6b3
Added backlight.h, backlight.c
Mar 16, 2015
6568081
Replaced tabs with spaces to match TMK convention.
Mar 16, 2015
0fc820c
Merge pull request #5 from Wilba6582/master
jackhumbert Mar 16, 2015
a296c83
Create handwire-matrix.c
jackhumbert Mar 16, 2015
be86aef
Rename handwire-matrix.c to matrix-handwire.c
jackhumbert Mar 16, 2015
9307a0a
Merge pull request #6 from tmk/master
jackhumbert Mar 16, 2015
9c3a956
Update README.md
jackhumbert Mar 18, 2015
e3169cc
m0110: Add support for international keyboard
tmk Mar 18, 2015
9b4914b
m0110: Fix README.md and keymap_intl.c
tmk Mar 18, 2015
d23d953
m0110: Fix Makefile
tmk Mar 18, 2015
80c4cdb
Merge remote-tracking branch 'upstream/master'
nathanrosspowell Mar 19, 2015
e958bac
Delete .keymap_nathan.c.swp
nathanrosspowell Mar 19, 2015
e9df959
Update keymap_nathan.c
nathanrosspowell Mar 19, 2015
afa0f9d
Merge pull request #8 from nathanrosspowell/master
jackhumbert Mar 19, 2015
b688e68
Create keymap_tim.c
jackhumbert Mar 19, 2015
708f95a
working extended keymap
jackhumbert Mar 20, 2015
a94bede
Merge branch 'master' of https://github.com/jackhumbert/tmk_keyboard
jackhumbert Mar 20, 2015
5c45ba9
function stuff too
jackhumbert Mar 21, 2015
3d286a8
colemak shortcuts
jackhumbert Mar 21, 2015
a33ec2f
updated readme
jackhumbert Mar 21, 2015
2e0fd30
Merge pull request #9 from tmk/master
jackhumbert Mar 21, 2015
9514ee8
Update README.md
jackhumbert Mar 21, 2015
4454ded
macros
jackhumbert Mar 23, 2015
f1daa26
macros
jackhumbert Mar 23, 2015
4209486
Latest custom map with lower + raise
Apr 2, 2015
71f7713
Merge pull request #10 from huntse/pull_req
jackhumbert Apr 2, 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
*.map
*.sym
tags
*~
build/
*.bak
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "protocol/usb_hid/USB_Host_Shield_2.0"]
path = protocol/usb_hid/USB_Host_Shield_2.0
url = git@github.com:tmk/USB_Host_Shield_2.0.git
[submodule "protocol/lufa/LUFA-git"]
path = protocol/lufa/LUFA-git
url = https://github.com/abcminiuser/lufa.git
[submodule "protocol/usb_hid/USB_Host_Shield_2.0"]
path = protocol/usb_hid/USB_Host_Shield_2.0
url = https://github.com/felis/USB_Host_Shield_2.0.git
24 changes: 22 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@ You can find some keyboard specific projects under `converter` and `keyboard` di
* [macway](keyboard/macway/) - [Compact keyboard mod][GH_macway] [retired]
* [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]
* [planck](keyboard/planck/) - [Planck] Ortholinear 40% keyboard
* [atomic](keyboard/atomic/) - [Atomic] Ortholinear 60% keyboard

### 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 @@ -72,7 +84,15 @@ You can find some keyboard specific projects under `converter` and `keyboard` di
[PC98]: http://en.wikipedia.org/wiki/NEC_PC-9801
[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
[Planck]: http://planckkeyboard.com
[Atomic]: http://atomickeyboard.com


License
Expand Down Expand Up @@ -276,4 +296,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).
1 change: 1 addition & 0 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ SRC += $(COMMON_DIR)/host.c \
$(COMMON_DIR)/action_util.c \
$(COMMON_DIR)/keymap.c \
$(COMMON_DIR)/print.c \
$(COMMON_DIR)/debug.c \
$(COMMON_DIR)/util.c \
$(COMMON_DIR)/avr/suspend.c \
$(COMMON_DIR)/avr/xprintf.S \
Expand Down
12 changes: 11 additions & 1 deletion common/action.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,16 @@ void process_action(keyrecord_t *record)
case ACT_LAYER_TAP:
case ACT_LAYER_TAP_EXT:
switch (action.layer_tap.code) {
case 0xe0 ... 0xef:
/* layer On/Off with modifiers(left only) */
if (event.pressed) {
layer_on(action.layer_tap.val);
register_mods(action.layer_tap.code & 0x0f);
} else {
layer_off(action.layer_tap.val);
unregister_mods(action.layer_tap.code & 0x0f);
}
break;
case OP_TAP_TOGGLE:
/* tap toggle */
if (event.pressed) {
Expand Down Expand Up @@ -338,7 +348,7 @@ void register_code(uint8_t code)
return;
}

#ifdef LOCKING_SUPPORT_ENABLE
#ifdef LOCKING_SUPPORT_ENABLE
else if (KC_LOCKING_CAPS == code) {
#ifdef LOCKING_RESYNC_ENABLE
// Resync: ignore if caps lock already is on
Expand Down
3 changes: 2 additions & 1 deletion common/action_code.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* ACT_LAYER_TAP(101x):
* 101E|LLLL| keycode On/Off with tap key
* 101E|LLLL|1110 xxxx Reserved(0xE0-EF)
* 101E|LLLL|1110 mods On/Off with modifiers(0xE0-EF)
* 101E|LLLL|1111 0000 Invert with tap toggle(0xF0)
* 101E|LLLL|1111 0001 On/Off
* 101E|LLLL|1111 0010 Off/On
Expand Down Expand Up @@ -266,6 +266,7 @@ enum layer_pram_tap_op {
#define ACTION_LAYER_ON_OFF(layer) ACTION_LAYER_TAP((layer), OP_ON_OFF)
#define ACTION_LAYER_OFF_ON(layer) ACTION_LAYER_TAP((layer), OP_OFF_ON)
#define ACTION_LAYER_SET_CLEAR(layer) ACTION_LAYER_TAP((layer), OP_SET_CLEAR)
#define ACTION_LAYER_MODS(layer, mods) ACTION_LAYER_TAP((layer), 0xe0 | (mods)&0x0f)
/* With Tapping */
#define ACTION_LAYER_TAP_KEY(layer, key) ACTION_LAYER_TAP((layer), (key))
#define ACTION_LAYER_TAP_TOGGLE(layer) ACTION_LAYER_TAP((layer), OP_TAP_TOGGLE)
Expand Down
72 changes: 48 additions & 24 deletions common/avr/suspend.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
#include "backlight.h"
#include "suspend_avr.h"
#include "suspend.h"
#include "timer.h"
#ifdef PROTOCOL_LUFA
#include "lufa.h"
#endif


#define wdt_intr_enable(value) \
Expand All @@ -26,30 +30,46 @@ __asm__ __volatile__ ( \
)


void suspend_power_down(void)
void suspend_idle(uint8_t time)
{
#ifdef BACKLIGHT_ENABLE
backlight_set(0);
#endif
#ifndef NO_SUSPEND_POWER_DOWN
// Enable watchdog to wake from MCU sleep
cli();
wdt_reset();
set_sleep_mode(SLEEP_MODE_IDLE);
sleep_enable();
sei();
sleep_cpu();
sleep_disable();
}

/* Power down MCU with watchdog timer
* wdto: watchdog timer timeout defined in <avr/wdt.h>
* WDTO_15MS
* WDTO_30MS
* WDTO_60MS
* WDTO_120MS
* WDTO_250MS
* WDTO_500MS
* WDTO_1S
* WDTO_2S
* WDTO_4S
* WDTO_8S
*/
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 and System Reset Mode
//wdt_enable(WDTO_1S);
//WDTCSR |= _BV(WDIE);

// Watchdog Interrupt Mode
wdt_intr_enable(WDTO_120MS);
wdt_intr_enable(wdto);

// TODO: more power saving
// See PicoPower application note
// - I/O port input with pullup
// - prescale clock
// - BOD disable
// - Power Reduction Register PRR
// sleep in power down mode
set_sleep_mode(SLEEP_MODE_PWR_DOWN);
sleep_enable();
sei();
Expand All @@ -58,12 +78,18 @@ void suspend_power_down(void)

// Disable watchdog after sleep
wdt_disable();
#endif
}

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

bool suspend_wakeup_condition(void)
{
matrix_power_up();
matrix_scan();
matrix_power_down();
for (uint8_t r = 0; r < MATRIX_ROWS; r++) {
if (matrix_get_row(r)) return true;
}
Expand All @@ -84,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
8 changes: 8 additions & 0 deletions common/avr/xprintf.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
#include <inttypes.h>
#include <avr/pgmspace.h>

#ifdef __cplusplus
extern "C" {
#endif

extern void (*xfunc_out)(uint8_t);
#define xdev_out(func) xfunc_out = (void(*)(uint8_t))(func)

Expand Down Expand Up @@ -99,5 +103,9 @@ char xatoi(char **str, long *ret);
Pointer to return value
*/

#ifdef __cplusplus
}
#endif

#endif

41 changes: 26 additions & 15 deletions common/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,39 +63,49 @@ static uint8_t numkey2num(uint8_t code);
static void switch_default_layer(uint8_t layer);


typedef enum { ONESHOT, CONSOLE, MOUSEKEY } cmdstate_t;
static cmdstate_t state = ONESHOT;
command_state_t command_state = ONESHOT;


bool command_proc(uint8_t code)
{
switch (state) {
switch (command_state) {
case ONESHOT:
if (!IS_COMMAND())
return false;
return (command_extra(code) || command_common(code));
break;
case CONSOLE:
command_console(code);
if (IS_COMMAND())
return (command_extra(code) || command_common(code));
else
return (command_console_extra(code) || command_console(code));
break;
#ifdef MOUSEKEY_ENABLE
case MOUSEKEY:
mousekey_console(code);
break;
#endif
default:
state = ONESHOT;
command_state = ONESHOT;
return false;
}
return true;
}

/* TODO: Refactoring is needed. */
/* This allows to define extra commands. return false when not processed. */
bool command_extra(uint8_t code) __attribute__ ((weak));
bool command_extra(uint8_t code)
{
return false;
}

bool command_console_extra(uint8_t code) __attribute__ ((weak));
bool command_console_extra(uint8_t code)
{
return false;
}


/***********************************************************
* Command common
Expand Down Expand Up @@ -184,6 +194,7 @@ static bool command_common(uint8_t code)
case KC_CAPSLOCK:
if (host_get_driver()) {
host_driver = host_get_driver();
clear_keyboard();
host_set_driver(0);
print("Locked.\n");
} else {
Expand All @@ -203,7 +214,7 @@ static bool command_common(uint8_t code)
command_console_help();
print("\nEnter Console Mode\n");
print("C> ");
state = CONSOLE;
command_state = CONSOLE;
break;
case KC_PAUSE:
clear_keyboard();
Expand Down Expand Up @@ -292,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 @@ -388,14 +399,14 @@ static bool command_console(uint8_t code)
case KC_Q:
case KC_ESC:
print("\nQuit Console Mode\n");
state = ONESHOT;
command_state = ONESHOT;
return false;
#ifdef MOUSEKEY_ENABLE
case KC_M:
mousekey_console_help();
print("\nEnter Mousekey Console\n");
print("M0>");
state = MOUSEKEY;
command_state = MOUSEKEY;
return true;
#endif
default:
Expand Down Expand Up @@ -531,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 All @@ -555,7 +566,7 @@ static bool mousekey_console(uint8_t code)
mousekey_param = 0;
print("\nQuit Mousekey Console\n");
print("C> ");
state = CONSOLE;
command_state = CONSOLE;
return false;
case KC_P:
mousekey_param_print();
Expand Down
10 changes: 8 additions & 2 deletions common/command.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef COMMAND_H
#define COMMAND

/* TODO: Refactoring */
typedef enum { ONESHOT, CONSOLE, MOUSEKEY } command_state_t;
extern command_state_t command_state;

/* This allows to extend commands. Return false when command is not processed. */
bool command_extra(uint8_t code);
bool command_console_extra(uint8_t code);

#ifdef COMMAND_ENABLE
bool command_proc(uint8_t code);
/* This allows to extend commands. Return 0 when command is not processed. */
bool command_extra(uint8_t code);
#else
#define command_proc(code) false
#endif
Expand Down
Loading