This repository has been archived by the owner on Mar 16, 2024. It is now read-only.
forked from qmk/qmk_firmware
-
Notifications
You must be signed in to change notification settings - Fork 63
Add persistent led support with eeprom #9
Merged
Codetector1374
merged 7 commits into
OpenAnnePro:keyboard-annepro2
from
tech2077:keyboard-eeprom
Aug 24, 2020
Merged
Add persistent led support with eeprom #9
Codetector1374
merged 7 commits into
OpenAnnePro:keyboard-annepro2
from
tech2077:keyboard-eeprom
Aug 24, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It seems like this does belong to lld. Maybe I am understanding this code wrong. But if I recall correctly the stm32 lld SPI driver does something quite close. Basically you can call the SPI to shift in / out data and it will just do it. ( ofc you need to give it configuration and tell it to startSpi() or something like that
…On Aug 23, 2020, 3:37 AM -0400, tech2077 ***@***.***>, wrote:
@tech2077 commented on this pull request.
In drivers/chibios/spi_master.c:
> @@ -32,6 +32,10 @@ __attribute__((weak)) void spi_init(void) {
palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), PAL_MODE_STM32_ALTERNATE_PUSHPULL);
palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), PAL_MODE_STM32_ALTERNATE_PUSHPULL);
palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), PAL_MODE_STM32_ALTERNATE_PUSHPULL);
+#elif defined(HT32_SPI_USE_SPI1) || defined(HT32_SPI_USE_SPI2)
Yeah, I don't like how QMK does it, the main reason I did it this was is in the case we ever try to merge into mainline QMK.
Where in ChibiOS would I put this, it feels too setup specific for lld, and to low level for chibios main hal. Usually I see gpio mode config done outside peripheral libraries.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I took a look at the lld for the STM32 SPI driver and they don't seem to setup the gpio mode anywhere. All this code does is enable the GPIO, it's not actually related to the SPI peripheral directly. Also the SPI HAL driver expects the config to be setup on the user layer before being passed to the HAL and lld layers. I think we should keep it here, as ugly as it is here I think it's better than introducing GPIO configuration into any of the more "pure" drivers. |
Okay sounds good to me. I guess this is a very valid point. <3 thanks for you work.
…On Aug 23, 2020, 9:13 PM -0400, tech2077 ***@***.***>, wrote:
I took a look at the lld for the STM32 SPI driver and they don't seem to setup the gpio mode anywhere. All this code does is enable the GPIO, it's not actually related to the SPI peripheral directly. Also the SPI HAL driver expects the config to be setup on the user layer before being passed to the HAL and lld layers.
I think we should keep it here, as ugly as it is here I think it's better than introducing GPIO configuration into any of the more "pure" drivers.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Codetector1374
approved these changes
Aug 24, 2020
bwisn
pushed a commit
to bwisn/qmk_firmware
that referenced
this pull request
Aug 29, 2021
* adding HT32 support to chibios SPI master driver * add support for W25X20CL SPI eeprom * add makefile flag for eeprom feature * add spi support to keyboard startup and config * example keymap using eeprom profile loading
bwisn
pushed a commit
to bwisn/qmk_firmware
that referenced
this pull request
Sep 12, 2021
* adding HT32 support to chibios SPI master driver * add support for W25X20CL SPI eeprom * add makefile flag for eeprom feature * add spi support to keyboard startup and config * example keymap using eeprom profile loading
bwisn
pushed a commit
to bwisn/qmk_firmware
that referenced
this pull request
Sep 15, 2021
Add persistent led support with eeprom (OpenAnnePro#9) * adding HT32 support to chibios SPI master driver update spi driver, fix bad merging with master
bwisn
added a commit
to bwisn/qmk_firmware
that referenced
this pull request
Oct 18, 2021
* tmk_core: temporary fix to allow HT32 based keyboards to work without patched ChibiOS-contrib (AnnePro2) * HT32: add spi support Add persistent led support with eeprom (OpenAnnePro#9) * adding HT32 support to chibios SPI master driver update spi driver, fix bad merging with master * HT32: fix formatting HT32: Fix formatting: tmk_core/protocol/chibios/usb_main.c Co-authored-by: Drashna Jaelre <drashna@live.com> * HT32: Apply suggestions from fauxpark's code review Co-authored-by: Ryan <fauxpark@gmail.com> * HT32: update spi driver * ht32: apply code review suggestions, remove old workaround Co-authored-by: tech2077 <tech2077@gmail.com> Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com>
Jpe230
referenced
this pull request
in Jpe230/qmk_firmware
Mar 8, 2022
* [keyboard] Initial support for Anne Pro 2 * [keyboard][AnnePro2] Keymap:update to a reasonable keymap with caps+hjkl => arrow * :( * changed to use HSI * support for annepro2 c18 * keyboard/annepro2: Very stupid matrix scan bug fix. * typo * swap COL14/13 * keyboard/annepro2: startup secondary LED MCU * keyboard/annepro2: typo fix * Add IO Values * Disable Combo feature * Update default keymap to Anne Pro 2 Official Keymap * keyboard/annepro2: keymap layer name changes * keyboard/annepro2 BLE Support * Fix keymap comment FN1 ESC was listed as ~ instead of ` * keyboard/annepro2: Bluetooth path * Keyboard annepro2 bidir led comms (qmk#5) * Added bidirectional shine comms and moved led functionality to new file * Added bidirectional shine comms and moved led functionality to new file * Restore original functionality to existing keymaps using new shine commands * Fix dangling bracketless if statements * PR cleanup * add custom keycodes to switch led profiles * Optimize code * switch to prev profile before turning leds off * Add persistent led support with eeprom (qmk#9) * adding HT32 support to chibios SPI master driver * add support for W25X20CL SPI eeprom * add makefile flag for eeprom feature * add spi support to keyboard startup and config * example keymap using eeprom profile loading * Cleanup to fix C15 eeprom/spi build errors (qmk#11) * Cleanup to fix C15 eeprom/spi build errors * add newline at eof * LED Masking support for Shine Introduce companion update to ledSetMask and ledClearMask. In keymap `codetector` there is example of how to map caps_lock to the caps_lock key light on the keyboard. * [AnnePro2]: update bluetooth connection * Merge the custom keys enums on annepro2.h (qmk#13) * Keyboard annepro2 ble caps lock (qmk#12) * Move matrix_scan_kb out of board.c to annepro2.c * add buffer clear after init and caplock polling * Add support for LED intensity (qmk#15) * Improve logic for switching off and on of LEDs (qmk#16) * Implement animation speed (qmk#17) * Include logic to send solid colors as foreground to shine and add sample profiles (qmk#14) Include the logic to send a solid color from qmk to shine. That solid color will act as a foreground (will override the current profile) until reset (witch will reactivate the current profile). This functionality depends on changes made for shine as well. Include 3 new profiles: default-full-caps -> same as default, but with the logic of using the red foreground color on caps lock. default-layer-indicators -> same as default, but with the logic of red foreground on caps lock, green foreground on FN1 and blue foreground on FN2. thomazmoura -> my own profile as a sample of an over-engineered advanced case scenario. * Implement reactive lighting effects (qmk#18) * Added multiarrow keymap (qmk#19) * Add LED documentation (qmk#26) * add LED documentation * add LED documentation to other default profiles * Implement QMK's IAP default keybind (qmk#29) * Add keymap for going into IAP * switch to default QMK keybind for IAP mode * implement bluetooth IAP mode * Make default config more like Obins stock default (qmk#30) * Add new message type for resetting foreground color (qmk#31) * annepro2(bluetooth): add media keys support (qmk#41) * Asynchronous, robust serial protocol. (qmk#39) * bla personal ap2-c18 keymap. * Bidirectional, asynchronous message-based communication with Shine. - Requires a matching Shine version. - Protocol is resiliant to loosing bytes during communication, chips won't lock waiting for bytes that aren't coming. - Chips resynchronize in event of loosing a byte using a AA0D header. Regressions: - Key masking/locking doesn't work right now. (did it work before?) - Not all user keymaps build against it. * Clang-format + code to ease reducing speed of LED UART. - Did clang-format --style=file -i on multiple files according to coding_conventions_c.md - Added separate serial speed for IAP boot and Led communication, it's possible that reducing this to 9600 helped someone with faulty HW. With this code they can do it with simple replacing of a value. * Main chip can set/clear foreground using a mask mechanism. - Some preparations for selective colouring. * Selective mask works - tested on capslock. - Migrated personal keymaps to new status API. * Clear the foreground colors to show profile when it's modified. - Show example of achieving selective caps-lock painting + foreground painting for layers. - annepro2LedMaskSetRow is implemented, but still requires testing. * Implement the QMK side of led blinking to indicate the command was received. - This stupidly blinks the key when user presses one of the bluetooth commands to let the user know that the command was received and forwarded to the BT chip. - TODO: Row/col key positions are hardcoded and not taken from the keymap. * Reduce memory footprint. Applying code review suggestions. Moved msgId to globals - preparing for transmission without copying payload when no retries are necessary. Added empty readme.md files - required by QMK lint. Co-authored-by: Tomasz bla Fortuna <bla@thera.be> * Let the LED chip settle a bit before waking it from the bootloader. (qmk#42) At least for one person that helps to reliably get the LEDs working without disconnecting/reconnecting the power to the board multiple times. Co-authored-by: Tomasz bla Fortuna <bla@thera.be> * annepro2: rename KEYMAP to LAYOUT, as required by new version of QMK * annepro2: update ChibiOS configuration files * annepro2: fix undefined reference to dprint and timer_read32 * annepro2: update ChibiOS MCU name * update spi driver, fix bad merging with master * annepro2: add readme and info.json * annepro2: make code compatible with QMK coding conventions * tmk_core: temporary fix to allow HT32 based keyboards to work without patched ChibiOS-contrib (AnnePro2) * AnnePro2: removed core changes * AnnePro2: Leave only default keymaps Missing keymaps will be restored in another PR * annepro2: add licence information * annepro2: satisfy qmk lint * annepro2: fix drashna's suggestions * annepro2: fix matrix * annepro2: apply code review suggestions * annepro2: apply remaining code review suggestions * annepro2: update info.json * annepro2: remove include * annepro2: rename keymap to layout * annepro2: fix typing * annepro2: apply suggestions from tzarc's code review Co-authored-by: Nick Brassel <nick@tzarc.org> * annepro2: more fixes * annepro2: apply suggestions from code review Co-authored-by: Joel Challis <git@zvecr.com> * annepro2: rename file * more fixes * Apply suggestions from @tzarc code review Co-authored-by: Nick Brassel <nick@tzarc.org> * Update keyboards/annepro2/protocol.h Co-authored-by: Nick Brassel <nick@tzarc.org> * Update keyboards/annepro2/chconf.h Co-authored-by: Nick Brassel <nick@tzarc.org> * apply CR suggestions * upgrade readme * IAP * update IAP comments, defines * led fix * init fix * annepro2: GPIO cleanup * annepro2: ioline * change waiting time * Start develop for 2022q2 * [Core] Squeeze AVR some more with `-mrelax` and `-mcall-prologues` (qmk#16269) * Rework generate-api CLI command to use .build directory (qmk#16441) * Remove `send_unicode_hex_string()` (qmk#16518) * Change data driven "str" type to represent a quoted string literal (qmk#16516) * Change data driven "str" type to represent a quoted string literal * Update docs * Map data driven `DESCRIPTION` as string literal (qmk#16523) * update bootloader * Revert "Merge pull request qmk#2 from qmk/develop" This reverts commit 9c76065, reversing changes made to 240745d. * Revert "update bootloader" This reverts commit 240745d. * fix rules.mk * change PROGRAM_CMD Co-authored-by: codetector <codetector@codetector.cn> Co-authored-by: Fagl4 <18francisco18@gmail.com> Co-authored-by: Jakob Gillich <jakob@gillich.me> Co-authored-by: tech2077 <tech2077@gmail.com> Co-authored-by: jcdeA <31413538+JcdeA@users.noreply.github.com> Co-authored-by: Thomaz Moura <5599621+thomazmoura@users.noreply.github.com> Co-authored-by: Darkhan <darkhanu@gmail.com> Co-authored-by: Paco <70448173+packorf@users.noreply.github.com> Co-authored-by: jmarmstrong1207 <32995055+jmarmstrong1207@users.noreply.github.com> Co-authored-by: 1Conan <7620342+1Conan@users.noreply.github.com> Co-authored-by: Tomasz bla Fortuna <blagh@thera.be> Co-authored-by: Tomasz bla Fortuna <bla@thera.be> Co-authored-by: Nick Brassel <nick@tzarc.org> Co-authored-by: Joel Challis <git@zvecr.com> Co-authored-by: QMK Bot <hello@qmk.fm> Co-authored-by: Stefan Kerkmann <karlk90@pm.me> Co-authored-by: Ryan <fauxpark@gmail.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A few things that needed to be added to get persistent led support: