Commit Graph

1307 Commits

Author SHA1 Message Date
László Monda
1639f82e63 Add right keyboard matrix initialization for the 7th generation prototype and create a new build and debug configuration for it. KDS doesn't add the macro for some reason. 2016-12-21 08:34:11 +01:00
László Monda
61fa9c4bd8 Implement JumpToBootloader() based on Santiago's snippet. 2016-12-17 01:31:50 +01:00
László Monda
ebb13da49d Merge pull request #26 from algernon/f/mouse-actions
Mouse action handling
2016-12-15 19:50:12 +01:00
Gergely Nagy
5e48da5a7a Code cleanup
Move a few defines from action.c to action.h.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2016-12-15 18:37:30 +01:00
Gergely Nagy
39dd0df58c Move keyboard event handling into action.c
Since keyboard_layout.[ch] has gained more features, and handles more than just
filling out the keyboard report, move it to action.[ch] instead. I see no sane
way to separate the keyboard and mouse report filling, unless we want to loop
over key states twice, hence them being in the same file.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2016-12-15 18:32:28 +01:00
Gergely Nagy
440c6d8ca8 Initial implementation of mouse actions
This implements the mouse action handling. There is no acceleration while
holding the mouse movement keys yet, though, that will be a separate step.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2016-12-15 18:30:51 +01:00
László Monda
21174c1b4f Merge pull request #25 from algernon/h/window-switch-fix
Fix Mod+d to be Alt+Tab
2016-12-15 11:44:18 +01:00
Gergely Nagy
981305e48d Fix Mod+d to be Alt+Tab
Due to a copy & paste error, Mod+d was doing Shift+Tab instead of Alt+Tab, this
fixes that.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2016-12-15 07:32:15 +01:00
László Monda
0842d3bbb1 Merge pull request #24 from algernon/f/factory-layout
Rearrange the layout to follow the factory layout more closely
2016-12-14 23:10:51 +01:00
Gergely Nagy
03b73b052d Initial Mouse layer layout
This sets up the `Mouse` layer to have all the keys in their right place, even
if they do nothing for now. A number of enums were introduced to make it easier
to describe mouse key behaviour.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2016-12-14 16:57:52 +01:00
Gergely Nagy
10feafdb8b Update the layout to be closer to the factory layout
Adds `Fn` and `Mouse` layers, so the switcher keys actually work. Also
rearranged `Mod` to follow the factory layout, with the added change that
`Shift` keys are also included on the layer. The `Fn` layer was laid out,
according to the factory layout. The `Mouse` layer is mostly empty, except for
some modifiers and the switcher key.

The most significant difference from the factory layout is that modifiers are
present on all layers, in the same position.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2016-12-14 16:55:04 +01:00
László Monda
8caae7f65f Merge pull request #23 from algernon/f/led-display/layer-leds
Light up LEDs on the display when switching layers
2016-12-13 23:42:28 +01:00
Gergely Nagy
a59dcd1662 Lift out the LED brightness into a global
Instead of passing the same constant to LedDisplay_SetLayerLed() all the time,
lift it out into a global.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2016-12-13 23:23:16 +01:00
Gergely Nagy
2a7edbce6f Light up LEDs on the display when switching layers
When switching layers, light up the appropriate LED on the display. For this
purpose, start led_display.[ch], which as a start, has a function to set the
brightness of a layer led.

The function will also turn all other LEDs off, and turn all of them off when on
the base layer.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2016-12-13 20:34:43 +01:00
László Monda
cbdb013977 Merge pull request #21 from algernon/f/layering
Layer handling simplified, and streamlined
2016-12-13 20:05:34 +01:00
Gergely Nagy
d98955a947 Move ActiveLayer back to keyboard_layout.c too
That is the only place we use it from, no need to expose it outside of that.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2016-12-13 19:59:06 +01:00
Gergely Nagy
c77027992b Move layer handling back to keyboard_layout.c
And while there, also drop the helper functions, and just do the activation in
the handler function. This simplifies the code a bit, as there is little point
in lifting out an assignment into a function at this time.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2016-12-13 19:54:34 +01:00
Gergely Nagy
04eb1bab74 Move layer handling to a separate file
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2016-12-13 18:42:32 +01:00
Gergely Nagy
6a502924d2 Simplify the layer handling
There can only be one layer active at any one time, simplify the code
accordingly.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2016-12-13 18:39:05 +01:00
László Monda
58d5cb4de2 Merge pull request #19 from algernon/f/clang-format
Add a clang-format config file
2016-12-13 14:57:05 +01:00
Gergely Nagy
26b666203e Add a clang-format config file
This helps with formatting sources to be closer to the coding style
explained in CONTRIBUTING.md. It's not perfect, but provides a
reasonable base.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2016-12-13 14:50:14 +01:00
László Monda
b9887efa2e Merge pull request #18 from algernon/f/keymap-refactor
Big Keymap Restructure
2016-12-13 14:50:04 +01:00
Gergely Nagy
690addefd9 Coding style fixes
Don't put a space between the function and the opening parens.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2016-12-13 12:52:03 +01:00
Gergely Nagy
9f61c3227c Changes based on the review notes
This does a lot of things - all of this together, because it would have been
much harder to split them up into many small commits.

We get rid of the helper macros used in default_layout.c, drop the .raw member
of uhk_key_t, use a singleton keymap, and prepare the prevKeyStates to handle
all slots. Also drops the TRNS macro.

With these changes, default_layout.h became obsolete, and was deleted too.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2016-12-12 23:16:26 +01:00
Gergely Nagy
0b09fb0055 Remove some now obsolete defines
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2016-12-12 21:55:30 +01:00
Gergely Nagy
265988ee25 Better key state tracking
We need to store the previous state of the keys, to figure out when a specific
key is released, as opposed to simply not being pressed. This is required for
layer keys such as `Mod` and `Fn` to work properly when there are more than one
of them on the keymap.

Without being able to tell when a key is released, we would not be able to turn
a layer off only when no layer key is held. Not easily, anyway: we'd have to
track the state of all layer keys... but then it is easier to just track them
all.

Thankfully, the memcpy at the end is fast, as it only needs to copy 70 bytes.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2016-12-12 20:14:09 +01:00
Gergely Nagy
6aedaf7074 Big Keymap Refactor(tm)
This changes the keymap layout to be as described in #17, and updates the
default layout to follow. (Also adds the missing Space and Mod keys on the two
keys below the bottom row)

The layout itself was considerably simplified by introducing a few local macros
to hide some of the uglier details.

Fixes #17.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2016-12-12 20:10:42 +01:00
László Monda
1f8fc560e4 Clean up some concepts regarding slots and modules. 2016-12-12 01:01:36 +01:00
László Monda
871a0ec84a Remove variables because they yield warnings which shouldn't happen according to our contributing guide. 2016-12-12 00:25:13 +01:00
László Monda
851d3a9051 Update CONTRIBUTING.md 2016-12-12 00:24:12 +01:00
László Monda
f66eb06712 Coding style fixes. 2016-12-12 00:21:39 +01:00
László Monda
de6218ce0c Convert tabs to 4 spaces. 2016-12-11 23:59:28 +01:00
László Monda
ee87e79791 Update README.md 2016-12-11 23:50:21 +01:00
László Monda
bb37d89de9 Update CONTRIBUTING.md 2016-12-11 23:47:59 +01:00
László Monda
c8b773d266 Update CONTRIBUTING.md 2016-12-11 23:44:40 +01:00
László Monda
93594bbfc8 Update CONTRIBUTING.md 2016-12-11 23:39:24 +01:00
László Monda
a257e55403 Update CONTRIBUTING.md 2016-12-11 23:33:13 +01:00
László Monda
7bebaff8dd Update CONTRIBUTING.md 2016-12-11 23:21:33 +01:00
László Monda
39ad8c6735 Update CONTRIBUTING.md 2016-12-11 23:14:29 +01:00
László Monda
39a9d196f7 Update CONTRIBUTING.md 2016-12-11 22:51:16 +01:00
László Monda
463a9fb8d4 Merge pull request #14 from algernon/f/key-handling-rework
Rework the keyboard layout handling
2016-12-11 19:56:35 +01:00
Gergely Nagy
e758e088a7 Rework the keyboard layout handling
We now use a 32-bit structure to describe each key, and an `uhk_key_t` type that
wraps all the supported things into a union. But this is not the only change: to
be able to move the Fn/Mod keys anywhere, instead of hardcoding their location,
they are now proper layer keys. To make it easier to handle turning a layer off,
key releases can be handled explicitly, too.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2016-12-11 19:22:31 +01:00
László Monda
b3ed9536c6 Merge pull request #13 from algernon/f/LED/SetAllLedsTo
LEDs: Add a method to set all LEDs to a given brightness
2016-12-11 11:52:56 +01:00
Gergely Nagy
5ee11c2f8f LEDs: Add a method to set all LEDs to a given brightness
Mostly for testing purposes, but can be used later for backlight up/down stuff,
too.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2016-12-11 09:57:48 +01:00
László Monda
ed0b51dbff Restore the original I2c{Read,Write}() implementations to make the communication between keyboard halves fully functional again. Fixes #8. 2016-12-09 22:24:15 +01:00
László Monda
6c6afd6395 Make comments more explicit. 2016-12-09 21:59:19 +01:00
László Monda
71e0ae79d7 Merge branch 'master' of github.com:UltimateHackingKeyboard/firmware 2016-12-09 21:44:31 +01:00
László Monda
c47105afd3 Change I2cRead() and I2cWrite() to more closely resemble I2C_MasterReadBlocking() and I2C_MasterWriteBlocking() respectively. This way, we should be able to figure out the root cause of the communication error regarding the blink script more easily. 2016-12-09 21:44:03 +01:00
László Monda
a8b19750a9 Update README.md 2016-11-20 18:30:41 +01:00
László Monda
eff18c176d Update README.md 2016-11-20 18:26:24 +01:00