Commit Graph

20 Commits (43ee200b2b6e2e234ee8d13d8824e1d5068ba7d0)

Author SHA1 Message Date
Ben Blazak 1b41491115 fixed layer and numpad bugs - appears to work!
- rewrote the layer functions in main() (easiest way to get the to
  work.. :) )
- fixed the keymap (i had the numpad keys pushing layer 2 instead of
  layer 3)
- changed the numlock keycode.. i was using the wrong one, lol
- and some minor aesthetic changes
2012-12-03 16:19:12 -08:00
Ben Blazak 7fa2155e05 changed the way layers are handled
note: NOT YET TESTED, only compiled
2012-11-30 12:06:41 -08: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 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 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 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 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 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 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 1acaaaf5ff (intermediate checkin: working on new usb code)
(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.)
2012-05-06 18:36:51 -07:00
Ben Blazak 0b423bef70 moved keyboard layout to program space 2012-04-29 00:17:17 -07:00
Ben Blazak 229a2446a7 moved libs around; split some code in layouts 2012-04-28 23:40:00 -07:00
Ben Blazak 4e913361ac abstracted layout access a little 2012-04-28 22:39:23 -07:00
Ben Blazak bec0c7244f reorganized src/lib 2012-04-22 12:08:32 -07:00
Ben Blazak 8b168bc88e cleaned up :) and ready to merge 2012-04-11 21:05:45 -07:00
Ben Blazak 98033358f4 added ergodox circuit diagram; and a few misc things; time to clean up 2012-04-11 18:52:31 -07:00
Ben Blazak cd6826eeb5 checkin before deleting the debug code; almost ready for first beta!
- simple bug fix in kbfun_press() and kbfun_release()
- no longer check for previous init() in the mcp23018 functions;
  something would happen when i tried to read from it, sometimes, when
  it'd been unplugged or stoped some other way, and it would hang - and
  the only thing that would make it better was running the test_twi_2
  function (a series of writes, with stops after each).  so now
  mcp23018_init() is a series of writes, with stops after each.  it
  doesn't take appreciably longer to run...  maybe it should be looked
  into later though.
- changed the main() loop a little
2012-04-10 18:58:26 -07:00
Ben Blazak 57e82aebcf lots and lots; now writing/debugging keyboard logic
also, mcp23018_init() needs fixing: `twi_stop()` needs to be at the end
of transmission blocks.  i wouldn't think that would be necessary, but
it seems to be the only thing that'll make it work, and it also seems
consistent with the protocol diagram in the datasheet (lol, imagine
that), so i think that's what i'll have to do.  not as though it matters
much i guess, since it's a single master / single slave system anyway, i
was just hoping not to release the bus till i was finished..
2012-04-10 01:44:27 -07:00