Commit Graph

50 Commits (43ee200b2b6e2e234ee8d13d8824e1d5068ba7d0)

Author SHA1 Message Date
Ben Blazak 51e81d0b1c layout modifications
- and added a 'shift+press|release' kbfun
2012-12-04 16:11:01 -08:00
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 52200b262f added a keyboard function layer; fixed small layer bug 2012-11-30 16:28:40 -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 dacc54fa1a layout/qwerty -> layout/qwerty-kinesis-mod
- NOT TESTED YET. still need to do that
- also, got an idea for layer masking...

possible future changes:
- i'd like to make the layer matrices just '_kb_layout_values', and
  '_kb_layout_functions'.
- i'd like to make layer masks implemented with a special function
  'kbfun_layermask_transparent' or something similar.  a function that
  looks up what would have been pressed if that layer wasn't active.
  they could be chainable, i.e. a lookup for such a function could end
  up calling the same function (if two layermasks were active on top of
  on another), which would then call a real key.  these wouldn't be
  allowed on the base layer, of course...  and then, all i'd have to do
  to keep track of layers would be keep a variable length array (or
  not...  maybe an array of length 10 or something) of which layer is
  active... :)
- i'd like to have a thing (this isn't a very complete thought yet)
  where keypresses are looked up first in the EEPROM, to see if there's
  a definition there.  if there isn't (which should usually be the case)
  then the standard definition for that key from the matrices would be
  used.  this would allow macros (and redefinitions) without reflashing.
  this would also be convenient, once the mechanism was implemented, for
  assigning keys multiple decomposable actions...  dunno exactly how
  it'll work out yet though.  layer stuff comes first.
2012-10-16 16:54:03 -07:00
Ben Blazak fe603948a9 wrote the ui-info generating script for Ben (aka OrangeJewce)
- also changed the kbfun function comments to be easier to parse
- also added running the generating script to the toplevel build process
2012-08-23 01:31:25 -07:00
Ben Blazak ff1708796b (changed the name of a header) 2012-08-19 13:42:43 -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 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 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 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 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 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 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 471a92834c starting some changes on layer handling and key functions 2012-06-10 20:48:24 -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 50998376c5 (still reading hid stuff; taking a break to update matrix)
dox posted the PCB render the other day.  also, i have the current
flowing the wrong way for the keyswitch diodes to work right now
2012-05-26 20:48:20 -07:00
Ben Blazak 22752fead8 finished section 9 of the usb spec! 2012-05-13 18:06:17 -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 1c6d31f012 changing how computed includes are handled 2012-04-28 01:23:51 -07:00
Ben Blazak 5b83e1f630 (small macro fix) 2012-04-28 00:58:31 -07:00
Ben Blazak 2009c160e4 moved the twi library 2012-04-28 00:46:35 -07:00
Ben Blazak 66a5932fa8 moved the key-functions files 2012-04-27 15:39:26 -07:00
Ben Blazak 15efb43b76 fixed *.md indenting
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.
2012-04-26 03:44:20 -07:00
Ben Blazak b7e5e7b735 refactoring layout stuff
- 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
2012-04-24 23:22:20 -07:00
Ben Blazak acba260663 increased error checks for mcp23018_updat_matrix()
and some aesthetic stuff
2012-04-24 12:17:06 -07:00
Ben Blazak bec0c7244f reorganized src/lib 2012-04-22 12:08:32 -07:00
Ben Blazak d70b9da592 (mostly aesthetic things that i forgot) 2012-04-11 23:10:37 -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
Ben Blazak 2dce6e4066 lots
- fixed some includes (`uint8_t` comes from a header, not the language)
- put code from some of the .h files into .c files
- now using open drain logic (hi-Z or GND) on both chips instead of
  driving the row pins high on the teensy, or using a pull-up resistor
  on the row pins with the mcp23018
- put `return 0;` at the end of some functions that weren't void
- fixed/updated some documentation; esp. the row assignments for the
  mcp23018
- generalized the unused/row/column pin assignment and init code using
  macros, so they'll be much easier to move around if necessary
- fixed a redefinition error in "lib/usb/keyboard-usage-page.h"
2012-04-05 03:08:20 -07:00
Ben Blazak f41502ba3c mostly working on mcp23018.c; init() and update() might be ready :)
also, moved the twi code to lib/teensy-2-0/twi*
2012-04-02 01:59:00 -07:00
Ben Blazak a288b8a045 intermitent checkin; lots of stuff; i2c on hold; kb logic in progress 2012-03-27 03:06:52 -07:00
Ben Blazak 19725eed4a *lots* of stuff .. :) - got PWM working!
also, i didn't make a note of it in the *.md file, but Waveform
Generation Mode 15 for fast PWM wasn't working right (well.. wasn't
working how i expected it to).  i misinterpreted what the modes were
doing, partially (haha, or all-ly?) because i didn't read the
description of fast pwm thoroughly enough...  in any case, all the
information's in the datasheet, and it's actually not terribly long.
i'm not sure how to correctly use Mode 15 yet, but i think i'll leave it
alone for now, since Mode 5 works as expected, and i think what the
datasheet says about *that* makes enough sense to me for me to be
content for the moment.
2012-03-19 00:01:41 -07:00
Ben Blazak 5f4b6c9e09 added some stuff in src/lib 2012-03-11 19:17:32 -07:00
Ben Blazak 6570e7ae39 added src files - not much there yet though 2012-03-11 18:52:31 -07:00