diff options
| author | Takeshi ISHII <2170248+mtei@users.noreply.github.com> | 2018-12-15 14:31:56 +0900 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2018-12-14 21:31:56 -0800 |
| commit | 8f790948e5f7ed62b2c56e1a6aa63dae89d5c860 (patch) | |
| tree | 5d934ecae5855bf3f907b0ad485e78b42d9c228a /quantum | |
| parent | a49d98e665d934c318894cfc9d9813adacd08f11 (diff) | |
| download | qmk_firmware-8f790948e5f7ed62b2c56e1a6aa63dae89d5c860.tar.gz qmk_firmware-8f790948e5f7ed62b2c56e1a6aa63dae89d5c860.zip | |
Refactor quantum/split_common/i2c.c, quantum/split_common/serial.c (#4522)
* add temporary compile test shell script
* Extended support of SKIP_VERSION to make invariant compile results during testing.
* build_keyboard.mk, tmk_core/rules.mk: add LIB_SRC, QUANTUM_LIB_SRC support
Support compiled object enclosed in library.
e.g.
```
LIB_SRC += xxxx.c
xxxx.c --> xxxx.o ---> xxxx.a
```
* remove 'ifdef/ifndef USE_I2C' from quantum/split_common/{i2c|serial}.c
* add SKIP_DEBUG_INFO into tmk_core/rules.mk
When SKIP_DEBUG_INFO=yes is specified, do not use the -g option at compile time.
* tmk_core/rules.mk: Library object need -fno-lto
* add SKIP_DEBUG_INFO=yes
* remove temporary compile test shell script
* add '#define SOFT_SERIAL_PIN D0' to keyboards/lets_split/rev?/config.h
* quantum/split_common/serial.c: Changed not to use USE_I2C.
Diffstat (limited to 'quantum')
| -rw-r--r-- | quantum/split_common/i2c.c | 3 | ||||
| -rw-r--r-- | quantum/split_common/serial.c | 16 |
2 files changed, 6 insertions, 13 deletions
diff --git a/quantum/split_common/i2c.c b/quantum/split_common/i2c.c index b3d7fcc68..45e958b39 100644 --- a/quantum/split_common/i2c.c +++ b/quantum/split_common/i2c.c | |||
| @@ -7,8 +7,6 @@ | |||
| 7 | #include "i2c.h" | 7 | #include "i2c.h" |
| 8 | #include "split_flags.h" | 8 | #include "split_flags.h" |
| 9 | 9 | ||
| 10 | #if defined(USE_I2C) || defined(EH) | ||
| 11 | |||
| 12 | // Limits the amount of we wait for any one i2c transaction. | 10 | // Limits the amount of we wait for any one i2c transaction. |
| 13 | // Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is | 11 | // Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is |
| 14 | // 9 bits, a single transaction will take around 90μs to complete. | 12 | // 9 bits, a single transaction will take around 90μs to complete. |
| @@ -184,4 +182,3 @@ ISR(TWI_vect) { | |||
| 184 | // Reset everything, so we are ready for the next TWI interrupt | 182 | // Reset everything, so we are ready for the next TWI interrupt |
| 185 | TWCR |= (1<<TWIE) | (1<<TWINT) | (ack<<TWEA) | (1<<TWEN); | 183 | TWCR |= (1<<TWIE) | (1<<TWINT) | (ack<<TWEA) | (1<<TWEN); |
| 186 | } | 184 | } |
| 187 | #endif | ||
diff --git a/quantum/split_common/serial.c b/quantum/split_common/serial.c index f34f824d7..13e58d825 100644 --- a/quantum/split_common/serial.c +++ b/quantum/split_common/serial.c | |||
| @@ -12,18 +12,14 @@ | |||
| 12 | #include <stdbool.h> | 12 | #include <stdbool.h> |
| 13 | #include "serial.h" | 13 | #include "serial.h" |
| 14 | 14 | ||
| 15 | #ifndef USE_I2C | 15 | #ifdef SOFT_SERIAL_PIN |
| 16 | |||
| 17 | #ifndef SOFT_SERIAL_PIN | ||
| 18 | #error quantum/split_common/serial.c need SOFT_SERIAL_PIN define | ||
| 19 | #endif | ||
| 20 | 16 | ||
| 21 | #ifdef __AVR_ATmega32U4__ | 17 | #ifdef __AVR_ATmega32U4__ |
| 22 | // if using ATmega32U4 I2C, can not use PD0 and PD1 in soft serial. | 18 | // if using ATmega32U4 I2C, can not use PD0 and PD1 in soft serial. |
| 23 | #ifdef USE_I2C | 19 | #ifdef USE_AVR_I2C |
| 24 | #if SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1 | 20 | #if SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1 |
| 25 | #error Using ATmega32U4 I2C, so can not use PD0, PD1 | 21 | #error Using ATmega32U4 I2C, so can not use PD0, PD1 |
| 26 | #endif | 22 | #endif |
| 27 | #endif | 23 | #endif |
| 28 | 24 | ||
| 29 | #if SOFT_SERIAL_PIN >= D0 && SOFT_SERIAL_PIN <= D3 | 25 | #if SOFT_SERIAL_PIN >= D0 && SOFT_SERIAL_PIN <= D3 |
| @@ -278,4 +274,4 @@ int serial_update_buffers(void) { | |||
| 278 | return 0; | 274 | return 0; |
| 279 | } | 275 | } |
| 280 | 276 | ||
| 281 | #endif | 277 | #endif /* SOFT_SERIAL_PIN */ |
