Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace serial.c of quantum/split_common/ #4669

Merged
merged 12 commits into from
Dec 24, 2018

Conversation

mtei
Copy link
Contributor

@mtei mtei commented Dec 16, 2018

Description

Replaced serial.c of quantum/split_common with helix-serial.c.

  • The difference with the old serial.c
    • It's high-speed about 3.5 times
    • Stable bi-directional data transfer.
    • Buffer address and size parameterized. (NEW flexible API)
    • With multiple types of transaction support, communication contents can be optimized.

And matrix.c and split_util.c changed the interface between serial.c to use the NEW API.

Types of changes

  • Core
  • Bugfix
  • New Feature
  • Enhancement/Optimization
  • Keyboard (addition or update)
  • Keymap/Layout/Userspace (addition or update)
  • Documentation

Issues Fixed or Closed by this PR

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document. (https://docs.qmk.fm/#/contributing)
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

mtei added 7 commits December 15, 2018 23:33
Remove buffer name and buffer size from serial.c. They should be placed in the caller(matrix.c, split_utils.c).
I also made changes to quantum/split_comon/matrix.c to keyboards/miniaxe/matrix.c.

Note: I contacted @ka2hiro, creator of miniaxe, and I got permission to change keyboards/miniaxe/matrix.c.
@mtei mtei changed the title Replace serial.c of quantum/split common Replace serial.c of quantum/split_common/ Dec 16, 2018
avr-gcc 4.9.[23] report error.
avr-gcc 5.4.0, avr-gcc 7.3.0 pass.
It is funny.
@@ -55,13 +52,36 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
static bool debouncing = false;
#endif

#if defined(USE_I2C) || defined(EH)

#if (MATRIX_COLS <= 8)
# define print_matrix_header() print("\nr/c 01234567\n")
# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
# define matrix_bitpop(i) bitpop(matrix[i])
# define ROW_SHIFTER ((uint8_t)1)
#else
# error "Currently only supports 8 COLS"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if it helps here, or it's something that you'd want to look into later ...

But the Orthodox keyboard supports 9 columns over serial and I2C. It may be worth checking out it's code and pulling the fix there and porting it over.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, I think #if is necessary.

Since this pull-request deals with the change of serial.c, I think that i2c.c should maintain the current state without changing it. .

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good!

@drashna
Copy link
Member

drashna commented Dec 19, 2018

@nooges @That-Canadian Would you mind taking a look?

#ifdef BACKLIGHT_ENABLE
uint8_t backlight_level;
#endif
#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is RGBLIGHT_SPLIT used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Through the serial, there is a keyboard that needs to transfer rgblight_config. Also, some keyboards do not need to transfer rgblight_config through serial. I thought so, so I wrote RGBLIGHT_SPLIT. But this is uncertain.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifically, some boards like the helix (and derived boards) don't transport the rgb data over the TRRS jack, so it still needs a way to communicate between halves.

Eg, this is for compatibility when the helix and crkbd (aka heli-dox) can be converted to the split common code.

// #define SOFT_SERIAL_PIN ?? // ?? = D0,D1,D2,D3,E6
// OPTIONAL: #define SELECT_SOFT_SERIAL_SPEED ? // ? = 1,2,3,4,5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a note here on mode 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 of SELECT_SOFT_SERIAL_SPEED is an experimental value. I experimented to confirm that there was enough room, but I think that I should not be used regularly. Therefore, it hid in the header file.

@nooges
Copy link
Member

nooges commented Dec 19, 2018

Other than a couple comments, looks good to me.

@drashna drashna merged commit 72d4e4b into qmk:master Dec 24, 2018
@drashna
Copy link
Member

drashna commented Dec 24, 2018

Thanks!

@mtei mtei deleted the replace_serial_c_of_quantum_split_common branch December 25, 2018 09:28
WarmCatUK added a commit to WarmCatUK/qmk_firmware that referenced this pull request Dec 26, 2018
Merge branch 'master' into messingabout

* master: (131 commits)
  Improve diagnostics for build hashes
  XMMX refactor, Configurator support and readme update (qmk#4722)
  Chibios_test/stm32_f072_onekey: Add support for reset to bootloader (qmk#4238)
  Add tsangan layout to dz60 with a "sane" default keymap (qmk#4717)
  Redox: Configurator bugfix (qmk#4721)
  Replace serial.c of quantum/split_common/ (qmk#4669)
  Toad Configurator support and readme update (qmk#4718)
  Keymap: fix userspace compile error with planck grid (qmk#4719)
  First PR for KBD6x HHKB layout keymap (qmk#4704)
  [Miuni32] Update the # of LEDs to match the final version of PCB (qmk#4714)
  Noxary x268: refactor and Configurator bugfix (qmk#4713)
  shell.nix: Packages relocated in upstream cleanup
  JD40 refactor and readme update (qmk#4710)
  Keyboard: Infinity60 refactor, Configurator support and readme update (qmk#4707)
  Update Vinta (qmk#4705)
  Add crd's XD60 ANSI keymap (qmk#4702)
  Keymap: Redox / jeherve: updates (qmk#4694)
  Update keymap for planck/rev6 (qmk#4701)
  handwired/not_so_minidox: Configurator support (qmk#4699)
  Feature Unicode example code fixed.
  ...
yeliu84 pushed a commit to yeliu84/qmk_firmware that referenced this pull request Jan 7, 2019
* Add provisional Helix implementation to test the quantum/split_common.

* copy keyboards/helix/serial.[ch] to quantum/split_common/

* Make serial.c a pure driver.

Remove buffer name and buffer size from serial.c. They should be placed in the caller(matrix.c, split_utils.c).

* remove quantum/split_common/serial_backward_compatibility.h

* Changed array serial_master_buffer to structure serial_m2s_buffer.

* Changed array serial_slave_buffer to structure serial_s2m_buffer.

* Change keyboards/miniaxe/matrix.c

I also made changes to quantum/split_comon/matrix.c to keyboards/miniaxe/matrix.c.

Note: I contacted @ka2hiro, creator of miniaxe, and I got permission to change keyboards/miniaxe/matrix.c.

* update history comment in quantum/split_common/serial.c

* Revert "Add provisional Helix implementation to test the quantum/split_common."

This reverts commit 168c82e.

* fix keyboards/miniaxe/matrix.c, quantum/split_common/matrix.c

avr-gcc 4.9.[23] report error.
avr-gcc 5.4.0, avr-gcc 7.3.0 pass.
It is funny.

* update comment quantum/split_common/serial.c

* Reserve RGBLIGHT_SPLIT macro in quantum/split_common
@pelrun pelrun mentioned this pull request Jan 28, 2019
13 tasks
rseymour pushed a commit to rseymour/qmk_firmware that referenced this pull request Mar 13, 2019
* Add provisional Helix implementation to test the quantum/split_common.

* copy keyboards/helix/serial.[ch] to quantum/split_common/

* Make serial.c a pure driver.

Remove buffer name and buffer size from serial.c. They should be placed in the caller(matrix.c, split_utils.c).

* remove quantum/split_common/serial_backward_compatibility.h

* Changed array serial_master_buffer to structure serial_m2s_buffer.

* Changed array serial_slave_buffer to structure serial_s2m_buffer.

* Change keyboards/miniaxe/matrix.c

I also made changes to quantum/split_comon/matrix.c to keyboards/miniaxe/matrix.c.

Note: I contacted @ka2hiro, creator of miniaxe, and I got permission to change keyboards/miniaxe/matrix.c.

* update history comment in quantum/split_common/serial.c

* Revert "Add provisional Helix implementation to test the quantum/split_common."

This reverts commit 168c82e.

* fix keyboards/miniaxe/matrix.c, quantum/split_common/matrix.c

avr-gcc 4.9.[23] report error.
avr-gcc 5.4.0, avr-gcc 7.3.0 pass.
It is funny.

* update comment quantum/split_common/serial.c

* Reserve RGBLIGHT_SPLIT macro in quantum/split_common
djthread pushed a commit to djthread/qmk_firmware that referenced this pull request Mar 17, 2019
* Add provisional Helix implementation to test the quantum/split_common.

* copy keyboards/helix/serial.[ch] to quantum/split_common/

* Make serial.c a pure driver.

Remove buffer name and buffer size from serial.c. They should be placed in the caller(matrix.c, split_utils.c).

* remove quantum/split_common/serial_backward_compatibility.h

* Changed array serial_master_buffer to structure serial_m2s_buffer.

* Changed array serial_slave_buffer to structure serial_s2m_buffer.

* Change keyboards/miniaxe/matrix.c

I also made changes to quantum/split_comon/matrix.c to keyboards/miniaxe/matrix.c.

Note: I contacted @ka2hiro, creator of miniaxe, and I got permission to change keyboards/miniaxe/matrix.c.

* update history comment in quantum/split_common/serial.c

* Revert "Add provisional Helix implementation to test the quantum/split_common."

This reverts commit 168c82e.

* fix keyboards/miniaxe/matrix.c, quantum/split_common/matrix.c

avr-gcc 4.9.[23] report error.
avr-gcc 5.4.0, avr-gcc 7.3.0 pass.
It is funny.

* update comment quantum/split_common/serial.c

* Reserve RGBLIGHT_SPLIT macro in quantum/split_common
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants