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.
without this we have ghosting problems on the bottommost keys of the
teensy side
thanks to hasu (on geekhack) for the suggestion, and PrinsValium for
confirming erratic behavior with his firmware without these delays.
thanks DOX for making the changes and trying it out. i'm just adding it
to the repo.
new usb library (my attempt at implementing mouse keys and nkro) in (slow)
progress
a few larger things
- new makefile
- added descriptions to most entries in the references.md file
- moved keyboard layouts to program space
- updated for DOX's PCB! :) see the last PCB update checkin for details
- added high-level (logical) led macros, so that the top level firmware
doens't need to know what numbers leds are (or how many there are)
- left low-level (processor specific) led macros in
keyboard/.../teensy-2-0.h , where they were
- put non processor|layout specific led macros in keyboard/.../led.h
- put layout specific led macros into keyboard/.../layout/*.h (with
default empty macro definitions in keyboard/.../layout.h)
also
- cleaned up some typos and such
- moved the debounce time macro to 'keyboard/ergodox.h', since it's
technically keyboard (keyswitch) specific
aggregate changes for PCB update
- documentation updated to reflect that the columns are now the driving
pins, and the columns are the read pins. both are still treated as
open drain.
- macros for led pins 1 and 2 were swapped
- update functions now cycle through columns->low, read rows
- added a matrix macro to map from how we want the key layouts
represented, to how things are scanned into the matrix
(plus a few small aesthetic things in /src/keyboard. i changed some
function like macros to lower-case, because someday they might be
implemented as real functions... and there's no real reason to
distinguish between functions and function like macros in the main() and
other higher level code. at least that's what it seems like to me right
now.)
apparently, sublists need to be indented 4 spaces (1 tab) or more to be
recognized as such (because subsequent lines of a list may be indented
up to 3 spaces). it's right there on the markdown syntax page, but i
didn't catch it the first time.
- made short keycode macros for the USB keycodes (under "lib/...")
- refactored "keyboard/.../layout.c", to make way for multiple layouts,
and to make it easier to read (by using short keycode macros)
- layout.h has a computed include line now, and the code (and layout
specific header stuff) is in a subdirectory. the makefile should
take care of which layout gets included and compiled
- changed kbfun_press() and kbfun_release() to be able to handle the
modifier keys (instead of requiring a separate function for the
modifiers)
- added a makefile variable for which keyboard gets compiled. even
though there's only one right now
- merge from branch 'dev'
implementation / version notes:
- needs testing still (a lot), but with the little i could do on my
breadboard it looked stable. 6-KRO looks like it works, and the key
press/release and modifier press/release functions, and LED indicators
look like they work. yay!
- looks like it's scanning at about 167 Hz (as accurately as i could
measure with a prescaling loop, an LED, and a stopwatch). most of
this (almost all of it, actually) is due to i2c. it has the potential
to get a little faster (maybe slightly past 200 Hz, if i try), but i'm
not sure if i will since most keyboards i found speeds for online
scanned at a little less than 100 Hz - so that should be fast enough.
- also, my method of assigning a keycode, press function, and release
function to each key on each layer seems like it should be time and
space consuming; but we have plenty of space (we're only using ~11%
currently), and plenty of time apparently, since the teensy is running
at 16MHz, and the time used by the extra function calls pales in
comparison to the time used by the i2c functions.
other notes:
- see the *.md files for documentation about everything. i did my best
to make and keep them accurate with the source, so hopefully nothing
(too important..) got past me.
- also, there's a nice circuit diagram under
"src/keyboard/ergodox/_circuit-diagram.svg" :) . i like it a lot, and
it's accurate for now, but i'm not sure how maintainable it'll be if
the pins change.
yay!! :D i'm so happy i got it working.