Commit Graph

170 Commits

Author SHA1 Message Date
Dave
346784bd6b Enable output hook in main() 2020-05-06 15:56:23 -05:00
Dave
de346a1e59 Merge branch 'hooks' 2020-05-05 15:10:40 -05:00
Dave
5baf20a16b Get hook functionality running and DIP switch cleanup 2020-05-05 15:05:54 -05:00
Dave
c7b8641d0d Define dipswitch row in arch-dependent module.
Because the DIP switch row is hardwired on the controller board.
2020-05-03 12:05:27 -05:00
Dave
4d8bc2a9be (Development branch) Added in code to implement fuction hooks 2020-05-01 16:39:21 -05:00
Dave
77de6c7205 Fix wrong keymap assignment for SHIFT LOCK & other cleanups 2020-04-27 17:13:53 -05:00
Dave
fe5cafd8ab Add test of activate triple assignment (no function specified) 2020-04-27 17:12:39 -05:00
Dave
ef7a7bf320 Clean up shift/shiftlock cruft
* firmware/asdf/src/asdf_modifiers.h: C
2020-04-27 17:11:36 -05:00
Dave
8e2a12b9d5 Initial cut of OSI 542 keyboard scan support 2020-04-27 17:10:13 -05:00
Dave
80cb50eb7e Clean up physical device structures
- include callback function in device table instead of separate array.
2020-04-26 14:11:55 -05:00
Dave
f2eead4db8 Updated README to reflect progress 2020-04-15 15:23:42 -05:00
Dave
ae5aa3316d Fix Makefile typo 2020-04-15 10:59:26 -05:00
Dave
e294f0164e Add architecture-dependent files for ATMega2560, adjust Makefiles 2020-04-15 09:45:07 -05:00
Dave
fc4cb08d29 Clean ups
- Added comment clarifications

- Moved repeate_state_t definition from asdf_repeat.h to asdf_repeat.c, since
  this type is only used internally.
2020-04-09 15:47:27 -05:00
Dave
47bc7c586f More comment cleanups and clarifications.
Rename some variables to clarify use
2020-04-08 15:00:43 -05:00
Dave
644efa7122 Test cleanups 2020-04-08 14:23:13 -05:00
Dave
30cd305fe6 Fix and clarify comments, add COPYING file 2020-04-08 12:41:53 -05:00
David Fenyes
b7f5f29f7b Put correct DIP switch row in sol keycap definitions for rev 2.3 interface 2020-03-21 14:47:54 -05:00
David Fenyes
e37da4e969 Reset modifier states when keymap is reset
- asdf.c: remove asdf_modifiers_init() from asdf_init().
- asdf_keymaps.c: add a call do asdf_modifiers_init()
  to asdf_keymaps_select_keymap()
2020-03-21 14:26:57 -05:00
David Fenyes
0ba921f2ce Added SOL-20 keymap
- Add Keymaps/asdf_keymap_defs_sol.h, and add the hooks in the master keymap

- asdf.h: Change start of ACTION codes to 0xA0, since SOL-20 uses codes from 0x80-0x9a

- asdf_ascii.h: Add named ASCII control codes to
2020-03-21 11:53:51 -05:00
David Fenyes
8f09246a4d Remove reference to special indicator functions (now virtual) 2020-03-20 14:43:18 -05:00
David Fenyes
dae4b8d322 Replaced the Virtual out pulse function with long and short pulse
- Replace V_PULSE with V_PULSE_LONG and V_PULSE_SHORT functions.

- replace the asdf_arch_pulse_delay() with asdf_arch_pulse_delay_short() and
asdf_arch_pulse_delay_long() functions.

- modify keymaps to use long and short pulses.

- long pulse is 50 ms.  Short pulse is 10 us.

- Added localizing prefix to keymap definitions to avoid conflicts.
2020-03-17 01:42:51 -05:00
David Fenyes
93349ed6e9 Add support for "hi-z when low" outputs
The apple 1 CLEAR input requires a high-impedance inactive state to avoid
conflict with the pin output of the 7404 at D12 (via CR4). So, to cover this
condition most generally, this patch changes the adds a Hi-Z when low physical
device for each output line, to complement the Hi-Z-when-high open collector
emulation. The nomenclature is changed from OUT*_OC (emulated open collector) to
OUT*_OPEN_HI and OUT*_OPEN_LO to indicate which condition gets the Hi-Z state.

- added the set() functions to the asdf_arch_atmega328p.[ch] files and applied
the above nomenclature.

- Added the set() functions to the asdf_physical.[ch] files and applied the
above nomenclature

- Modified the SCREEN_CLEAR device to PHYSICAL_OUT1_OPEN_LO in the apple2 and
ascii keymaps.

- Changed the RESET from PHYSICAL_OUT1_OC to PHYSICAL_OUT1_OPEN_HI in the apple2
and ascii keymaps.
2020-03-16 12:56:21 -05:00
David Fenyes
702ed71d60 add a clear-screen (ACTION_CLEAR) to the Shift-RESET combination. 2020-03-14 21:55:03 -05:00
Dave
68d2dfb115 Fix typo 2020-03-14 10:40:20 -05:00
Dave
04321da29c Fix typecast for key repeat timer, and some header fixes. 2020-03-14 10:37:43 -05:00
Dave
ed761974e6 Modifiers cleanup
- asdf_modifiers.[ch]: Replace asdf_modifier_shiftlock_activate() with
  asdf_modifier_shiftlock_on_activate() and
  asdf_modifier_shiftlock_toggle_activate().  Instead of a configurateion
  setting for shiftlock state to switch between SHIFTLOCK locks on, SHIFT turns
  off, vs SHIFTLOCK toggles, and SHIFT turns off, create two different
  SHIFTLOCK functions, one for each behavior, and allow the keymap to bind the
  desired function.

- asdf.h: replace ACTION_SHIFTLOCK with ACTION_SHIFTLOCK_ON and
  ACTION_SHIFTLOCK_TOGGLE.

- asdf.h: move start of ACTION codes from 0x80 to 0x90, since SOL-20 uses codes
  from 0x80-0x8f.

- asdf.c: test for ACTION code using (code > ASDF_ACTION) instead of (code &
  ASDF_ACTION), since ASDF_ACTION need not be a power of 2.

- asdf_modifiers.[ch] and other files: remove
  asdf_modifiers_shiftlock_deactivate() and
  asdf_modifiers_capslock_deactivate(), and any references to these functions
  since they are null functions anyway.
2020-03-14 00:11:29 -05:00
David Fenyes
aeaac665af Comment fixes for accurate descriptions. 2020-03-13 21:51:19 -05:00
David Fenyes
bd7b2167fb Removed extraneous definitions from Apple2 keymap file. 2020-03-13 00:51:31 -05:00
David Fenyes
abc462e711 Improved comments
- Added physical PCB key mapping for reference
- Make sure CAPSLOCK LED doesn't toggle in the ALL CAPS keymaps.
2020-03-13 00:48:05 -05:00
dfnr2
bf4bca76ed Update README.md 2020-03-13 00:09:08 -05:00
David Fenyes
8740ab3262 Comment and nomenclature cleanups
- fix and clarify various function header comments
- use consistent nomenclature for virtual layer.
2020-03-12 23:56:09 -05:00
David Fenyes
01008af937 Break out physical resource functions into asdf_physical.[ch]
- Split asdf_virtual.c into asdf_physical.c and asdf_virtual.c, moving the
functions that handle the physical resources to asdf_physical.c

- cleaned up nomenclature to be more consistent and less confusing.

- fixed keymap files and tests to use asdf_physical.c/h and new nomenclature.

- added asdf_physical.c to Makefiles.
2020-03-12 00:45:59 -05:00
David Fenyes
5c2235e79c Apple 2 map fixes
Set the lamp under the caps lock key (next to RETURN, not in apple2 layout) to
off.

Remove the right square bracket "]" from the apple 2 map.
2020-03-11 02:08:37 -05:00
David Fenyes
5bbdbe1c49 remove ACTION_RESET and ACTION_CLEAR
These are now implemented through virtual outputs, defined in the keymap files.
2020-03-11 01:54:41 -05:00
David Fenyes
72a84f0363 add safeguards for virtual device assignment
Disallow assignment of invalid virtual or real devices
Disallow assignment of a real devices that have already been assigned.
add unit test cases for virtual devices
2020-03-11 01:52:47 -05:00
David Fenyes
73e2760d94 Add more unit tests for virtual layer
- use macros to designate which keymaps are used to setup the tests.
2020-03-11 01:50:27 -05:00
David Fenyes
23237fae88 Added unit tests for virtual outputs. 2020-03-09 05:16:52 -05:00
David Fenyes
5a6a64dd55 Remove #include "asdf_actions.h" from asdf.c 2020-03-08 15:08:10 -05:00
David Fenyes
3940b96e0d Remove asdf_actions.[ch] files, no longer used. 2020-03-08 15:06:06 -05:00
David Fenyes
1b388bc591 Add virtual output device module (compiles without warning)
* Created test fixture for virtual outputs

* Added virtual output configuration to keymap definitions removed special
actions_send_reset() and actions_send_screenclear() functions, and replaced with
virtual output definitions.

* asdf_actions.c is removed from build.

* asdf_arch_atmega328p.c: added functions to set/clear each real output

* asdf_arch_atmega328p.c: added pulse_delay() function

* asdf_arch_test.c: added mock machinery to emulate outputs, test output
settings, and detect properly and improperly-formed pulses on the outputs.

* asdf_keymaps.c: allocate initialzer array. asdf_keymaps_select_keymap() calls
asdf_virtual_init() with initializer list for the keymap to set up the LEDS and
outputs every time a new keymap is selected.
2020-03-08 14:45:40 -05:00
David Fenyes
44a49afdae modify the SHIFTLOCK and CAPSLOCK led functions to use virtual LEDs 2020-03-06 13:46:27 -06:00
David Fenyes
cff7f6052a Changes for virtual LED and output mapping.
Rough first cut, have not yet tried to compile or test.
2020-03-06 13:24:03 -06:00
David Fenyes
d0648019d6 Add the Apple 2 keymaps. 2020-02-21 00:28:36 -06:00
David Fenyes
a598eaaee1 Add support for LEDs
- asdf_modifier.c: refactor CAPS LOCK setting and add LED setting
- asdf_arch_atmega328p.[ch]: add in LED definitions and functions
- add dummy asdf_arch_caps_led() function to arch files so test can compile.
2020-02-20 16:48:17 -06:00
David Fenyes
919a422d57 ASCII Keymap fixes
Updated keymap definitions to fit current keyboard matrix PCB rev (1.3).
2020-02-20 01:54:31 -06:00
David Fenyes
e53ca053c9 add ASCII NULL
- add ASCII_NULL to ascii table
- attach ASCII_NULL to ctrl-@
2020-02-20 01:25:21 -06:00
David Fenyes
b8cf2a339a formatting fix 2020-02-20 01:18:37 -06:00
David Fenyes
adc9f92b75 Update firmware README to mention multiple keymap support. 2020-02-20 01:15:24 -06:00
David Fenyes
6e462589cc Arch file support for 4-bit row address. 2020-02-19 23:32:14 -06:00
David Fenyes
a2a6be49a4 Add tests for multiple keymap support. 2020-02-19 23:31:17 -06:00
David Fenyes
16dc913f74 Added functions to change keymaps
- asdf_keymaps_select_keymap() function to select a keymap
- asdf_keymaps_select_n_{set|clear} functions to set a bit in keymap number,
  to support dip switches.
2020-02-19 23:28:14 -06:00
David Fenyes
97cda49e31 Modifications for multiple keymap support.
- Added C preprocessor macros to determine largest key matrix, so enough space
  may be allocated

- Cleaned up keymap definition macros for readability

- Created master keymap file to aggregate individual keymaps

- Modified make files to copy the specified master keymap
  to asdf_keymap_defs.h during build.

- Added template keymap file.
2020-02-19 23:22:23 -06:00
David Fenyes
b7c77ddebc Apply clang-format to source files. 2020-01-03 23:25:55 -06:00
Dave
6b201ac997 Add missing asdf_keymaps.h file 2019-12-29 09:24:11 -06:00
Dave
3c34734a46 I/O cleanup and SYS_RESET fix
- Break out initialization of SYS_RESET, CLEAR, STROBE, and CAPS LED into
  separate functions.

- Emulate open collector output for SYS_RESET: OFF=input with weak pullup.
  ON=output low.

- Add function to cap CAPS LED.
2019-12-28 10:22:00 -06:00
Dave
088af21650 modifier cleanups
- add caps key function, similar to shift.  This is intended for a DIP switch
  setting to switch the keyboard between all CAPS and upper/lower modes.
- clean up the modifier state enums to include all legal values
- clean up the modifier index value calculation to improve readability.
2019-12-24 22:27:24 -06:00
Dave
f0772180cb Break out keymap definitions
- Separate the "asdf_keymaps.h" files into
-- "asdf_keymaps.h" which is not keymap dependent and contains keymap function
   prototypes
-- "asdf_keymap_defs.h" which contains the keymap definitions
-- Move definitions of number of rows and columns from asdf.h to keymaps_defs.h.
-- keymap_defs.h is copied from the keymaps directory depending on which keymap
   is specified in the Makefile.
-- Makefile fixes for the above changes
-- Fix includes in several files to reflect the above changes.
2019-12-24 21:54:35 -06:00
Dave
4923433c10 Fix '<' and '>'
Swapped '<' and '>' in ascii and ascii_swapped_o keymaps.
2019-12-24 11:19:10 -06:00
Dave
74fa1db6ba Comment fix
Fix the comment in the "Swapped O and zero" keymap to indicate board rev that
pairs with the keymap.
2019-12-24 09:26:59 -06:00
Dave
d5d1eef10c Fix swapped 'O' and '0' keys
Reverts the ASCII keymap to proper position of 'O' and 'o' keys, and create a
new keymap for rev 1.2 and earlier of the key matrix with swapped 'O' and '0'
keys.
2019-12-24 08:53:28 -06:00
Dave
bb6c754ee1 Fixed CAPSLOCK reference
Keymaps/asdf_keymaps_ascii.h: changed CAPS_LOCK to CAPS
2019-12-24 02:35:51 -06:00
Dave
cc06648930 Change SHIFT LOCK to CAPS LOCK
Keymaps/asdf_keymaps_ascii.h: change the shift lock binding to a caps lock.
More useful.
2019-12-24 02:29:43 -06:00
Dave
519817ab53 ASCII keyboard fixes
Keymaps/asdf_keymaps.h: swap '0' and 'O' codes to compensate for physically swapped '0' and 'O' in early prototypes
asdf_ascii.h: fix wrong code for comma (44, 0x2C; was defined as 0x44).
2019-12-24 02:22:38 -06:00
Dave
a03473769f Added screen clear and reset functions
- added asdf_actions.c, asdf_actions.h to place misc. key actions
- asdf.c: asdf_activate_action(): added actions for screen clear and reset
- asdf_config.h, Arch/asdf_arch_atmega328p.c: added defs to specify polarity of data,
  strobe, SCREEN_CLEAR and reset outputs.
- Arch/asdf_arch_atmega328p.h: fixed pin definitions for RESET and SCREEN_CLEAR
2019-12-15 02:38:04 -06:00
Dave
6b78fe9111 Change "Universal" to more accurate "Unified" 2019-12-15 02:09:15 -06:00
dfnr2
4c0d3b1084 Update README.md 2019-12-12 20:24:04 -06:00
dfnr2
f2527e4d69 Update README.md 2019-12-12 20:22:13 -06:00
Dave
c14fe92ebf minor header file fixes 2019-12-12 20:19:45 -06:00
Dave
784805adc7 first commit 2019-12-12 14:46:29 -06:00