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

Massdrop keyboard support #3780

Merged
merged 19 commits into from
Aug 29, 2018
Merged

Massdrop keyboard support #3780

merged 19 commits into from
Aug 29, 2018

Conversation

patrickmt
Copy link
Contributor

This pull request adds support for new Massdrop keyboards, including the CTRL and ALT, utilizing Microchip's ATSAMD51 MCU, Microchip's USB2422 2-Port USB Hub controller, ISSI's 3733 Matrix LED Driver, and RGB lighting controls.

Massdrop SAMD51 keyboards initial project upload
Removing files that were relocated and not deleted from previous location
Cleaned some white space or comments.
Fix for LED I2C command queue.
Cleaned up interrupts.
Added debug function for printing numbers to scope through m15 line.
Ability to use factory programmed serial in hub and keyboard usb descriptors
Added support for factory programmed serial and usage.
Incorporated bootloader's conditional compiling to align project closer.
Fixed issue when USB device attempted to send before enabled.
General white space and comment cleanup.
Cleaned up project in terms of white space, commented code, and unecessary files.
NKRO keyboard is now using correct setreport although KBD was fine to use.
Fixed broken linkage to __xprintf for serial debug statements.
Fixed possible USB hang on extra keys report set missing
I2C cleanup and file renames necessary for master branch merge
Added optional boot debug trace mode through debug LED codes.
General clock code cleanup.
Moved ARM/Atmel header folder from drivers to lib and made necessary makefile changes.
@drashna
Copy link
Member

drashna commented Aug 28, 2018

Looks like both boards are failing Travis CI with the same error:

keyboards/alt67/led_programs.c:1:0: error: target CPU does not support ARM mode

So it looks like an issue with the ARM_ATSAM integration here. Something isn't quite right.

@@ -0,0 +1,211 @@
#include "alt67.h"
Copy link
Member

Choose a reason for hiding this comment

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

Could you replace this with #include QMK_KEYBOARD_H?

@@ -0,0 +1,211 @@
#include "alt67.h"

#include "samd51j18a.h"
Copy link
Member

Choose a reason for hiding this comment

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

Most, if not all of thes includes should be handled by quantum.h. And the ones that aren't, should be handled by the keyboard's h file (included with QMK_KEYBOARD_H)

If you could remove/move these to the keyboard h?

keymap_config_t keymap_config;

const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = KEYMAP(
Copy link
Member

Choose a reason for hiding this comment

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

Could you replace all of the KEYMAPs with LAYOUT?

We've been moving over from one to the other.

*/
};

const uint16_t fn_actions[] = {
Copy link
Member

Choose a reason for hiding this comment

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

This isn't needed. MO(1) does the same thing here.

Though, I think this is a holdover from the old template.

#ifndef _ALT67_H_
#define _ALT67_H_

#include "samd51j18a.h"
Copy link
Member

Choose a reason for hiding this comment

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

This should include the quantum.h file as well.

keymap_config_t keymap_config;

const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = KEYMAP(
Copy link
Member

Choose a reason for hiding this comment

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

Could you replace all of the KEYMAPs with LAYOUT?

uint8_t col_ports[] = { MATRIX_COL_PORTS };
uint8_t col_pins[] = { MATRIX_COL_PINS };
uint32_t row_masks[2]; //NOTE: If more than PA PB used in the future, adjust code to accomodate

This comment was marked as resolved.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change is in the file but request still shows

PORT->Group[col_ports[col]].DIRSET.reg = 1 << col_pins[col]; //Output
PORT->Group[col_ports[col]].OUTCLR.reg = 1 << col_pins[col]; //Low
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Please add matrix_init_quantum here


//m15_on; //Profiling scans

return 1;
Copy link
Member

Choose a reason for hiding this comment

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

Please add matrix_scan_quantum() here.

# Build Options
# comment out to disable the options.
#
#MOUSEKEY_ENABLE = yes # Mouse keys
Copy link
Member

Choose a reason for hiding this comment

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

Could you make sure that you have the whole block here?

BOOTMAGIC_ENABLE = no      # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes       # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes       # Audio control and System control(+450)
CONSOLE_ENABLE = yes        # Console for debug(+400)
COMMAND_ENABLE = yes        # Commands for debug and configuration
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no       # Breathing sleep LED during USB suspend
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
NKRO_ENABLE = no            # USB Nkey Rollover
BACKLIGHT_ENABLE = no       # Enable keyboard backlight functionality on B7 by default
RGBLIGHT_ENABLE = no        # Enable keyboard RGB underglow
MIDI_ENABLE = no            # MIDI support (+2400 to 4200, depending on config)
UNICODE_ENABLE = no         # Unicode
BLUETOOTH_ENABLE = no       # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = no           # Audio output on port C6
FAUXCLICKY_ENABLE = no      # Use buzzer to emulate clicky switches
HD44780_ENABLE = no 		# Enable support for HD44780 based LCDs (+400)

Just turn off (set to no) the features you don't want/need

Pull request changes
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_HOME, \
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_FN0, KC_LEFT, KC_DOWN, KC_RGHT \
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed KC_FN0 to MO(1) for next commit

KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_FN0, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed KC_FN0 to MO(1) for next commit

Keymap fix for momentary layer.
Potential compile flag fix for Travis CI failure.
@drashna
Copy link
Member

drashna commented Aug 28, 2018

Looks like it's failing on a new error for the ATSAM stuff.

@drashna
Copy link
Member

drashna commented Aug 29, 2018

Specifically, it looks like it's failing at:

In file included from tmk_core/protocol/arm_atsam/arm_atsam_protocol.h:39:0,
                 from tmk_core/protocol/arm_atsam/adc.c:18:
tmk_core/protocol/arm_atsam/./usb/spfssf.h:50:44: error: unknown type name 'va_list'
 int vspf(char *_Dest, const char *_Format, va_list va);

Looks like va_list isn't defined right, or is missing an include in that folder.

Fix for va_list compile failure
Fixes for include files with incorrect case
@drashna
Copy link
Member

drashna commented Aug 29, 2018

Only thing missing now is readme's for the boards. :)

You can find the template here: https://github.com/qmk/qmk_firmware/blob/master/quantum/template/avr/readme.md

Added ctrl and alt67 keyboard readme files
@drashna
Copy link
Member

drashna commented Aug 29, 2018

Awesome!

The keyboard stuff looks great to me.

@jackhumbert, @skullydazed, and/or @fredizzimo, if you wanted to review the ATSAM ARM stuff, and the keyboard?

@jackhumbert
Copy link
Member

Awesome - this looks good! Thanks for the review and quick changes :)

@jackhumbert jackhumbert merged commit 30680c6 into qmk:master Aug 29, 2018
@patrickmt patrickmt deleted the md_d51 branch August 30, 2018 13:15
Shinichi-Ohki added a commit to Shinichi-Ohki/qmk_firmware that referenced this pull request Aug 31, 2018
* 'master' of https://github.com/qmk/qmk_firmware: (73 commits)
  Keymap: Updated keymap with the "pretty" layout (qmk#3812)
  Keyboard: CTRL and ALT updates (qmk#3810)
  Docs: Tabulate Modifier & Mod-Tap keycode listings in advanced keycodes docs (qmk#3799)
  Keymap: Wanleg updates (qmk#3794)
  Keymap: Added new tada68 keymap (qmk#3788)
  Tweak the wording in "Becoming a QMK Collaborator"
  Docs: add process_terminal() and update links to other functions (qmk#3778)
  Keymap: Update keymap including LAYOUT_planck_grid (qmk#3779)
  Keyboard: remove old comment from keyboards/helix/rules.mk (qmk#3795)
  Keyboard: Update CTRL and ALT keyboard readme (qmk#3796)
  Mask off keycode/layer/mod where possible in LT(), MT(), etc. (qmk#3430)
  Autodetect lack of screen presence
  Massdrop keyboards readme update (qmk#3791)
  move massdrop boards into its own directory for configurator visibility
  STM32 EEPROM Emulation (qmk#3741)
  Massdrop keyboard support (qmk#3780)
  Keymap: Add german layout for redox keyboard (qmk#3695)
  Keyboard: Adding the AT101 PCB (qmk#3785)
  Updated templates for use by new_project.sh (qmk#3783)
  Fixed bootloader target Fixed matching grep matches (for PRODUCT in particular) Fixed " Bootloader" concatenation for WSL (windows line-endings)
  ...
alexey-danilov pushed a commit to alexey-danilov/qmk_firmware that referenced this pull request Sep 6, 2018
* Massdrop SAMD51

Massdrop SAMD51 keyboards initial project upload

* Removing relocated files

Removing files that were relocated and not deleted from previous location

* LED queue fix and cleaning

Cleaned some white space or comments.
Fix for LED I2C command queue.
Cleaned up interrupts.
Added debug function for printing numbers to scope through m15 line.

* Factory programmed serial usage

Ability to use factory programmed serial in hub and keyboard usb descriptors

* USB serial number and bugfix

Added support for factory programmed serial and usage.
Incorporated bootloader's conditional compiling to align project closer.
Fixed issue when USB device attempted to send before enabled.
General white space and comment cleanup.

* Project cleanup

Cleaned up project in terms of white space, commented code, and unecessary files.
NKRO keyboard is now using correct setreport although KBD was fine to use.
Fixed broken linkage to __xprintf for serial debug statements.

* Fix for extra keys

Fixed possible USB hang on extra keys report set missing

* I2C cleanup

I2C cleanup and file renames necessary for master branch merge

* Boot tracing and clocks cleanup

Added optional boot debug trace mode through debug LED codes.
General clock code cleanup.

* Relocate ARM/Atmel headers

Moved ARM/Atmel header folder from drivers to lib and made necessary makefile changes.

* Pull request changes

Pull request changes

* Keymap and compile flag fix

Keymap fix for momentary layer.
Potential compile flag fix for Travis CI failure.

* va_list include fix

Fix for va_list compile failure

* Include file case fixes

Fixes for include files with incorrect case

* ctrl and alt67 keyboard readme

Added ctrl and alt67 keyboard readme files
ChrissiQ pushed a commit to ChrissiQ/qmk_firmware that referenced this pull request Sep 25, 2018
* Massdrop SAMD51

Massdrop SAMD51 keyboards initial project upload

* Removing relocated files

Removing files that were relocated and not deleted from previous location

* LED queue fix and cleaning

Cleaned some white space or comments.
Fix for LED I2C command queue.
Cleaned up interrupts.
Added debug function for printing numbers to scope through m15 line.

* Factory programmed serial usage

Ability to use factory programmed serial in hub and keyboard usb descriptors

* USB serial number and bugfix

Added support for factory programmed serial and usage.
Incorporated bootloader's conditional compiling to align project closer.
Fixed issue when USB device attempted to send before enabled.
General white space and comment cleanup.

* Project cleanup

Cleaned up project in terms of white space, commented code, and unecessary files.
NKRO keyboard is now using correct setreport although KBD was fine to use.
Fixed broken linkage to __xprintf for serial debug statements.

* Fix for extra keys

Fixed possible USB hang on extra keys report set missing

* I2C cleanup

I2C cleanup and file renames necessary for master branch merge

* Boot tracing and clocks cleanup

Added optional boot debug trace mode through debug LED codes.
General clock code cleanup.

* Relocate ARM/Atmel headers

Moved ARM/Atmel header folder from drivers to lib and made necessary makefile changes.

* Pull request changes

Pull request changes

* Keymap and compile flag fix

Keymap fix for momentary layer.
Potential compile flag fix for Travis CI failure.

* va_list include fix

Fix for va_list compile failure

* Include file case fixes

Fixes for include files with incorrect case

* ctrl and alt67 keyboard readme

Added ctrl and alt67 keyboard readme files
yamad pushed a commit to yamad/qmk_firmware that referenced this pull request Apr 10, 2019
* Massdrop SAMD51

Massdrop SAMD51 keyboards initial project upload

* Removing relocated files

Removing files that were relocated and not deleted from previous location

* LED queue fix and cleaning

Cleaned some white space or comments.
Fix for LED I2C command queue.
Cleaned up interrupts.
Added debug function for printing numbers to scope through m15 line.

* Factory programmed serial usage

Ability to use factory programmed serial in hub and keyboard usb descriptors

* USB serial number and bugfix

Added support for factory programmed serial and usage.
Incorporated bootloader's conditional compiling to align project closer.
Fixed issue when USB device attempted to send before enabled.
General white space and comment cleanup.

* Project cleanup

Cleaned up project in terms of white space, commented code, and unecessary files.
NKRO keyboard is now using correct setreport although KBD was fine to use.
Fixed broken linkage to __xprintf for serial debug statements.

* Fix for extra keys

Fixed possible USB hang on extra keys report set missing

* I2C cleanup

I2C cleanup and file renames necessary for master branch merge

* Boot tracing and clocks cleanup

Added optional boot debug trace mode through debug LED codes.
General clock code cleanup.

* Relocate ARM/Atmel headers

Moved ARM/Atmel header folder from drivers to lib and made necessary makefile changes.

* Pull request changes

Pull request changes

* Keymap and compile flag fix

Keymap fix for momentary layer.
Potential compile flag fix for Travis CI failure.

* va_list include fix

Fix for va_list compile failure

* Include file case fixes

Fixes for include files with incorrect case

* ctrl and alt67 keyboard readme

Added ctrl and alt67 keyboard readme files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants