increased error checks for mcp23018_updat_matrix()
and some aesthetic stuffpartial-rewrite
parent
bec0c7244f
commit
acba260663
|
@ -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)
|
||||
|
||||
|
|
|
@ -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 © 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>
|
||||
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
* ----------------------------------------------------------------------------
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue