Commit Graph

156 Commits (43ee200b2b6e2e234ee8d13d8824e1d5068ba7d0)

Author SHA1 Message Date
Ben Blazak 10c1ef23c5 (adding options.h; somehow it got lost before...) 2012-08-19 21:35:44 -07:00
Ben Blazak b11d8780d9 updated matrix to match PCB; made pin direction an option
- 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"
2012-08-19 21:16:52 -07:00
Ben Blazak ff1708796b (changed the name of a header) 2012-08-19 13:42:43 -07:00
Ben Blazak 6e094a86d5 (updated TODO) 2012-08-11 17:14:57 -07:00
Ben Blazak a0fca378d5 (modified TODO) 2012-08-07 19:15:10 -07:00
Ben Blazak d7c1ffe0c4 removed linked lists; changed KBFUN_FUNCTION_ARGS handling
- 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)
2012-08-06 15:57:23 -07:00
Ben Blazak ddade5b5dc reorganization (large one) (mostly moving files) 2012-07-31 14:48:31 -07:00
Ben Blazak f9b46c32bf (small doc change) 2012-07-22 21:08:01 -07:00
Ben Blazak 3328f02a62 modified for flippable PCB (as of 2012-07-15) 2012-07-22 19:30:20 -07:00
Ben Blazak 9e7af882a4 finished linked lists in lib!
and moved the header for common data types (from lib/data-types.h to
lib/data-types/common.h)
2012-07-16 18:45:04 -07:00
Ben Blazak 813569cfe0 updated toplevel license and readme
- 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.
2012-07-15 17:45:58 -07:00
Ben Blazak b8224d25de updated USB vendor and product IDs 2012-07-15 17:16:15 -07:00
Ben Blazak a31b0fa507 modified docs a little about row/col assignments
and linked-list stuff still in progress
2012-07-11 16:06:08 -07:00
Ben Blazak 018b763423 changed numpad functions; linked-lists, etc. in progress
- 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
2012-07-08 17:54:23 -07:00
Ben Blazak b257e21a15 working on linked-lists (going to remove some functions) 2012-07-07 21:49:47 -07:00
Ben Blazak 4c23dbaf59 updated the ergodox circuit diagram svg 2012-07-06 01:52:54 -07:00
Ben Blazak ea56a08981 added linked lists in lib/data-types 2012-07-06 00:35:01 -07:00
Ben Blazak d4b9d88464 added a jump to bootloader key-function 2012-07-05 17:10:18 -07:00
Ben Blazak 039aba752b added numpad (and a private key-function for layer masking)
tested on breadboard.  appears to work!
2012-07-05 15:48:18 -07:00
Ben Blazak 6e087c7dd4 removed `kbfun_layer_set()` since it was redundant
it had no effective difference from `kbfun_layer_inc()`, because values
in the keycode matrix can only be positive (of type uint8_t)
2012-06-22 17:43:12 -07:00
Ben Blazak 49e3b5208a (small bug/typo fix) 2012-06-21 22:09:26 -07:00
Ben Blazak 06bfe3c037 separated kbfun_layer_inc_exec() and ...dec_exec()
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
2012-06-21 20:42:56 -07:00
Ben Blazak d1fa583bb3 mostly kbfun*() changes and additions
- 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).
2012-06-20 16:56:24 -07:00
Ben Blazak 9f357ede2a ((removed something i'd forgotten)) 2012-06-16 23:21:20 -07:00
Ben Blazak 33b6cf6f47 (reverting after test)
i did want to save the test code though
2012-06-15 16:50:02 -07:00
Ben Blazak fe545d83d6 test: using indices to an array of fn ptrs in layout matrices
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
2012-06-15 16:39:33 -07:00
Ben Blazak 068a3546f6 bug fixes, mostly; and other things
- 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
2012-06-15 14:36:50 -07:00
Ben Blazak d1f17133c9 added lib/key-functions private header 2012-06-14 22:03:47 -07:00
Ben Blazak 28e198ee72 added set layer function; more lib/keyfunctions* changes 2012-06-14 22:02:57 -07:00
Ben Blazak 223f03ac74 wrote kbfun for 2 shifts => capslock; other kbfun mods 2012-06-14 16:01:34 -07:00
Ben Blazak 7404ca3c02 (changed low level led macro names) 2012-06-14 11:38:49 -07:00
Ben Blazak 973cac3240 (more makefile modifications) 2012-06-12 16:11:18 -07:00
Ben Blazak 5260e7104d modified how dist is build; changed .gitignore hierarchy
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
2012-06-12 14:12:50 -07:00
Ben Blazak e37ff92137 makefile now generates a .map 2012-06-11 16:11:56 -07:00
Ben Blazak 3322844ed0 bugfix (mostly): changed the way layers are handled
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.
2012-06-11 03:27:34 -07:00
Ben Blazak 5569cecd2b changed default number of layers to 10 2012-06-10 20:53:21 -07:00
Ben Blazak 471a92834c starting some changes on layer handling and key functions 2012-06-10 20:48:24 -07:00
Ben Blazak ce13bf3893 created a contrib folder 2012-06-06 12:26:36 -07:00
Ben Blazak f5bd07c45c added convenience target 'dist-hex' to makefile 2012-06-04 00:09:15 -07:00
Ben Blazak bdcd4484be added a layout layer; layout's still kind of a mess...
layout includes function keys, some symbols, and a few things from the
default layer
2012-06-03 23:46:21 -07:00
Ben Blazak 49b8b41442 (merged 'dev': forgot to include something) 2012-06-03 21:26:25 -07:00
Ben Blazak c30106431b (forgot to include <util/delay.h>) 2012-06-03 21:25:50 -07:00
Ben Blazak 176dfcb684 merge with 'dev': bugfix 2012-06-03 21:17:08 -07:00
Ben Blazak d27b162400 bugfix: add delay between teensy col write and pin read
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.
2012-06-03 21:12:15 -07:00
Ben Blazak 71bf4204e9 (small update to a comment) 2012-06-01 21:12:52 -07:00
Ben Blazak 088fcd5136 Merge branch 'dev': rewrites, reorganizations, and fixes
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
2012-06-01 01:10:21 -07:00
Ben Blazak 9c86906f7f abstracted led handling -- PCB changes done
- 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
2012-06-01 01:05:38 -07:00
Ben Blazak 4972c81a96 updated matrix and layout stuff for dox's PCB 2012-05-29 16:53:55 -07:00
Ben Blazak a28b1f1182 updated mcp23018 stuff for dox's PCB 2012-05-26 23:12:01 -07:00
Ben Blazak 1af2423364 updated teensy stuff for dox's PCB 2012-05-26 22:50:33 -07:00