Adapting the avr-capsense code to the Kiibohd Controller API

- Adding "template" keymap
- Removed "stray" functions, variables
- Cleaned up warnings
- Now builds
- Added buffered macro integration (rather than dealing with USB directly)
- Updated the print messages to use the Kiibohd print header

TODO
- Add generic matrix integration (this will require some changes to the matrix code)
- Add more comments...lots more
- Clean up dead code
This commit is contained in:
Jacob Alexander 2013-04-13 22:35:59 -04:00 committed by Jacob Alexander
parent e2197f6b78
commit 4ce6d34cd8
8 changed files with 1744 additions and 1407 deletions

2514
Scan/avr-capsense/scan_loop.c Executable file → Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,54 @@
/* Copyright (C) 2013 by Jacob Alexander
*
* dfj, put whatever license here you want
* This file will probably be removed though.
*/
#ifndef __SCAN_LOOP_H
#define __SCAN_LOOP_H
// ----- Includes -----
// Compiler Includes
#include <stdint.h>
// Local Includes
// ----- Defines -----
#define KEYBOARD_KEYS 0xFF // TODO Determine max number of keys
#define KEYBOARD_BUFFER 24 // Max number of key signals to buffer
// This limits the NKRO-ability, so at 24, the keyboard is 24KRO
// The buffer is really only needed for converter modules
// An alternative macro module could be written for matrix modules and still work well
// ----- Variables -----
extern volatile uint8_t KeyIndex_Buffer[KEYBOARD_BUFFER];
extern volatile uint8_t KeyIndex_BufferUsed;
// ----- Functions -----
// Functions used by main.c
void scan_setup( void );
uint8_t scan_loop( void );
// Functions available to macro.c
uint8_t scan_sendData( uint8_t dataPayload );
void scan_finishedWithBuffer( uint8_t sentKeys );
void scan_finishedWithUSBBuffer( uint8_t sentKeys );
void scan_lockKeyboard( void );
void scan_unlockKeyboard( void );
void scan_resetKeyboard( void );
#endif // __SCAN_LOOP_H

31
Scan/avr-capsense/setup.cmake Executable file → Normal file
View file

@ -1,6 +1,6 @@
###| CMake Kiibohd Controller Scan Module |###
#
# Written by Jacob Alexander in 2011 for the Kiibohd Controller
# Written by Jacob Alexander in 2013 for the Kiibohd Controller
#
# Released into the Public Domain
#
@ -11,26 +11,37 @@
# Module C files
#
#| XXX Requires the ../ due to how the paths are constructed
set( SCAN_SRCS
../matrix/matrix_scan.c
../matrix/scan_loop.c
scan_loop.c
)
###
# Module H files
#
set( SCAN_HDRS
scan_loop.h
)
###
# File Dependency Setup
#
ADD_FILE_DEPENDENCIES( scan_loop.c ${SCAN_HDRS} )
#add_file_dependencies( scan_loop.c ${SCAN_HDRS} )
#add_file_dependencies( macro.c keymap.h avrcapsense.h )
###
# Module Specific Options
#
add_definitions( -I${HEAD_DIR}/Keymap )
add_definitions(
-I${HEAD_DIR}/Scan/matrix
)
#| Keymap Settings
add_definitions(
-DMODIFIER_MASK=budkeypad_ModifierMask
#-DKEYINDEX_MASK=budkeypad_TheProfosistMap
-DKEYINDEX_MASK=budkeypad_DefaultMap
-DMODIFIER_MASK=avrcapsense_ModifierMask
#-DKEYINDEX_MASK=avrcapsense_ColemakMap
-DKEYINDEX_MASK=avrcapsense_DefaultMap
)