Dev Catchup Pull Request - johnfonte
(merge branch master with dev)
See commit history. Primarily:
- the build process changed a bit to make things easier for the UI
- a couple key functions were added (including code for an integrated numpad)
- a whole bunch of stuff was reorganized
- work was started on changing the way layers and layer switching are handled
- things were updated for the new PCB prototype by Fredrik (bpiphany) (and diode direction is now selectable during compilation by setting some macros in src/keyboard/ergodox/options.h)
Everything tests out on the breadboard, and with the PCB as far as I can tell. I don't know if testing has been done with a complete keyboard using the new PCB yet.
- rows are now 0..6, cols now 0..D (matching the pics Fredrik posted of
his first flippable PCB)
- either rows or columns can now be the driving pins. the option is in
".../keyboard/.../options.h"
- linked lists need to be rewritten to be more memory efficient
- all kbfun functions are now of type `(void kbfun_...(void))`, and the
arguments they need are passed via a group of global `main_arg_...`
variables (and other `main_...` variables)
- new ergodox website
- clarification in licence indicating that parts of the project may not
be under that license/copyright
- currently the stuff in src/lib, and soon the stuff in contrib,
(are|will be) under different copyrights, and possibly different
licenses.
- also, just so it's written down somewhere: some of my documentation
may be considered derivative works of the specs|docs i was taking
things from, but i hope i'm safe (fair use?). i tried to make clear
in each file where i got stuff though.
- the numpad functions are reorganized, and there are more of them now,
so the numpad can be treated either as something that's toggled or
something that's locked
- the numpad functions may need to be split into a separate file, to
keep things pretty. i'll look into it later.
- the linked-list functions are being written so that hopefully i can
change the concept of how layers (with transitions and masking) are
handled. they're incomplete in this check in because i took a break
to fix the numpad functions for dox
also added another layer to _kb_layout_release[][][], mostly NULL, but
including at least one of each available kbfun*(). this way, all the
functions appear to be used, and none of them get optimised out by the
compiler
- changed KBFUN_FUNCTION_ARGS again
- changed kbfun's
- condensed `kbfun_press()` and `kbfun_release()` to `kbfun_press_release()`
- added `kbfun_toggle()`, which toggles keycodes on or off
- added `kbfun_layer_inc_dec_press_release()` which is like
...press_release(), except it increments the layer first (and
decrements it on keyrelease)
- added `_kbfun_exec_key()` (which is a public kbfun*(), but not for
assignment to keycodes) for convenience. used by main(), and
currently 1 of the kbfun*()s. it doesn't save a lot of code, but i
think it makes things slightly easier to read. not quite as elegant
a solution as i'd like, but it might have to do
- changed keymap accordingly
- changed main()
- now using `_kbfun_exec_key()` (instead of essentially inlining the code)
- now sending the USB report once every cycle. i was sending once for
every keypress (lol, by mistake: what i meant to do was only send it
if any keys had been pressed).
so that _kb_layout_press... and ...release... are of type uint8_t
instead of kbfun_funptr_t (saving 1 byte per key per layer per matrix =
40% of the total layout size).
this brings the total firmware size with 10 layers to 6574 bytes instead
of 8302 bytes. the teensy 2.0 has 32256 bytes of flash.
i'm going to revert to the old way. partly because the space savings
don't seem consequential compared to what we have to work with. mostly
because doing it with an array separates the function pointer to macro
(or const var) correlation in qwerty.c, and because i then have to
extern the _kb_layout_functions[6] array in layout.h (or qwerty.h).
also, using an enum instead of macros with manually assigned numbers
corresponding to the array indices would be more error prone, i think,
because (since it has to be visible outside qwerty.c) it would have to
be declared in a header.
hopefully all that makes sense. i'm in a bit of a hurry. but look at
the code: i think, even with a bit of formatting help, it'd still look
less clean
- addition to references.md
- keymap modification
- now using 2 shifts => capslock
- the previous capslock key -> tab
- the previous tab key -> left bracket
- bug and omission fixes; notably:
- _is_pressed() no longer changes the value of
`keyboard_modifier_keys`, lol
- kbfun_2_keys_capslock_press_release() now works. (capslock doesn't
register if left or right shift is pressed, so the shift state has
to be stored, cleared, capslock pressed, and shift state restored)
- main() no longer locally overwrites the value of `current_layer`
before sending it to the kbfun. (i didn't realize i was using the
same variable name for two different things)
- improvements
- kbfun_layer_inc() and ...dec() are now variable
there is now a toplevel makefile for making dist, so that we can keep
the project build systems separate (in src and contrib/UI*), and then
build dist from the root dir
before, if you pressed a key, then shifted layers, then released it, the
first layer's press() would be called, and the 2nd layer's release()
would be called, causing keys to stick, and probably other errors. now,
the layer that the key was on when it was pressed is kept track of, and
the proper release() is called.
also, layers can be shifted per key now, instead of just for the whole
board at once
i also changed how keyboard-private includes are handled. "private"
stuff is now in its own file, instead of being nested in an extra
`#ifdef`.
and i think that's it. i'm pretty tired right now, so there may be
errors, but it seemed to work all right with cursory tests.