increased error checks for mcp23018_updat_matrix()

and some aesthetic stuff
partial-rewrite
Ben Blazak 2012-04-24 12:17:06 -07:00
parent bec0c7244f
commit acba260663
7 changed files with 35 additions and 7 deletions

View File

@ -229,6 +229,9 @@
### Other
* [Soarer's Converter (XT/AT/PS2/Terminal to USB Converter with NKRO)]
(http://geekhack.org/showwiki.php?title=Island:17458)
* zip: [PJRC: blinky]
(http://pjrc.com/teensy/blinky.zip)

View File

@ -0,0 +1,18 @@
# Documentation : layout
## notes
* Assuming 560 bytes for everything else in RAM space, there's 2000 bytes left
for the layout. This should be enough for about 7 layers. Watch your RAM
usage if you're getting close.
* The layout matricies could be moved to flash memory (program space, instead
of data space), but that doesn't seem necessary at the moment. It would
also be slightly slower, though that probably shouldn't be a concern.
-------------------------------------------------------------------------------
Copyright &copy; 2012 Ben Blazak <benblazak.dev@gmail.com>
Released under The MIT License (MIT) (see "license.md")
Project located at <https://github.com/benblazak/ergodox-firmware>

View File

@ -60,7 +60,8 @@ uint8_t mcp23018_init(void) {
// - rows : off : 0
// - columns : on : 1
twi_start();
twi_send(TWI_ADDR_WRITE);
ret = twi_send(TWI_ADDR_WRITE);
if (ret) goto out; // make sure we got an ACK
twi_send(GPPUA);
twi_send(0b11000000); // GPPUA
twi_send(0b11111111); // GPPUB
@ -71,7 +72,8 @@ uint8_t mcp23018_init(void) {
// - rows : high (hi-Z) : 1
// - columns : high (hi-Z) : 1
twi_start();
twi_send(TWI_ADDR_WRITE);
ret = twi_send(TWI_ADDR_WRITE);
if (ret) goto out; // make sure we got an ACK
twi_send(OLATA);
twi_send(0b11111111); //OLATA
twi_send(0b11111111); //OLATB

View File

@ -5,11 +5,12 @@
* (the code example in C), and section 20.8.1, figure 20-12
* - Also see the documentation for `<util/twi.h>` at <http://www.nongnu.org/avr-libc/user-manual/group__util__twi.html#ga8d3aca0acc182f459a51797321728168>
*
* Some other (more complete) TWI libraries for the Teensy 2.0 (and other Amtel
* Some other (more complete) TWI libraries for the Teensy 2.0 (and other Atmel
* processors):
* - [i2cmaster] (http://homepage.hispeed.ch/peterfleury/i2cmaster.zip)
* - written by [peter-fleury] (http://homepage.hispeed.ch/peterfleury/)
* - [the arduino twi library] (https://github.com/arduino/Arduino/tree/master/libraries/Wire/utility)
* - [the arduino twi library]
* (https://github.com/arduino/Arduino/tree/master/libraries/Wire/utility)
* - look for an older version if you need one that doesn't depend on all the
* other Arduino stuff
* ----------------------------------------------------------------------------

View File

@ -349,8 +349,8 @@ int8_t usb_keyboard_send(void)
//
ISR(USB_GEN_vect)
{
uint8_t intbits, i; // used to declare `t` as well, but it wasn't used
// ::Blazak, 2012::
uint8_t intbits, i; // used to declare a variable `t` as well, but it
// wasn't used ::Blazak, 2012::
static uint8_t div4=0;
intbits = UDINT;

View File

@ -19,7 +19,7 @@ extern volatile uint8_t keyboard_leds;
#define usb_debug_flush_output()
#if 0 // removed in favor of equilivent code elsewhere ::Ben Blazak, 2012::
#if 0 // removed in favor of equivalent code elsewhere ::Ben Blazak, 2012::
#define KEY_CTRL 0x01
#define KEY_SHIFT 0x02

View File

@ -68,6 +68,7 @@ SIZE = avr-size
all: $(TARGET).hex $(TARGET).eep
@echo
@echo '---------------------------------------------------------------'
@echo '------- done --------------------------------------------------'
@echo
$(SIZE) --target=$(FORMAT) $(TARGET).hex
@ -76,6 +77,9 @@ all: $(TARGET).hex $(TARGET).eep
@echo
@echo '. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .'
@echo
$(SIZE) -C --mcu=atmega32u4 $(TARGET).elf
@echo '. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .'
@echo
@echo 'you can load "$(TARGET).hex" and "$(TARGET).eep" onto the'
@echo 'Teensy using the Teensy loader'
@echo