Compare commits
261 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 746ae2a09f | |||
| b93485e087 | |||
| 88d29263de | |||
| ac86fa6ccb | |||
| f5a656911e | |||
|
|
310b00319a | ||
|
|
0bf3456292 | ||
|
|
2ab727b423 | ||
|
|
ecdcfea8a4 | ||
|
|
f73d3a1c22 | ||
|
|
53a1065219 | ||
|
|
2b8156cad8 | ||
|
|
c564d04b22 | ||
|
|
65e1e5e25a | ||
|
|
0a28a395fc | ||
|
|
08e567797e | ||
|
|
0e53bee212 | ||
|
|
d8d8a543c0 | ||
|
|
97cff6438e | ||
|
|
7755c57478 | ||
|
|
8aea024ed2 | ||
|
|
e5a7ded3d1 | ||
|
|
d9d8a91817 | ||
|
|
262eb4a695 | ||
|
|
b4cd3fab9b | ||
|
|
3e87ed851a | ||
|
|
60dade7e18 | ||
|
|
6c0ebc3223 | ||
|
|
a857780e42 | ||
|
|
6e77dece04 | ||
|
|
a57fedec70 | ||
|
|
95003cf55d | ||
|
|
4486f607da | ||
|
|
0caf0144dc | ||
|
|
3686b2a6ff | ||
|
|
bf286b944e | ||
|
|
19cdca27e7 | ||
|
|
657f998afa | ||
|
|
d6d5178d87 | ||
|
|
06d1643b4f | ||
|
|
3058438d88 | ||
|
|
10150c4eca | ||
|
|
196dfe3d15 | ||
|
|
d08de0e31d | ||
|
|
e948af3df4 | ||
|
|
fc300fff0c | ||
|
|
16c5cac395 | ||
|
|
e2e14ac73b | ||
|
|
cfb15b6902 | ||
|
|
92752a5963 | ||
|
|
6b74a01a0b | ||
|
|
b92bf86b99 | ||
|
|
8f98bf3d2f | ||
|
|
a712ac6c8a | ||
|
|
f54967ddab | ||
|
|
4832384cf3 | ||
|
|
f310e26c8e | ||
|
|
afb434a4bd | ||
|
|
ff14aa8842 | ||
|
|
0ed9c62602 | ||
|
|
1373380221 | ||
|
|
3f8314474a | ||
|
|
da5e668ad2 | ||
|
|
5e382c67e9 | ||
|
|
9076a3a6c0 | ||
|
|
6ab0c2eb72 | ||
|
|
2e73bb9ea1 | ||
|
|
e5ac605b4c | ||
|
|
fb220038b7 | ||
|
|
464c56f599 | ||
|
|
a59b43b433 | ||
|
|
ceb2f3de00 | ||
|
|
5cd4030a93 | ||
|
|
21ae72dd9e | ||
|
|
dba61c6a42 | ||
|
|
f61acc483b | ||
|
|
fb38e4099b | ||
|
|
5fe19abe06 | ||
|
|
06e34fdcbc | ||
|
|
cc6666b96d | ||
|
|
a22dfdd917 | ||
|
|
8b69a25dda | ||
|
|
6f2b45c27c | ||
|
|
98f7d512de | ||
|
|
c5cf738fd0 | ||
|
|
af31ae210a | ||
|
|
44799995b9 | ||
|
|
3f5f83a19b | ||
|
|
bc4f35e578 | ||
|
|
e9309aab16 | ||
|
|
f004b84399 | ||
|
|
58f8120611 | ||
|
|
5b71fb7aaa | ||
|
|
9d0f41bf5e | ||
|
|
47a3a8ad80 | ||
|
|
b4908bf2ac | ||
|
|
846342e851 | ||
|
|
3196abe574 | ||
|
|
5f0bae1840 | ||
|
|
c3a38c8b59 | ||
|
|
1f9d31cad4 | ||
|
|
b89de6655e | ||
|
|
4a1b747197 | ||
|
|
eca87d2f62 | ||
|
|
2e2b9d08a9 | ||
|
|
b4c2204e50 | ||
|
|
4c0546de6c | ||
|
|
bea4c34a51 | ||
|
|
bdc6232780 | ||
|
|
1d2d1c5049 | ||
|
|
67f07abd0d | ||
|
|
4bfcd6e02c | ||
|
|
7eb190489b | ||
|
|
640c034111 | ||
|
|
a6f12848ed | ||
|
|
47f6a27e48 | ||
|
|
9cc383a91d | ||
|
|
a441cdf5d2 | ||
|
|
8297dd5c48 | ||
|
|
225a481938 | ||
|
|
5572952dc8 | ||
|
|
7d011237f8 | ||
|
|
1a47c6e629 | ||
|
|
047a232e7e | ||
|
|
28f5999cbb | ||
|
|
fe7505a2df | ||
|
|
b6ac16074c | ||
|
|
0bf205c5d2 | ||
|
|
e4a99a9400 | ||
|
|
1e9b5833eb | ||
|
|
79b052fca7 | ||
|
|
baee0b5682 | ||
|
|
6153d54f59 | ||
|
|
0a6ebe2903 | ||
|
|
1fbbeb0f33 | ||
|
|
456f0e9e58 | ||
|
|
0248a0e79f | ||
|
|
0e5ec29433 | ||
|
|
2d7cd68459 | ||
|
|
5ac10fabcb | ||
|
|
b11017609d | ||
|
|
c3a5d258e5 | ||
|
|
a2866feb77 | ||
|
|
8c50192d6c | ||
|
|
63d82d92db | ||
|
|
1bced1be13 | ||
|
|
86196d438c | ||
|
|
d722b3d173 | ||
|
|
2ef5c49090 | ||
|
|
5a137392ee | ||
|
|
27d12ea31f | ||
|
|
9ba09ec8eb | ||
|
|
014addd777 | ||
|
|
4562a17155 | ||
|
|
950843ca2c | ||
|
|
9600f46f83 | ||
|
|
ef7589d83a | ||
|
|
84f48ed055 | ||
|
|
ebef301e27 | ||
|
|
5b8b8d93e4 | ||
|
|
d48049535e | ||
|
|
5bd479ab8e | ||
|
|
372151848a | ||
|
|
5b32c0da43 | ||
|
|
edf34de4b5 | ||
|
|
8c7eb079ec | ||
|
|
6612f7cced | ||
|
|
7606f311c8 | ||
|
|
9fe73233af | ||
|
|
cba1ef97b6 | ||
|
|
c69f664e85 | ||
|
|
6c895988de | ||
|
|
f16a004583 | ||
|
|
c870f335a7 | ||
|
|
b6f59563c7 | ||
|
|
409bd01af6 | ||
|
|
b9b5eb2c76 | ||
|
|
11a8ffbaf5 | ||
|
|
9938f14d20 | ||
|
|
217259ba63 | ||
|
|
e5afa33b79 | ||
|
|
d3dfc9bd2c | ||
|
|
8f6251bc4d | ||
|
|
b93f211502 | ||
|
|
69411e53e9 | ||
|
|
39819e6058 | ||
|
|
bd97bba4b5 | ||
|
|
4214f3e0b6 | ||
|
|
6eceb6ad30 | ||
|
|
994e2f6b79 | ||
|
|
baa5e8f037 | ||
|
|
cbd5f1b500 | ||
|
|
c1dc4be8c8 | ||
|
|
1bd8c7dca8 | ||
|
|
d72ea4dde5 | ||
|
|
5d621880ec | ||
|
|
5c3e2966c4 | ||
|
|
d21fe30139 | ||
|
|
224d9eae42 | ||
|
|
8c02f3db53 | ||
|
|
02bbeb7177 | ||
|
|
cdfabaec42 | ||
|
|
0e9525ce9a | ||
|
|
633a6cec77 | ||
|
|
d35a7cc644 | ||
|
|
76a91c010b | ||
|
|
54b0a595bc | ||
|
|
4b9aa0860c | ||
|
|
df8792a60d | ||
|
|
5988fce59b | ||
|
|
314eb0d771 | ||
|
|
c1f5a96e1b | ||
|
|
64592d7032 | ||
|
|
c6b180b8f5 | ||
|
|
0155447c6a | ||
|
|
04f4053bde | ||
|
|
09a58b607c | ||
|
|
be82530412 | ||
|
|
6e11c0b8af | ||
|
|
9fade6368c | ||
|
|
ff99c2e734 | ||
|
|
6d356114a8 | ||
|
|
3041132959 | ||
|
|
2877773cac | ||
|
|
a061febd01 | ||
|
|
e3773fd5c0 | ||
|
|
a92835454d | ||
|
|
64e5fa7ecb | ||
|
|
d1894fb62a | ||
|
|
fe7065be4a | ||
|
|
e7b3127af1 | ||
|
|
724378cf6c | ||
|
|
14eb9c6ec0 | ||
|
|
9a8b1ef8b9 | ||
|
|
2cc94bd1fc | ||
|
|
ad8de4dd56 | ||
|
|
5e97ad1b3c | ||
|
|
fe06ed0a4b | ||
|
|
d449123fab | ||
|
|
4d483e7896 | ||
|
|
b1cbeefa28 | ||
|
|
9be3cf4865 | ||
|
|
65006cc376 | ||
|
|
fc01b29823 | ||
|
|
462595ef03 | ||
|
|
b0d85795f4 | ||
|
|
2c91ef51db | ||
|
|
a54e7ac0a8 | ||
|
|
64f54c268b | ||
|
|
d889d51a7d | ||
|
|
b284e9fa58 | ||
|
|
1a0da7971a | ||
|
|
53a82a5f57 | ||
|
|
10985abcdb | ||
|
|
e60a282742 | ||
|
|
a691b16ebe | ||
|
|
c38114648a | ||
|
|
3fc4419f4f | ||
|
|
033bdf6491 | ||
|
|
18e3ba9558 | ||
|
|
3fb552cc55 |
25
.drone.yml
Normal file
25
.drone.yml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: default
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: submodules
|
||||||
|
image: docker:git
|
||||||
|
commands:
|
||||||
|
- git submodule update --recursive --init
|
||||||
|
- name: build left, debug
|
||||||
|
image: hardwario/gcc-arm-embedded:7-2017-q4-major
|
||||||
|
commands:
|
||||||
|
- make -j2 -C left DEBUG=1
|
||||||
|
- name: build left
|
||||||
|
image: hardwario/gcc-arm-embedded:7-2017-q4-major
|
||||||
|
commands:
|
||||||
|
- make -j2 -C left DEBUG=0
|
||||||
|
- name: build right, debug
|
||||||
|
image: hardwario/gcc-arm-embedded:7-2017-q4-major
|
||||||
|
commands:
|
||||||
|
- make -j2 -C right DEBUG=1
|
||||||
|
- name: build right
|
||||||
|
image: hardwario/gcc-arm-embedded:7-2017-q4-major
|
||||||
|
commands:
|
||||||
|
- make -j2 -C right DEBUG=0
|
||||||
36
.travis.yml
36
.travis.yml
@@ -1,36 +1,22 @@
|
|||||||
language: c
|
language: c
|
||||||
|
|
||||||
|
os:
|
||||||
|
- linux
|
||||||
|
- osx
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
- $HOME/Library/Caches/Homebrew/Cask
|
# Cache for the gcc archives
|
||||||
|
- $HOME/gcc-cache/
|
||||||
|
|
||||||
install: eclipse -noSplash
|
install:
|
||||||
-application org.eclipse.equinox.p2.director
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then GCC_NAME="gcc-arm-none-eabi-7-2017-q4-major-mac.tar.bz2"; else GCC_NAME="gcc-arm-none-eabi-7-2017-q4-major-linux.tar.bz2"; fi
|
||||||
-repository http://gnuarmeclipse.sourceforge.net/updates
|
- if test ! -e $HOME/gcc-cache/$GCC_NAME ; then wget "https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2017q4/$GCC_NAME" -O $HOME/gcc-cache/$GCC_NAME ; fi
|
||||||
-installIUs ilg.gnuarmeclipse.managedbuild.cross.feature.group
|
- tar -xf $HOME/gcc-cache/$GCC_NAME -C $HOME
|
||||||
-profileProperties org.eclipse.update.install.features=true
|
- export PATH=$PATH:$HOME/gcc-arm-none-eabi-7-2017-q4-major/bin
|
||||||
|
|
||||||
before_script:
|
|
||||||
- tar -xf gcc-arm-none-eabi-7-2017-q4-major-*.tar.bz2
|
|
||||||
- export PATH=$PATH:$PWD/gcc-arm-none-eabi-7-2017-q4-major/bin
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- eclipse -noSplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -import $TRAVIS_BUILD_DIR/left/build -import $TRAVIS_BUILD_DIR/right/build -build all
|
|
||||||
- make -C left clean && make -j2 -C left DEBUG=1
|
- make -C left clean && make -j2 -C left DEBUG=1
|
||||||
- make -C left clean && make -j2 -C left DEBUG=0
|
- make -C left clean && make -j2 -C left DEBUG=0
|
||||||
- make -C right clean && make -j2 -C right DEBUG=1
|
- make -C right clean && make -j2 -C right DEBUG=1
|
||||||
- make -C right clean && make -j2 -C right DEBUG=0
|
- make -C right clean && make -j2 -C right DEBUG=0
|
||||||
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: linux
|
|
||||||
sudo: required
|
|
||||||
before_install:
|
|
||||||
- curl https://nixos.org/nix/install | sh && . ~/.nix-profile/etc/profile.d/nix.sh
|
|
||||||
- nix-env -i eclipse-cpp
|
|
||||||
- wget "https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2017q4/gcc-arm-none-eabi-7-2017-q4-major-linux.tar.bz2"
|
|
||||||
- os: osx
|
|
||||||
env: PATH="$PATH:/Applications/Eclipse CPP.app/Contents/MacOS"
|
|
||||||
before_install:
|
|
||||||
- brew cask install eclipse-cpp
|
|
||||||
- wget "https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2017q4/gcc-arm-none-eabi-7-2017-q4-major-mac.tar.bz2"
|
|
||||||
|
|||||||
125
CHANGELOG.md
125
CHANGELOG.md
@@ -5,6 +5,131 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is loosely based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
The format is loosely based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||||
and this project adheres to the [UHK Versioning](VERSIONING.md) conventions.
|
and this project adheres to the [UHK Versioning](VERSIONING.md) conventions.
|
||||||
|
|
||||||
|
## [8.6.0] - 2018-08-23
|
||||||
|
|
||||||
|
Device Protocol: 4.5.0 | Module Protocol: 4.**1.0** | User Config: 4.1.**1** | Hardware Config: 1.0.0
|
||||||
|
|
||||||
|
- Make the config parser accept mouse button 4 to 8. `USERCONFIG:PATCH`
|
||||||
|
- Implement API for modules to send pointer movements to the master. `MODULEPROTOCOL:MINOR`
|
||||||
|
- Fix empty macro playback.
|
||||||
|
|
||||||
|
## [8.5.4] - 2018-01-05
|
||||||
|
|
||||||
|
Device Protocol: 4.5.0 | Module Protocol: 4.0.0 | User Config: 4.1.0 | Hardware Config: 1.0.0
|
||||||
|
|
||||||
|
- Make the modifiers of shortcut keys stick only as long as the layer switcher key of a shortcut key is being held.
|
||||||
|
|
||||||
|
## [8.5.3] - 2018-10-20
|
||||||
|
|
||||||
|
Device Protocol: 4.5.0 | Module Protocol: 4.0.0 | User Config: 4.1.0 | Hardware Config: 1.0.0
|
||||||
|
|
||||||
|
- Re-enable the I2C watchdog of the left keyboard half which was accidentally disabled starting from firmware 8.4.3. This should fix the freezes of the left keyboard half.
|
||||||
|
|
||||||
|
## [8.5.2] - 2018-10-06
|
||||||
|
|
||||||
|
Device Protocol: 4.5.0 | Module Protocol: 4.0.0 | User Config: 4.1.0 | Hardware Config: 1.0.0
|
||||||
|
|
||||||
|
- Don't suppress keys upon keymap change.
|
||||||
|
|
||||||
|
## [8.5.1] - 2018-10-04
|
||||||
|
|
||||||
|
Device Protocol: 4.5.0 | Module Protocol: 4.0.0 | User Config: 4.1.0 | Hardware Config: 1.0.0
|
||||||
|
|
||||||
|
- Reset UsbReportUpdateSemaphore if it gets stuck for 100ms. This should fix occasional freezes.
|
||||||
|
|
||||||
|
## [8.5.0] - 2018-10-04
|
||||||
|
|
||||||
|
Device Protocol: 4.**5.0** | Module Protocol: 4.0.0 | User Config: 4.1.0 | Hardware Config: 1.0.0
|
||||||
|
|
||||||
|
- Send primary role modifiers consistently.
|
||||||
|
- Only allow layer switcher keys to deactivate toggled layers.
|
||||||
|
- Deactivate secondary roles when switching keymaps.
|
||||||
|
- Use the correct scancode so that commas are outputted for macros.
|
||||||
|
- Move the pointer not by 1 but by 5 pixels when testing the USB stack to make the pointer easier to see.
|
||||||
|
- Expose UsbReportUpdateSemaphore via UsbCommand_{Get,Set}Variable() `DEVICEPROTOCOL:MINOR`
|
||||||
|
- Extract CurrentTime and remove Timer_{Get,Set}CurrentTime()
|
||||||
|
|
||||||
|
## [8.4.5] - 2018-08-21
|
||||||
|
|
||||||
|
Device Protocol: 4.4.0 | Module Protocol: 4.0.0 | User Config: 4.1.0 | Hardware Config: 1.0.0
|
||||||
|
|
||||||
|
- Suppress pressed keys when the layer or keymap changes.
|
||||||
|
|
||||||
|
## [8.4.4] - 2018-08-14
|
||||||
|
|
||||||
|
Device Protocol: 4.4.0 | Module Protocol: 4.0.0 | User Config: 4.1.0 | Hardware Config: 1.0.0
|
||||||
|
|
||||||
|
- Don't wake the host if a key is held down through the beginning of sleep.
|
||||||
|
- Ensure that secondary roles are triggered consistently.
|
||||||
|
|
||||||
|
## [8.4.3] - 2018-08-12
|
||||||
|
|
||||||
|
Device Protocol: 4.4.0 | Module Protocol: 4.0.0 | User Config: 4.1.0 | Hardware Config: 1.0.0
|
||||||
|
|
||||||
|
- Compensate "double tap to lock layer" timeouts for the timer fix to make them as long as before 8.3.3
|
||||||
|
|
||||||
|
## [8.4.2] - 2018-08-02
|
||||||
|
|
||||||
|
Device Protocol: 4.4.0 | Module Protocol: 4.0.0 | User Config: 4.1.0 | Hardware Config: 1.0.0
|
||||||
|
|
||||||
|
- Fix various bugs related to secondary role handling and sticky modifier states.
|
||||||
|
|
||||||
|
## [8.4.1] - 2018-07-31
|
||||||
|
|
||||||
|
Device Protocol: 4.4.0 | Module Protocol: 4.0.0 | User Config: 4.1.0 | Hardware Config: 1.0.0
|
||||||
|
|
||||||
|
- Make some improvements to the sleep/wake code.
|
||||||
|
|
||||||
|
## [8.4.0] - 2018-07-24
|
||||||
|
|
||||||
|
Device Protocol: 4.**4.0** | Module Protocol: 4.0.0 | User Config: 4.1.0 | Hardware Config: 1.0.0
|
||||||
|
|
||||||
|
- Rewrite the key debouncer and set the press and release timeouts to 50ms.
|
||||||
|
- Add hardcoded test keymap.
|
||||||
|
- Make debounce timeouts configurable via USB. `DEVICEPROTOCOL:MINOR`
|
||||||
|
- Make the hardcoded test keymap able to trigger via USB. `DEVICEPROTOCOL:MINOR`
|
||||||
|
- Allow the USB stack test mode to be activated via USB. `DEVICEPROTOCOL:MINOR`
|
||||||
|
|
||||||
|
## [8.3.3] - 2018-07-03
|
||||||
|
|
||||||
|
Device Protocol: 4.3.1 | Module Protocol: 4.0.0 | User Config: 4.1.0 | Hardware Config: 1.0.0
|
||||||
|
|
||||||
|
- Implement the macro engine.
|
||||||
|
- Fix the timer which makes it tick twice as fast as before.
|
||||||
|
- Fix the nondeterministic bug that made USB hang.
|
||||||
|
- Restore the Windows related commits of firmware 8.3.1 because the USB hang bug has been fixed.
|
||||||
|
- Restore debouncing to 100ms until it gets really fixed.
|
||||||
|
|
||||||
|
## [8.3.2] - 2018-06-27
|
||||||
|
|
||||||
|
Device Protocol: 4.3.1 | Module Protocol: 4.0.0 | User Config: 4.1.0 | Hardware Config: 1.0.0
|
||||||
|
|
||||||
|
- Make the debouncer debounce not only on key presses but also on key releases, and change the debounce interval from 100ms to the suggested 5ms of MX switches.
|
||||||
|
- Revert the Windows related commits of firmware 8.3.1 because they introduced a nondeterministic bug that made USB hang.
|
||||||
|
- Add base layer key mappings for the left and right add-ons for testing purposes.
|
||||||
|
|
||||||
|
## [8.3.1] - 2018-06-07
|
||||||
|
|
||||||
|
Device Protocol: 4.3.1 | Module Protocol: 4.0.0 | User Config: 4.1.0 | Hardware Config: 1.0.0
|
||||||
|
|
||||||
|
- Fix media key repetition bug on Windows.
|
||||||
|
- Fix bug that made Windows unable to sleep when the UHK was plugged in.
|
||||||
|
- Fix bug that made Chrome Remote Desktop blocked from interacting on Windows.
|
||||||
|
- Fix bug that made locked layers not release. This bug was introduced in the previous release.
|
||||||
|
|
||||||
|
## [8.3.0] - 2018-06-03
|
||||||
|
|
||||||
|
Device Protocol: 4.3.1 | Module Protocol: 4.0.0 | User Config: 4.**1.0** | Hardware Config: 1.0.0
|
||||||
|
|
||||||
|
- Make the config parser handle switch layer actions with hold on double tap disabled. `USERCONFIG:MINOR`
|
||||||
|
- Set key debounce timeout from 80ms to 100ms. This should further reduce key chattering.
|
||||||
|
|
||||||
|
## [8.2.5] - 2018-05-27
|
||||||
|
|
||||||
|
Device Protocol: 4.3.1 | Module Protocol: 4.0.0 | User Config: 4.0.1 | Hardware Config: 1.0.0
|
||||||
|
|
||||||
|
- Now really fix the bug that made the hardware and user configuration not load from the EEPROM on some hosts right after firmware update.
|
||||||
|
|
||||||
## [8.2.4] - 2018-05-21
|
## [8.2.4] - 2018-05-21
|
||||||
|
|
||||||
Device Protocol: 4.3.**1** | Module Protocol: 4.0.0 | User Config: 4.0.1 | Hardware Config: 1.0.0
|
Device Protocol: 4.3.**1** | Module Protocol: 4.0.0 | User Config: 4.0.1 | Hardware Config: 1.0.0
|
||||||
|
|||||||
@@ -1,3 +1,17 @@
|
|||||||
|
# Signing the CLA
|
||||||
|
|
||||||
|
Before contributing to this project, you must sign [the CLA](/cla/cla-1.0.0.md).
|
||||||
|
|
||||||
|
To sign the CLA, add your GitHub username to the end of the CLA. Make sure that the usernames remain alphabetically sorted.
|
||||||
|
|
||||||
|
Then create a pull request with the title:
|
||||||
|
|
||||||
|
> Sign CLA
|
||||||
|
|
||||||
|
and with the body:
|
||||||
|
|
||||||
|
> I have read the Agreement, and fully agree to it by signing it with my GitHub username.
|
||||||
|
|
||||||
# Coding standards
|
# Coding standards
|
||||||
|
|
||||||
## Literal structure
|
## Literal structure
|
||||||
|
|||||||
8
ISSUE_TEMPLATE
Normal file
8
ISSUE_TEMPLATE
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
Before submitting a new issue, make sure to do the following:
|
||||||
|
|
||||||
|
1. If you're using Karabiner Elements on your Mac, close it!
|
||||||
|
2. Install the latest Agent:
|
||||||
|
https://github.com/UltimateHackingKeyboard/agent/releases/latest
|
||||||
|
3. Use Agent to update to the latest firmware:
|
||||||
|
https://github.com/UltimateHackingKeyboard/firmware/releases/latest
|
||||||
|
4. Try to reproduce the issue, and only report it if it still persists.
|
||||||
31
README.md
31
README.md
@@ -12,20 +12,33 @@ If you're one of the brave few who wants to hack the firmware then read on.
|
|||||||
|
|
||||||
`git clone --recursive git@github.com:UltimateHackingKeyboard/firmware.git`
|
`git clone --recursive git@github.com:UltimateHackingKeyboard/firmware.git`
|
||||||
|
|
||||||
2. Download and install MCUXpresso IDE for [Linux](https://storage.googleapis.com/ugl-static/mcuxpresso-ide/mcuxpressoide-10.1.1_606.x86_64.deb.bin), [Mac](https://storage.googleapis.com/ugl-static/mcuxpresso-ide/MCUXpressoIDE_10.1.1_606.pkg), or [Windows](https://storage.googleapis.com/ugl-static/mcuxpresso-ide/MCUXpressoIDE_10.1.1_606.exe).
|
2. Download and install MCUXpresso IDE for [Linux](https://storage.googleapis.com/ugl-static/mcuxpresso-ide/mcuxpressoide-11.0.1_2563.x86_64.deb.bin), [Mac](https://storage.googleapis.com/ugl-static/mcuxpresso-ide/MCUXpressoIDE_11.0.1_2563.pkg), or [Windows](https://storage.googleapis.com/ugl-static/mcuxpresso-ide/MCUXpressoIDE_11.0.1_2563.exe).
|
||||||
|
|
||||||
3. In the IDE, import the project by invoking *File -> Import -> General -> Existing Projects into Workspace*, select the *left* or *right* directory depending on the desired firmware, then click on the *Finish* button.
|
3. Install the GNU ARM Eclipse Plugins for in McuXpresso IDE. This is needed to make indexing work, and to avoid the "Orphaned configuration" error message in project properties.
|
||||||
|
1. Visit the [latest release](https://github.com/gnu-mcu-eclipse/eclipse-plugins/releases/latest).
|
||||||
|
2. Download the zip file.
|
||||||
|
3. In MCUXpresso IDE, go to Help > "Install New Software...", then a new dialog will appear.
|
||||||
|
4. Click the "Add..." button, then a new dialog will appear.
|
||||||
|
5. Click the "Archive..." button and choose the downloaded zip file.
|
||||||
|
6. Go with the flow and install the plugin.
|
||||||
|
|
||||||
|
4. In the IDE, import this project by invoking *File -> Import -> General -> Existing Projects into Workspace*, select the *left* or *right* directory depending on the desired firmware, then click on the *Finish* button.
|
||||||
|
|
||||||
## Building and flashing the firmware
|
5. In order to be able to flash the firmware via USB from the IDE, you must build [Agent](https://github.com/UltimateHackingKeyboard/agent) which is Git submodule of the this repo and located in the `lib/agent` directory.
|
||||||
|
|
||||||
For the left keyboard half, make sure to power it via the right keyboard half (which must be powered via USB). Also connect the left keyboard half to your SEGGER J-Link USB debug probe (which must also be connected via USB). Then in KDS, click on *Run -> Run Configurations*, select *GDB SEGGER J-Link Debugging -> uhk60-left_release_jlink*, and click on the *Debug* button.
|
6. Finally, in the IDE, click on *Run -> External Tools -> External Tools Configurations*, then select a release firmware to be flashed such as *uhk60-right_release_kboot*, and click on the *Run* button.
|
||||||
|
|
||||||
For the right keyboard half, flash [the bootloader](https://github.com/UltimateHackingKeyboard/bootloader) first.
|
Going forward, it's easier to flash the firmware of your choice by using the downwards toolbar icon which is located rightwards of the *green play + toolbox icon*.
|
||||||
|
|
||||||
At this point, you can flash the right firmware via USB from KDS. To achieve this, you must build [Agent](https://github.com/UltimateHackingKeyboard/agent) that is Git submodule of the this repo and located in the `lib/agent` directory. Then in KDS, click on *Run -> Run Configurations*, select *C/C++ Application -> uhk60-right_release_kboot*, and click on the *Run* button.
|
|
||||||
|
|
||||||
From this point on, you can upgrade the firmwares of both halves via USB by using the uhk60-left_release_kboot and uhk60-right_release_kboot run configurations. Alternatively, you can use your SEGGER J-Link probe.
|
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
Want to contribute? Let us show you [how](/CONTRIBUTING.md).
|
Want to contribute? Let us show you [how](/CONTRIBUTING.md).
|
||||||
|
|
||||||
|
## Custom Firmwares
|
||||||
|
|
||||||
|
The following list contains unofficial forks of the firmware. These forks provide functionality unavailable in the official firmware, but come without guarantees of any kind:
|
||||||
|
|
||||||
|
- [https://github.com/kareltucek/firmware](https://github.com/kareltucek/firmware) - firmware featuring macro engine extended by a set of custom commands, allowing more advanced configurations including custom layer switching logic, doubletap bindings, alternative secondary roles etc.
|
||||||
|
|
||||||
|
- [https://github.com/p4elkin/firmware](https://github.com/p4elkin/firmware) - firmware fork which comes with an alternative implementation of the secondary key role mechanism making it possible to use the feature for keys actively involved in typing (e.g. alphanumeric ones).
|
||||||
|
|
||||||
|
|||||||
108
cla/cla-1.0.0.md
Normal file
108
cla/cla-1.0.0.md
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
# Contributor Agreement
|
||||||
|
## Individual Contributor Exclusive License Agreement version 1.0.0
|
||||||
|
|
||||||
|
Thank you for your interest in contributing to Ultimate Gadget Laboratories Kft.'s Ultimate Hacking Keyboard firmware ("We" or "Us").
|
||||||
|
|
||||||
|
The purpose of this contributor agreement ("Agreement") is to clarify and document the rights granted by contributors to Us.
|
||||||
|
|
||||||
|
By signing this Agreement, you agree that the following terms apply to all of your past, present and future contributions to the project.
|
||||||
|
|
||||||
|
## How to use this Contributor Agreement
|
||||||
|
|
||||||
|
If You are an employee and have created the Contribution as part of your employment, You need to have Your employer approve this Agreement or sign the Entity version of this document. If You do not own the Copyright in the entire work of authorship, any other author of the Contribution should also sign this – in any event, please contact Us at support@UltimateHackingKeyboard.com
|
||||||
|
|
||||||
|
## 1. Definitions
|
||||||
|
|
||||||
|
**"You"** means the individual Copyright owner who Submits a Contribution to Us.
|
||||||
|
|
||||||
|
**"Contribution"** means any original work of authorship, including any original modifications or additions to an existing work of authorship, Submitted by You to Us, in which You own the Copyright.
|
||||||
|
|
||||||
|
**"Copyright"** means all rights protecting works of authorship, including copyright, moral and neighboring rights, as appropriate, for the full term of their existence.
|
||||||
|
|
||||||
|
**"Material"** means the software or documentation made available by Us to third parties. When this Agreement covers more than one software project, the Material means the software or documentation to which the Contribution was Submitted. After You Submit the Contribution, it may be included in the Material.
|
||||||
|
|
||||||
|
**"Submit"** means any act by which a Contribution is transferred to Us by You by means of tangible or intangible media, including but not limited to electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, Us, but excluding any transfer that is conspicuously marked or otherwise designated in writing by You as "Not a Contribution."
|
||||||
|
|
||||||
|
**"Documentation"** means any non-software portion of a Contribution.
|
||||||
|
|
||||||
|
## 2. License grant
|
||||||
|
|
||||||
|
### 2.1 Copyright license to Us
|
||||||
|
|
||||||
|
Subject to the terms and conditions of this Agreement, You hereby grant to Us a worldwide, royalty-free, exclusive, perpetual and irrevocable (except as stated in Section 8.2) license, with the right to transfer an unlimited number of non-exclusive licenses or to grant sublicenses to third parties, under the Copyright covering the Contribution to use the Contribution by all means, including, but not limited to:
|
||||||
|
|
||||||
|
* publish the Contribution,
|
||||||
|
* modify the Contribution,
|
||||||
|
* prepare derivative works based upon or containing the Contribution and/or to combine the Contribution with other Materials,
|
||||||
|
* reproduce the Contribution in original or modified form,
|
||||||
|
* distribute, to make the Contribution available to the public, display and publicly perform the Contribution in original or modified form.
|
||||||
|
|
||||||
|
### 2.2 Moral rights
|
||||||
|
|
||||||
|
Moral Rights remain unaffected to the extent they are recognized and not waivable by applicable law.
|
||||||
|
|
||||||
|
### 2.3 Copyright license back to You
|
||||||
|
|
||||||
|
Upon such grant of rights to Us, We immediately grant to You a worldwide, royalty-free, non-exclusive, perpetual and irrevocable license, with the right to transfer an unlimited number of non-exclusive licenses or to grant sublicenses to third parties, under the Copyright covering the Contribution to use the Contribution by all means, including, but not limited to:
|
||||||
|
|
||||||
|
* publish the Contribution,
|
||||||
|
* modify the Contribution,
|
||||||
|
* prepare derivative works based upon or containing the Contribution and/or to combine the Contribution with other Materials,
|
||||||
|
* reproduce the Contribution in original or modified form,
|
||||||
|
* distribute, to make the Contribution available to the public, display and publicly perform the Contribution in original or modified form.
|
||||||
|
|
||||||
|
This license back is limited to the Contribution and does not provide any rights to the Material.
|
||||||
|
|
||||||
|
## 3. Patents
|
||||||
|
|
||||||
|
### 3.1 Patent license
|
||||||
|
|
||||||
|
Subject to the terms and conditions of this Agreement You hereby grant to Us and to recipients of Materials distributed by Us a worldwide, royalty-free, non-exclusive, perpetual and irrevocable (except as stated in Section 3.2) patent license, with the right to transfer an unlimited number of non-exclusive licenses or to grant sublicenses to third parties, to make, have made, use, sell, offer for sale, import and otherwise transfer the Contribution and the Contribution in combination with any Material (and portions of such combination). This license applies to all patents owned or controlled by You, whether already acquired or hereafter acquired, that would be infringed by making, having made, using, selling, offering for sale, importing or otherwise transferring of Your Contribution(s) alone or by combination of Your Contribution(s) with any Material.
|
||||||
|
|
||||||
|
### 3.2 Revocation of patent license
|
||||||
|
|
||||||
|
You reserve the right to revoke the patent license stated in section 3.1 if We make any infringement claim that is targeted at your Contribution and not asserted for a Defensive Purpose. An assertion of claims of the Patents shall be considered for a "Defensive Purpose" if the claims are asserted against an entity that has filed, maintained, threatened, or voluntarily participated in a patent infringement lawsuit against Us or any of Our licensees.
|
||||||
|
|
||||||
|
## 4. Disclaimer
|
||||||
|
|
||||||
|
THE CONTRIBUTION IS PROVIDED "AS IS". MORE PARTICULARLY, ALL EXPRESS OR IMPLIED WARRANTIES INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTY OF SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE EXPRESSLY DISCLAIMED BY YOU TO US AND BY US TO YOU. TO THE EXTENT THAT ANY SUCH WARRANTIES CANNOT BE DISCLAIMED, SUCH WARRANTY IS LIMITED IN DURATION AND EXTENT TO THE MINIMUM PERIOD AND EXTENT PERMITTED BY LAW.
|
||||||
|
|
||||||
|
## 5. Consequential damage waiver
|
||||||
|
|
||||||
|
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT WILL YOU OR WE BE LIABLE FOR ANY LOSS OF PROFITS, LOSS OF ANTICIPATED SAVINGS, LOSS OF DATA, INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL AND EXEMPLARY DAMAGES ARISING OUT OF THIS AGREEMENT REGARDLESS OF THE LEGAL OR EQUITABLE THEORY (CONTRACT, TORT OR OTHERWISE) UPON WHICH THE CLAIM IS BASED.
|
||||||
|
|
||||||
|
## 6. Approximation of disclaimer and damage waiver
|
||||||
|
|
||||||
|
IF THE DISCLAIMER AND DAMAGE WAIVER MENTIONED IN SECTION 4. AND SECTION 5. CANNOT BE GIVEN LEGAL EFFECT UNDER APPLICABLE LOCAL LAW, REVIEWING COURTS SHALL APPLY LOCAL LAW THAT MOST CLOSELY APPROXIMATES AN ABSOLUTE WAIVER OF ALL CIVIL OR CONTRACTUAL LIABILITY IN CONNECTION WITH THE CONTRIBUTION.
|
||||||
|
|
||||||
|
## 7. Term
|
||||||
|
|
||||||
|
7.1 This Agreement shall come into effect upon Your acceptance of the terms and conditions.
|
||||||
|
|
||||||
|
7.2 In the event of a termination of this Agreement Sections 4, 5, 6, 7 and 8 shall survive such termination and shall remain in full force thereafter. For the avoidance of doubt, (sub)licenses that have already been granted for Contributions at the date of the termination shall remain in full force after the termination of this Agreement.
|
||||||
|
|
||||||
|
## 8. Miscellaneous
|
||||||
|
|
||||||
|
8.1 This Agreement and all disputes, claims, actions, suits or other proceedings arising out of this agreement or relating in any way to it shall be governed by the laws of Hungary excluding its private international law provisions.
|
||||||
|
|
||||||
|
8.2 This Agreement sets out the entire agreement between You and Us for Your Contributions to Us and overrides all other agreements or understandings.
|
||||||
|
|
||||||
|
8.3 In case of Your death, this agreement shall continue with Your heirs. In case of more than one heir, all heirs must exercise their rights through a commonly authorized person.
|
||||||
|
|
||||||
|
8.4 If any provision of this Agreement is found void and unenforceable, such provision will be replaced to the extent possible with a provision that comes closest to the meaning of the original provision and that is enforceable. The terms and conditions set forth in this Agreement shall apply notwithstanding any failure of essential purpose of this Agreement or any limited remedy to the maximum extent possible under law.
|
||||||
|
|
||||||
|
8.5 You agree to notify Us of any facts or circumstances of which you become aware that would make this Agreement inaccurate in any respect.
|
||||||
|
|
||||||
|
## 9. Signatures
|
||||||
|
|
||||||
|
I have read this Agreement, and fully agree to it by signing it with my GitHub username:
|
||||||
|
|
||||||
|
- @eltang
|
||||||
|
- @kareltucek
|
||||||
|
- @Lauszus
|
||||||
|
- @mondalaci
|
||||||
|
- @santiagogf89
|
||||||
|
- @tastyger
|
||||||
|
- @xdever
|
||||||
|
- @stephengroat
|
||||||
|
- @ert78gb
|
||||||
58
keycluster/Makefile
Normal file
58
keycluster/Makefile
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
# Copyright (C) 2018 Kristian Lauszus. All rights reserved.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# Contact information
|
||||||
|
# -------------------
|
||||||
|
# Kristian Lauszus
|
||||||
|
# Web : http://www.lauszus.com
|
||||||
|
# e-mail : lauszus@gmail.com
|
||||||
|
|
||||||
|
# Set project name.
|
||||||
|
PROJECT_NAME = uhk_keycluster
|
||||||
|
|
||||||
|
# Defines the part type that this project uses.
|
||||||
|
PART = MKL03Z32VFK4
|
||||||
|
|
||||||
|
# Defines the linker script to use for the application.
|
||||||
|
LDSCRIPT = ../lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/gcc/MKL03Z32xxx4_flash.ld
|
||||||
|
|
||||||
|
# Size of the heap and stack.
|
||||||
|
HEAP_SIZE = 0
|
||||||
|
STACK_SIZE = 0x0050
|
||||||
|
|
||||||
|
# Set the compiler CPU and FPU options.
|
||||||
|
CPU = -mcpu=cortex-m0plus
|
||||||
|
FPU = -mfloat-abi=soft
|
||||||
|
|
||||||
|
# Command for flashing the key cluster module.
|
||||||
|
FLASH_CMD = node ../lib/agent/packages/usb/update-module-firmware.js leftModule $(PROJECT_OBJ:.axf=.bin)
|
||||||
|
|
||||||
|
# Path to the JLink script used for the key cluster module.
|
||||||
|
JLINK_SCRIPT = ../scripts/flash-keycluster.jlink
|
||||||
|
|
||||||
|
# Source files.
|
||||||
|
SOURCE = $(wildcard src/*.c) \
|
||||||
|
../lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/system_MKL03Z4.c \
|
||||||
|
../lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/gcc/startup_MKL03Z4.S \
|
||||||
|
../lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/drivers/fsl_clock.c \
|
||||||
|
../lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/drivers/fsl_gpio.c \
|
||||||
|
../lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/drivers/fsl_i2c.c \
|
||||||
|
../lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/drivers/fsl_lptmr.c \
|
||||||
|
../lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/drivers/fsl_spi.c \
|
||||||
|
../lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/drivers/fsl_tpm.c \
|
||||||
|
$(wildcard ../shared/*.c) \
|
||||||
|
$(wildcard ../shared/slave/*.c)
|
||||||
|
|
||||||
|
# Header files.
|
||||||
|
IPATH = src \
|
||||||
|
../lib/KSDK_2.0_MKL03Z8xxx4/CMSIS/Include \
|
||||||
|
../lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4 \
|
||||||
|
../lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/drivers \
|
||||||
|
../shared
|
||||||
|
|
||||||
|
# Include main Makefile.
|
||||||
|
include ../scripts/Makedefs.mk
|
||||||
3
keycluster/README.md
Normal file
3
keycluster/README.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Key cluster module firmware
|
||||||
|
|
||||||
|
This directory contains the firmware of the key cluster module.
|
||||||
350
keycluster/build/.cproject
Normal file
350
keycluster/build/.cproject
Normal file
@@ -0,0 +1,350 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||||
|
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||||
|
<cconfiguration id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1792027861">
|
||||||
|
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1792027861" moduleId="org.eclipse.cdt.core.settings" name="uhk60-keycluster_debug">
|
||||||
|
<externalSettings/>
|
||||||
|
<extensions>
|
||||||
|
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||||
|
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
</extensions>
|
||||||
|
</storageModule>
|
||||||
|
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||||
|
<configuration artifactExtension="elf" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="${cross_rm} -rf" description="" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1792027861" name="uhk60-keycluster_debug" parent="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug">
|
||||||
|
<folderInfo id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1792027861." name="/" resourcePath="">
|
||||||
|
<toolChain id="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.debug.439601044" name="Cross ARM GCC" superClass="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.debug">
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.780228407" name="Optimization Level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level" value="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.most" valueType="enumerated"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.messagelength.1547417078" name="Message length (-fmessage-length=0)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.messagelength" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.signedchar.765602671" name="'char' is signed (-fsigned-char)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.signedchar" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.functionsections.910567930" name="Function sections (-ffunction-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.functionsections" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.datasections.243581182" name="Data sections (-fdata-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.datasections" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.allwarn.416266830" name="Enable all common warnings (-Wall)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.allwarn" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level.1613409592" name="Debug level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level" value="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level.default" valueType="enumerated"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.format.556186202" name="Debug format" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.format" value="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.format.default" valueType="enumerated"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.name.873832382" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.name" value="Custom" valueType="string"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.architecture.1923839154" name="Architecture" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.architecture" value="ilg.gnuarmeclipse.managedbuild.cross.option.architecture.arm" valueType="enumerated"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.family.292907889" name="ARM family" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.family" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.mcpu.cortex-m0plus" valueType="enumerated"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.instructionset.1510156849" name="Instruction set" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.instructionset" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.instructionset.thumb" valueType="enumerated"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.prefix.1110645397" name="Prefix" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.prefix" value="arm-none-eabi-" valueType="string"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.c.1996567256" name="C compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.c" value="gcc" valueType="string"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.cpp.2014665560" name="C++ compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.cpp" value="g++" valueType="string"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.objcopy.867581768" name="Hex/Bin converter" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.objcopy" value="objcopy" valueType="string"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.objdump.315789427" name="Listing generator" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.objdump" value="objdump" valueType="string"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.size.348642956" name="Size command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.size" value="size" valueType="string"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.make.670689833" name="Build command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.make" value="make" valueType="string"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.rm.654501139" name="Remove command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.rm" value="rm" valueType="string"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash.967248865" name="Create flash image" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize.1390211406" name="Print size" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.useglobalpath.228343129" name="Use global path" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.useglobalpath" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.unit.1173170148" name="FPU Type" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.unit" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.unit.default" valueType="enumerated"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.abi.1949324826" name="Float ABI" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.abi" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.abi.soft" valueType="enumerated"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.ar.1370140886" name="Archiver" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.ar" value="ar" valueType="string"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.nocommon.9959419695" name="No common unitialized (-fno-common)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.nocommon" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.freestanding.2882966171" name="Assume freestanding environment (-ffreestanding)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.freestanding" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.nobuiltin.9288453635" name="Disable builtin (-fno-builtin)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.nobuiltin" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.lto.2986114257" name="Link-time optimizer (-flto)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.lto" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.nowarn.7864424720" name="Inhibit all warnings (-w)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.nowarn" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.extrawarn.6408004182" name="Enable extra warnings (-Wextra)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.extrawarn" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.conversion.8753144693" name="Warn on implicit conversions (-Wconversion)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.conversion" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.pointerarith.7561379406" name="Warn if pointer arithmetic (-Wpointer-arith)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.pointerarith" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.shadow.5875269774" name="Warn if shadowed variable (-Wshadow)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.shadow" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.logicalop.8232620757" name="Warn if suspicious logical ops (-Wlogical-op)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.logicalop" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.agreggatereturn.5398426966" name="Warn if struct is returned (-Wagreggate-return)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.agreggatereturn" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.floatequal.4503086702" name="Warn if floats are compared as equal (-Wfloat-equal)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.floatequal" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.toerrors.4431038008" name="Generate errors instead of warnings (-Werror)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.toerrors" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.unitialized.8290768044" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.unitialized" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.missingdeclaration.378454944" name="Warn on undeclared global function (-Wmissing-declaration)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.missingdeclaration" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.badfunctioncast.2943267007" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.badfunctioncast" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createlisting.9995899345" name="Create extended listing" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createlisting" value="false" valueType="boolean"/>
|
||||||
|
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform.1777290613" isAbstract="false" osList="all" superClass="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform"/>
|
||||||
|
<builder buildPath="${workspace_loc:/uhk-keycluster}/../" id="ilg.gnuarmeclipse.managedbuild.cross.builder.1406291427" incrementalBuildTarget="all DEBUG=1" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" stopOnErr="false" superClass="ilg.gnuarmeclipse.managedbuild.cross.builder"/>
|
||||||
|
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.2007968129" name="Cross ARM GNU Assembler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler">
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor.1246588554" name="Use preprocessor" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.include.paths.2122094274" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.include.paths"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.defs.1822362302" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.defs" valueType="definedSymbols">
|
||||||
|
<listOptionValue builtIn="false" value="DEBUG"/>
|
||||||
|
<listOptionValue builtIn="false" value="__STARTUP_CLEAR_BSS"/>
|
||||||
|
</option>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.nostdinc.8788969731" name="Do not search system directories (-nostdinc)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.nostdinc" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.other.1923601167" name="Other assembler flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.other" value=" -mapcs " valueType="string"/>
|
||||||
|
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input.2014783385" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.1397207158" name="Cross ARM C Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler">
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths.336878990" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths" useByScannerDiscovery="false" valueType="includePath">
|
||||||
|
<listOptionValue builtIn="false" value="../../../lib/KSDK_2.0_MKL03Z8xxx4/CMSIS/Include"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../../lib/KSDK_2.0_MKL03Z8xxx4/devices"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../../lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/drivers"/>
|
||||||
|
<listOptionValue builtIn="false" value=".."/>
|
||||||
|
<listOptionValue builtIn="false" value="../../../lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/utilities"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../.."/>
|
||||||
|
<listOptionValue builtIn="false" value="../../../lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../../shared"/>
|
||||||
|
</option>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.std.933718024" name="Language standard" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.std" useByScannerDiscovery="true" value="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.std.gnu99" valueType="enumerated"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs.7934865376" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||||
|
<listOptionValue builtIn="false" value="DEBUG"/>
|
||||||
|
<listOptionValue builtIn="false" value="CPU_MKL03Z32VFK4"/>
|
||||||
|
<listOptionValue builtIn="false" value="PRINTF_FLOAT_ENABLE=0"/>
|
||||||
|
<listOptionValue builtIn="false" value="SCANF_FLOAT_ENABLE=0"/>
|
||||||
|
<listOptionValue builtIn="false" value="PRINTF_ADVANCED_ENABLE=0"/>
|
||||||
|
<listOptionValue builtIn="false" value="SCANF_ADVANCED_ENABLE=0"/>
|
||||||
|
<listOptionValue builtIn="false" value="FRDM_KL03Z"/>
|
||||||
|
<listOptionValue builtIn="false" value="FREEDOM"/>
|
||||||
|
</option>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.nostdinc.1704317783" name="Do not search system directories (-nostdinc)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.nostdinc" useByScannerDiscovery="true" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.other.1560348183" name="Other compiler flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.other" useByScannerDiscovery="true" value=" -mapcs " valueType="string"/>
|
||||||
|
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.1895544709" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.435207489" name="Cross ARM C++ Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler">
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.defs.2050754817" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.defs" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||||
|
<listOptionValue builtIn="false" value="UHK_PCB_MAJOR_VERSION=7"/>
|
||||||
|
</option>
|
||||||
|
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.1699166727" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker.1681324840" name="Cross ARM C Linker" outputPrefix="" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker">
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.gcsections.1850945755" name="Remove unused sections (-Xlinker --gc-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.gcsections" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.usenewlibnano.1816597929" name="Use newlib-nano (--specs=nano.specs)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.usenewlibnano" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.scriptfile.1573832003" name="Script files (-T)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.scriptfile"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.libs.2061142742" name="Libraries (-l)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.libs"/>
|
||||||
|
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker.input.1168552163" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker.input">
|
||||||
|
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||||
|
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||||
|
</inputType>
|
||||||
|
</tool>
|
||||||
|
<tool commandLinePattern="${COMMAND} ${cross_toolchain_flags} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} -Xlinker --start-group ${INPUTS} -Xlinker --end-group" id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker.1475612095" name="Cross ARM C++ Linker" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker">
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.gcsections.42905068" name="Remove unused sections (-Xlinker --gc-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.gcsections" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.usenewlibnano.1816597929" name="Use newlib-nano (--specs=nano.specs)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.usenewlibnano" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.otherobjs.6905766738" name="Other objects" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.otherobjs"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.scriptfile.4021849263" name="Script files (-T)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.scriptfile" valueType="stringList">
|
||||||
|
<listOptionValue builtIn="false" value="../../../lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/gcc/MKL03Z32xxx4_flash.ld"/>
|
||||||
|
</option>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.nostart.6846138787" name="Do not use standard start files (-nostartfiles)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.nostart" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.nodeflibs.8043932112" name="Do not use default libraries (-nodefaultlibs)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.nodeflibs" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.libs.2257416827" name="Libraries (-l)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.libs" valueType="libs">
|
||||||
|
<listOptionValue builtIn="false" value="m"/>
|
||||||
|
<listOptionValue builtIn="false" value="g"/>
|
||||||
|
<listOptionValue builtIn="false" value="gcc"/>
|
||||||
|
<listOptionValue builtIn="false" value="nosys"/>
|
||||||
|
</option>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.cref.6563555683" name="Cross reference (-Xlinker --cref)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.cref" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.printgcsections.8052175158" name="Print removed sections (-Xlinker --print-gc-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.printgcsections" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.strip.4023108413" name="Omit all symbol information (-s)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.strip" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.other.255052480" name="Other linker flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.other" value="-mapcs -Xlinker -static -Xlinker -z -Xlinker muldefs -Xlinker -defsym=__heap_size__=0" valueType="string"/>
|
||||||
|
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker.input.658447495" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker.input">
|
||||||
|
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||||
|
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||||
|
</inputType>
|
||||||
|
</tool>
|
||||||
|
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.archiver.717958418" name="Cross ARM GNU Archiver" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.archiver"/>
|
||||||
|
<tool command="${cross_prefix}${cross_objcopy}${cross_suffix}" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT}" id="ilg.gnuarmeclipse.managedbuild.cross.tool.createflash.1498748442" name="Cross ARM GNU Create Flash Image" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.createflash">
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createflash.choice.396105459" name="Output file format (-O)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createflash.choice" value="ilg.gnuarmeclipse.managedbuild.cross.option.createflash.choice.binary" valueType="enumerated"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.createlisting.1921141825" name="Cross ARM GNU Create Listing" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.createlisting">
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.source.1147761851" name="Display source (--source|-S)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.source" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.allheaders.326654770" name="Display all headers (--all-headers|-x)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.allheaders" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.demangle.2012585764" name="Demangle names (--demangle|-C)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.demangle" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.linenumbers.1639985926" name="Display line numbers (--line-numbers|-l)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.linenumbers" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.wide.795915960" name="Wide lines (--wide|-w)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.wide" value="true" valueType="boolean"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.printsize.204256629" name="Cross ARM GNU Print Size" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.printsize">
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.printsize.format.48990078" name="Size format" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.printsize.format"/>
|
||||||
|
</tool>
|
||||||
|
</toolChain>
|
||||||
|
</folderInfo>
|
||||||
|
<fileInfo id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1792027861.1146590441" name="fsl_clock.h" rcbsApplicability="disable" resourcePath="drivers/fsl_clock.h" toolsToInvoke=""/>
|
||||||
|
</configuration>
|
||||||
|
</storageModule>
|
||||||
|
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||||
|
<storageModule moduleId="ilg.gnuarmeclipse.managedbuild.packs"/>
|
||||||
|
</cconfiguration>
|
||||||
|
<cconfiguration id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1939339834.1792647078">
|
||||||
|
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1939339834.1792647078" moduleId="org.eclipse.cdt.core.settings" name="uhk60-keycluster_release">
|
||||||
|
<externalSettings/>
|
||||||
|
<extensions>
|
||||||
|
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||||
|
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
</extensions>
|
||||||
|
</storageModule>
|
||||||
|
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||||
|
<configuration artifactExtension="elf" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" cleanCommand="${cross_rm} -rf" description="" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1939339834.1792647078" name="uhk60-keycluster_release" parent="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release">
|
||||||
|
<folderInfo id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1939339834.1792647078." name="/" resourcePath="">
|
||||||
|
<toolChain id="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.release.1802192936" name="Cross ARM GCC" superClass="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.release">
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.918206081" name="Optimization Level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level" value="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.size" valueType="enumerated"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.messagelength.1247972134" name="Message length (-fmessage-length=0)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.messagelength" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.signedchar.1651670889" name="'char' is signed (-fsigned-char)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.signedchar" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.functionsections.1807399992" name="Function sections (-ffunction-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.functionsections" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.datasections.1522408084" name="Data sections (-fdata-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.datasections" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.allwarn.881879429" name="Enable all common warnings (-Wall)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.allwarn" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level.417088354" name="Debug level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level" value="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level.none" valueType="enumerated"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.format.471396471" name="Debug format" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.format" value="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.format.default" valueType="enumerated"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.name.378484607" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.name" value="Custom" valueType="string"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.architecture.1093394082" name="Architecture" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.architecture" value="ilg.gnuarmeclipse.managedbuild.cross.option.architecture.arm" valueType="enumerated"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.family.1818095636" name="ARM family" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.family" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.mcpu.cortex-m0plus" valueType="enumerated"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.instructionset.336711378" name="Instruction set" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.instructionset" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.instructionset.thumb" valueType="enumerated"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.prefix.1351526286" name="Prefix" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.prefix" value="arm-none-eabi-" valueType="string"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.c.1438555896" name="C compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.c" value="gcc" valueType="string"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.cpp.1588534593" name="C++ compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.cpp" value="g++" valueType="string"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.objcopy.1663641144" name="Hex/Bin converter" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.objcopy" value="objcopy" valueType="string"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.objdump.200920623" name="Listing generator" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.objdump" value="objdump" valueType="string"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.size.362080964" name="Size command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.size" value="size" valueType="string"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.make.2009924231" name="Build command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.make" value="make" valueType="string"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.rm.1536468905" name="Remove command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.rm" value="rm" valueType="string"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash.925865305" name="Create flash image" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize.1208668505" name="Print size" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.useglobalpath.1166058417" name="Use global path" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.useglobalpath" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.ar.1139561820" name="Archiver" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.ar" value="ar" valueType="string"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.abi.671070963" name="Float ABI" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.abi" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.abi.soft" valueType="enumerated"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.nocommon.1275482104" name="No common unitialized (-fno-common)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.nocommon" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.freestanding.407638415" name="Assume freestanding environment (-ffreestanding)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.freestanding" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.nobuiltin.1259530104" name="Disable builtin (-fno-builtin)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.nobuiltin" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.lto.809059548" name="Link-time optimizer (-flto)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.lto" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.nowarn.1208094284" name="Inhibit all warnings (-w)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.nowarn" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.extrawarn.67984531" name="Enable extra warnings (-Wextra)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.extrawarn" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.conversion.593444999" name="Warn on implicit conversions (-Wconversion)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.conversion" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.pointerarith.813635782" name="Warn if pointer arithmetic (-Wpointer-arith)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.pointerarith" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.shadow.1455227593" name="Warn if shadowed variable (-Wshadow)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.shadow" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.logicalop.1717005013" name="Warn if suspicious logical ops (-Wlogical-op)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.logicalop" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.agreggatereturn.383697767" name="Warn if struct is returned (-Wagreggate-return)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.agreggatereturn" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.floatequal.628316174" name="Warn if floats are compared as equal (-Wfloat-equal)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.floatequal" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.toerrors.1624700406" name="Generate errors instead of warnings (-Werror)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.toerrors" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.unitialized.3064955983.625210850" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.unitialized" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.missingdeclaration.907753672" name="Warn on undeclared global function (-Wmissing-declaration)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.missingdeclaration" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.badfunctioncast.6545741443.1540890614" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.badfunctioncast" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createlisting.1382191896" name="Create extended listing" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createlisting" value="false" valueType="boolean"/>
|
||||||
|
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform.2107171855" isAbstract="false" osList="all" superClass="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform"/>
|
||||||
|
<builder buildPath="${workspace_loc:/uhk-keycluster}/../" id="ilg.gnuarmeclipse.managedbuild.cross.builder.1689719605" incrementalBuildTarget="all DEBUG=0" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" stopOnErr="false" superClass="ilg.gnuarmeclipse.managedbuild.cross.builder"/>
|
||||||
|
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.1477971290" name="Cross ARM GNU Assembler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler">
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor.334227408" name="Use preprocessor" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.include.paths.1702866230" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.include.paths"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.defs.1072633432" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.defs" valueType="definedSymbols">
|
||||||
|
<listOptionValue builtIn="false" value="__STARTUP_CLEAR_BSS"/>
|
||||||
|
</option>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.nostdinc.415052570" name="Do not search system directories (-nostdinc)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.nostdinc" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.other.1359123195" name="Other assembler flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.other" value=" -mapcs " valueType="string"/>
|
||||||
|
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input.1499693341" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.1046326518" name="Cross ARM C Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler">
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths.746372967" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths" useByScannerDiscovery="false" valueType="includePath">
|
||||||
|
<listOptionValue builtIn="false" value="../../../lib/KSDK_2.0_MKL03Z8xxx4/CMSIS/Include"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../../lib/KSDK_2.0_MKL03Z8xxx4/devices"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../../lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/drivers"/>
|
||||||
|
<listOptionValue builtIn="false" value=".."/>
|
||||||
|
<listOptionValue builtIn="false" value="../../../lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/utilities"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../.."/>
|
||||||
|
<listOptionValue builtIn="false" value="../../../lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../../shared"/>
|
||||||
|
</option>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.std.1703504273" name="Language standard" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.std" useByScannerDiscovery="true" value="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.std.gnu99" valueType="enumerated"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs.220715196" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||||
|
<listOptionValue builtIn="false" value="NDEBUG"/>
|
||||||
|
<listOptionValue builtIn="false" value="CPU_MKL03Z32VFK4"/>
|
||||||
|
<listOptionValue builtIn="false" value="PRINTF_FLOAT_ENABLE=0"/>
|
||||||
|
<listOptionValue builtIn="false" value="SCANF_FLOAT_ENABLE=0"/>
|
||||||
|
<listOptionValue builtIn="false" value="PRINTF_ADVANCED_ENABLE=0"/>
|
||||||
|
<listOptionValue builtIn="false" value="SCANF_ADVANCED_ENABLE=0"/>
|
||||||
|
<listOptionValue builtIn="false" value="FRDM_KL03Z"/>
|
||||||
|
<listOptionValue builtIn="false" value="FREEDOMx"/>
|
||||||
|
</option>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.nostdinc.1784976960" name="Do not search system directories (-nostdinc)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.nostdinc" useByScannerDiscovery="true" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.other.182809566" name="Other compiler flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.other" useByScannerDiscovery="true" value=" -mapcs " valueType="string"/>
|
||||||
|
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.2141870622" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.1055651769" name="Cross ARM C++ Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler">
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.defs.1344565144" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.defs" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||||
|
<listOptionValue builtIn="false" value="UHK_PCB_MAJOR_VERSION=7"/>
|
||||||
|
</option>
|
||||||
|
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.1785701410" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker.1248876094" name="Cross ARM C Linker" outputPrefix="" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker">
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.gcsections.205211813" name="Remove unused sections (-Xlinker --gc-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.gcsections" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.usenewlibnano.764117584" name="Use newlib-nano (--specs=nano.specs)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.usenewlibnano" value="true" valueType="boolean"/>
|
||||||
|
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker.input.424272008" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker.input">
|
||||||
|
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||||
|
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||||
|
</inputType>
|
||||||
|
</tool>
|
||||||
|
<tool commandLinePattern="${COMMAND} ${cross_toolchain_flags} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} -Xlinker --start-group ${INPUTS} -Xlinker --end-group" id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker.20615499" name="Cross ARM C++ Linker" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker">
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.gcsections.1664132146" name="Remove unused sections (-Xlinker --gc-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.gcsections" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.usenewlibnano.1704968656" name="Use newlib-nano (--specs=nano.specs)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.usenewlibnano" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.otherobjs.359701763" name="Other objects" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.otherobjs"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.scriptfile.51816293" name="Script files (-T)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.scriptfile" valueType="stringList">
|
||||||
|
<listOptionValue builtIn="false" value="../../../lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/gcc/MKL03Z32xxx4_flash.ld"/>
|
||||||
|
</option>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.nostart.554768103" name="Do not use standard start files (-nostartfiles)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.nostart" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.nodeflibs.1987989417" name="Do not use default libraries (-nodefaultlibs)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.nodeflibs" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.libs.1653206096" name="Libraries (-l)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.libs" valueType="libs">
|
||||||
|
<listOptionValue builtIn="false" value="m"/>
|
||||||
|
<listOptionValue builtIn="false" value="g"/>
|
||||||
|
<listOptionValue builtIn="false" value="gcc"/>
|
||||||
|
<listOptionValue builtIn="false" value="nosys"/>
|
||||||
|
</option>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.cref.1514842438" name="Cross reference (-Xlinker --cref)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.cref" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.printgcsections.1127263805" name="Print removed sections (-Xlinker --print-gc-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.printgcsections" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.strip.549891305" name="Omit all symbol information (-s)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.strip" value="false" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.other.1551896832" name="Other linker flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.other" value="-mapcs -Xlinker -static -Xlinker -z -Xlinker muldefs" valueType="string"/>
|
||||||
|
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker.input.772761405" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker.input">
|
||||||
|
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||||
|
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||||
|
</inputType>
|
||||||
|
</tool>
|
||||||
|
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.archiver.1579053840" name="Cross ARM GNU Archiver" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.archiver"/>
|
||||||
|
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.createflash.1400319152" name="Cross ARM GNU Create Flash Image" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.createflash">
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createflash.choice.1328839591" name="Output file format (-O)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createflash.choice" value="ilg.gnuarmeclipse.managedbuild.cross.option.createflash.choice.binary" valueType="enumerated"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.createlisting.733953661" name="Cross ARM GNU Create Listing" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.createlisting">
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.source.1802395103" name="Display source (--source|-S)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.source" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.allheaders.1353511477" name="Display all headers (--all-headers|-x)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.allheaders" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.demangle.562396163" name="Demangle names (--demangle|-C)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.demangle" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.linenumbers.1889527374" name="Display line numbers (--line-numbers|-l)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.linenumbers" value="true" valueType="boolean"/>
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.wide.2076712477" name="Wide lines (--wide|-w)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.wide" value="true" valueType="boolean"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.printsize.843351449" name="Cross ARM GNU Print Size" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.printsize">
|
||||||
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.printsize.format.1881713953" name="Size format" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.printsize.format"/>
|
||||||
|
</tool>
|
||||||
|
</toolChain>
|
||||||
|
</folderInfo>
|
||||||
|
</configuration>
|
||||||
|
</storageModule>
|
||||||
|
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||||
|
<storageModule moduleId="ilg.gnuarmeclipse.managedbuild.packs"/>
|
||||||
|
</cconfiguration>
|
||||||
|
</storageModule>
|
||||||
|
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||||
|
<project id="k64f.ilg.gnuarmeclipse.managedbuild.cross.target.elf.1537007018" name="Executable" projectType="ilg.gnuarmeclipse.managedbuild.cross.target.elf"/>
|
||||||
|
</storageModule>
|
||||||
|
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders">
|
||||||
|
</storageModule>
|
||||||
|
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
|
||||||
|
<storageModule moduleId="scannerConfiguration">
|
||||||
|
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||||
|
<scannerConfigBuildInfo instanceId="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1792027861;ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1792027861.;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.435207489;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.1699166727">
|
||||||
|
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||||
|
</scannerConfigBuildInfo>
|
||||||
|
<scannerConfigBuildInfo instanceId="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1939339834;ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1939339834.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.955273220;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.1711058916">
|
||||||
|
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||||
|
</scannerConfigBuildInfo>
|
||||||
|
<scannerConfigBuildInfo instanceId="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1939339834;ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1939339834.;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.270191615;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.1469754472">
|
||||||
|
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||||
|
</scannerConfigBuildInfo>
|
||||||
|
<scannerConfigBuildInfo instanceId="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1792027861;ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1792027861.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.1397207158;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.1895544709">
|
||||||
|
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||||
|
</scannerConfigBuildInfo>
|
||||||
|
</storageModule>
|
||||||
|
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
|
||||||
|
<storageModule moduleId="refreshScope" versionNumber="2">
|
||||||
|
<configuration configurationName="uhk60-keycluster_release">
|
||||||
|
<resource resourceType="PROJECT" workspacePath="/uhk-keycluster"/>
|
||||||
|
</configuration>
|
||||||
|
<configuration configurationName="uhk60-keycluster_debug">
|
||||||
|
<resource resourceType="PROJECT" workspacePath="/uhk-keycluster"/>
|
||||||
|
</configuration>
|
||||||
|
</storageModule>
|
||||||
|
</cproject>
|
||||||
4
keycluster/build/.gitignore
vendored
Normal file
4
keycluster/build/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
/.settings/
|
||||||
|
/uhk60-keycluster_debug/
|
||||||
|
/uhk60-keycluster_release/
|
||||||
|
/uhk60-keycluster_release/
|
||||||
155
keycluster/build/.project
Normal file
155
keycluster/build/.project
Normal file
@@ -0,0 +1,155 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>uhk-keycluster</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>com.freescale.processorexpert.core.expertprojectbuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||||
|
<triggers>clean,full,incremental,</triggers>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
||||||
|
<triggers>full,incremental,</triggers>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>com.freescale.processorexpert.core.expertprojectnature</nature>
|
||||||
|
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||||
|
<nature>org.eclipse.cdt.core.ccnature</nature>
|
||||||
|
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||||
|
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||||
|
</natures>
|
||||||
|
<linkedResources>
|
||||||
|
<link>
|
||||||
|
<name>Makedefs.mk</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-2-PROJECT_LOC/scripts/Makedefs.mk</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Makefile</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Makefile</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>drivers</name>
|
||||||
|
<type>2</type>
|
||||||
|
<locationURI>virtual:/virtual</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>shared</name>
|
||||||
|
<type>2</type>
|
||||||
|
<locationURI>PARENT-2-PROJECT_LOC/shared</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>src</name>
|
||||||
|
<type>2</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/src</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>startup</name>
|
||||||
|
<type>2</type>
|
||||||
|
<locationURI>virtual:/virtual</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>drivers/fsl_clock.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-2-PROJECT_LOC/lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/drivers/fsl_clock.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>drivers/fsl_clock.h</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-2-PROJECT_LOC/lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/drivers/fsl_clock.h</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>drivers/fsl_gpio.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-2-PROJECT_LOC/lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/drivers/fsl_gpio.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>drivers/fsl_gpio.h</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-2-PROJECT_LOC/lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/drivers/fsl_gpio.h</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>drivers/fsl_i2c.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-2-PROJECT_LOC/lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/drivers/fsl_i2c.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>drivers/fsl_i2c.h</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-2-PROJECT_LOC/lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/drivers/fsl_i2c.h</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>drivers/fsl_lptmr.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-2-PROJECT_LOC/lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/drivers/fsl_lptmr.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>drivers/fsl_lptmr.h</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-2-PROJECT_LOC/lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/drivers/fsl_lptmr.h</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>drivers/fsl_port.h</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-2-PROJECT_LOC/lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/drivers/fsl_port.h</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>drivers/fsl_smc.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-2-PROJECT_LOC/lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/drivers/fsl_smc.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>drivers/fsl_smc.h</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-2-PROJECT_LOC/lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/drivers/fsl_smc.h</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>drivers/fsl_spi.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-2-PROJECT_LOC/lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/drivers/fsl_spi.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>drivers/fsl_spi.h</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-2-PROJECT_LOC/lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/drivers/fsl_spi.h</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>drivers/fsl_tpm.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-2-PROJECT_LOC/lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/drivers/fsl_tpm.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>drivers/fsl_tpm.h</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-2-PROJECT_LOC/lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/drivers/fsl_tpm.h</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>startup/startup_MKL03Z4.S</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-2-PROJECT_LOC/lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/gcc/startup_MKL03Z4.S</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>startup/system_MKL03Z4.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-2-PROJECT_LOC/lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/system_MKL03Z4.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>startup/system_MKL03Z4.h</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-2-PROJECT_LOC/lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/system_MKL03Z4.h</locationURI>
|
||||||
|
</link>
|
||||||
|
</linkedResources>
|
||||||
|
</projectDescription>
|
||||||
82
keycluster/build/uhk60-keycluster_debug_jlink.launch
Normal file
82
keycluster/build/uhk60-keycluster_debug_jlink.launch
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<launchConfiguration type="ilg.gnuarmeclipse.debug.gdbjtag.jlink.launchConfigurationType">
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.doConnectToRunning" value="false"/>
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.doContinue" value="true"/>
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.doDebugInRam" value="false"/>
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.doFirstReset" value="true"/>
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.doGdbServerAllocateConsole" value="true"/>
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.doGdbServerAllocateSemihostingConsole" value="true"/>
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.doGdbServerInitRegs" value="true"/>
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.doGdbServerLocalOnly" value="true"/>
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.doGdbServerSilent" value="false"/>
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.doGdbServerVerifyDownload" value="true"/>
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.doSecondReset" value="true"/>
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.doStartGdbServer" value="true"/>
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.enableFlashBreakpoints" value="true"/>
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.enableSemihosting" value="true"/>
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.enableSemihostingIoclientGdbClient" value="true"/>
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.enableSemihostingIoclientTelnet" value="true"/>
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.enableSwo" value="false"/>
|
||||||
|
<intAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.firstResetSpeed" value="30"/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.firstResetType" value=""/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbClientOtherCommands" value="set mem inaccessible-by-default off"/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbClientOtherOptions" value=""/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbServerConnection" value="usb"/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbServerConnectionAddress" value=""/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbServerDebugInterface" value="swd"/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbServerDeviceEndianness" value="little"/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbServerDeviceName" value="MKL03Z32xxx4"/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbServerDeviceSpeed" value="30"/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbServerExecutable" value="${jlink_path}/${jlink_gdbserver}"/>
|
||||||
|
<intAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbServerGdbPortNumber" value="2331"/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbServerLog" value=""/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbServerOther" value="-s"/>
|
||||||
|
<intAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbServerSwoPortNumber" value="2332"/>
|
||||||
|
<intAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbServerTelnetPortNumber" value="2333"/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.interfaceSpeed" value="auto"/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.otherInitCommands" value=""/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.otherRunCommands" value=""/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.secondResetType" value=""/>
|
||||||
|
<intAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.swoEnableTargetCpuFreq" value="0"/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.swoEnableTargetPortMask" value="0x1"/>
|
||||||
|
<intAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.swoEnableTargetSwoFreq" value="0"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value=""/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.ipAddress" value="localhost"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDevice" value="GNU ARM J-Link"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="true"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="true"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value=""/>
|
||||||
|
<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="2331"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="false"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="true"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="main"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsFileName" value=""/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsOffset" value=""/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForImage" value="false"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForSymbols" value="false"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForImage" value="true"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForSymbols" value="true"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useRemoteTarget" value="true"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.mi.core.commandFactory" value="Standard (Windows)"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.mi.core.protocol" value="mi"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.mi.core.verboseMode" value="false"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="${cross_prefix}gdb${cross_suffix}"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
|
||||||
|
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="uhk60-keycluster_debug/uhk-keycluster.elf"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="uhk-keycluster"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1792027861"/>
|
||||||
|
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||||
|
<listEntry value="/uhk-keycluster"/>
|
||||||
|
</listAttribute>
|
||||||
|
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||||
|
<listEntry value="4"/>
|
||||||
|
</listAttribute>
|
||||||
|
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList context="Context string"/> "/>
|
||||||
|
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
|
||||||
|
</launchConfiguration>
|
||||||
7
keycluster/build/uhk60-keycluster_debug_kboot.launch
Normal file
7
keycluster/build/uhk60-keycluster_debug_kboot.launch
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType">
|
||||||
|
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${none}"/>
|
||||||
|
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="/usr/bin/make"/>
|
||||||
|
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-j8 DEBUG=1 flash"/>
|
||||||
|
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/uhk-keycluster}/../"/>
|
||||||
|
</launchConfiguration>
|
||||||
82
keycluster/build/uhk60-keycluster_release_jlink.launch
Normal file
82
keycluster/build/uhk60-keycluster_release_jlink.launch
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<launchConfiguration type="ilg.gnuarmeclipse.debug.gdbjtag.jlink.launchConfigurationType">
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.doConnectToRunning" value="false"/>
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.doContinue" value="true"/>
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.doDebugInRam" value="false"/>
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.doFirstReset" value="true"/>
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.doGdbServerAllocateConsole" value="true"/>
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.doGdbServerAllocateSemihostingConsole" value="true"/>
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.doGdbServerInitRegs" value="true"/>
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.doGdbServerLocalOnly" value="true"/>
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.doGdbServerSilent" value="false"/>
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.doGdbServerVerifyDownload" value="true"/>
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.doSecondReset" value="true"/>
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.doStartGdbServer" value="true"/>
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.enableFlashBreakpoints" value="true"/>
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.enableSemihosting" value="true"/>
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.enableSemihostingIoclientGdbClient" value="false"/>
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.enableSemihostingIoclientTelnet" value="false"/>
|
||||||
|
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.enableSwo" value="true"/>
|
||||||
|
<intAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.firstResetSpeed" value="30"/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.firstResetType" value=""/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbClientOtherCommands" value="set mem inaccessible-by-default off"/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbClientOtherOptions" value=""/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbServerConnection" value="usb"/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbServerConnectionAddress" value=""/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbServerDebugInterface" value="swd"/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbServerDeviceEndianness" value="little"/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbServerDeviceName" value="MKL03Z32xxx4"/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbServerDeviceSpeed" value="30"/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbServerExecutable" value="${jlink_path}/${jlink_gdbserver}"/>
|
||||||
|
<intAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbServerGdbPortNumber" value="2331"/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbServerLog" value=""/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbServerOther" value="-s"/>
|
||||||
|
<intAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbServerSwoPortNumber" value="2332"/>
|
||||||
|
<intAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.gdbServerTelnetPortNumber" value="2333"/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.interfaceSpeed" value="auto"/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.otherInitCommands" value=""/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.otherRunCommands" value=""/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.secondResetType" value=""/>
|
||||||
|
<intAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.swoEnableTargetCpuFreq" value="0"/>
|
||||||
|
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.swoEnableTargetPortMask" value="0x1"/>
|
||||||
|
<intAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.jlink.swoEnableTargetSwoFreq" value="0"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value=""/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.ipAddress" value="localhost"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDevice" value="GNU ARM J-Link"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="true"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="true"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value=""/>
|
||||||
|
<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="2331"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="false"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="true"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="main"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsFileName" value=""/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsOffset" value=""/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForImage" value="false"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForSymbols" value="false"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForImage" value="true"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForSymbols" value="true"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useRemoteTarget" value="true"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.mi.core.commandFactory" value="Standard (Windows)"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.mi.core.protocol" value="mi"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.mi.core.verboseMode" value="false"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="${cross_prefix}gdb${cross_suffix}"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
|
||||||
|
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="uhk60-keycluster_release/uhk-keycluster.elf"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="uhk-keycluster"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1939339834.1792647078"/>
|
||||||
|
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||||
|
<listEntry value="/uhk-keycluster"/>
|
||||||
|
</listAttribute>
|
||||||
|
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||||
|
<listEntry value="4"/>
|
||||||
|
</listAttribute>
|
||||||
|
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList context="Context string"/> "/>
|
||||||
|
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
|
||||||
|
</launchConfiguration>
|
||||||
7
keycluster/build/uhk60-keycluster_release_kboot.launch
Normal file
7
keycluster/build/uhk60-keycluster_release_kboot.launch
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType">
|
||||||
|
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${none}"/>
|
||||||
|
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="/usr/bin/make"/>
|
||||||
|
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-j8 DEBUG=0 flash"/>
|
||||||
|
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/uhk-keycluster}/../"/>
|
||||||
|
</launchConfiguration>
|
||||||
61
keycluster/src/blackberry_trackball.c
Normal file
61
keycluster/src/blackberry_trackball.c
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
#include "fsl_gpio.h"
|
||||||
|
#include "fsl_port.h"
|
||||||
|
#include "blackberry_trackball.h"
|
||||||
|
|
||||||
|
pointer_delta_t BlackBerryTrackball_PointerDelta;
|
||||||
|
|
||||||
|
void BlackberryTrackball_Init(void)
|
||||||
|
{
|
||||||
|
CLOCK_EnableClock(BLACKBERRY_TRACKBALL_LEFT_CLOCK);
|
||||||
|
PORT_SetPinMux(BLACKBERRY_TRACKBALL_LEFT_PORT, BLACKBERRY_TRACKBALL_LEFT_PIN, kPORT_MuxAsGpio);
|
||||||
|
PORT_SetPinInterruptConfig(BLACKBERRY_TRACKBALL_LEFT_PORT, BLACKBERRY_TRACKBALL_LEFT_PIN, kPORT_InterruptEitherEdge);
|
||||||
|
NVIC_EnableIRQ(BLACKBERRY_TRACKBALL_LEFT_IRQ);
|
||||||
|
|
||||||
|
CLOCK_EnableClock(BLACKBERRY_TRACKBALL_RIGHT_CLOCK);
|
||||||
|
PORT_SetPinMux(BLACKBERRY_TRACKBALL_RIGHT_PORT, BLACKBERRY_TRACKBALL_RIGHT_PIN, kPORT_MuxAsGpio);
|
||||||
|
PORT_SetPinInterruptConfig(BLACKBERRY_TRACKBALL_RIGHT_PORT, BLACKBERRY_TRACKBALL_RIGHT_PIN, kPORT_InterruptEitherEdge);
|
||||||
|
NVIC_EnableIRQ(BLACKBERRY_TRACKBALL_RIGHT_IRQ);
|
||||||
|
|
||||||
|
CLOCK_EnableClock(BLACKBERRY_TRACKBALL_UP_CLOCK);
|
||||||
|
PORT_SetPinMux(BLACKBERRY_TRACKBALL_UP_PORT, BLACKBERRY_TRACKBALL_UP_PIN, kPORT_MuxAsGpio);
|
||||||
|
PORT_SetPinInterruptConfig(BLACKBERRY_TRACKBALL_UP_PORT, BLACKBERRY_TRACKBALL_UP_PIN, kPORT_InterruptEitherEdge);
|
||||||
|
NVIC_EnableIRQ(BLACKBERRY_TRACKBALL_UP_IRQ);
|
||||||
|
|
||||||
|
CLOCK_EnableClock(BLACKBERRY_TRACKBALL_DOWN_CLOCK);
|
||||||
|
PORT_SetPinMux(BLACKBERRY_TRACKBALL_DOWN_PORT, BLACKBERRY_TRACKBALL_DOWN_PIN, kPORT_MuxAsGpio);
|
||||||
|
PORT_SetPinInterruptConfig(BLACKBERRY_TRACKBALL_DOWN_PORT, BLACKBERRY_TRACKBALL_DOWN_PIN, kPORT_InterruptEitherEdge);
|
||||||
|
NVIC_EnableIRQ(BLACKBERRY_TRACKBALL_DOWN_IRQ);
|
||||||
|
}
|
||||||
|
|
||||||
|
void handleTrackball(void)
|
||||||
|
{
|
||||||
|
if (PORT_GetPinsInterruptFlags(BLACKBERRY_TRACKBALL_LEFT_PORT) & (1 << BLACKBERRY_TRACKBALL_LEFT_PIN)) {
|
||||||
|
BlackBerryTrackball_PointerDelta.x++;
|
||||||
|
GPIO_ClearPinsInterruptFlags(BLACKBERRY_TRACKBALL_LEFT_GPIO, 1U << BLACKBERRY_TRACKBALL_LEFT_PIN);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (PORT_GetPinsInterruptFlags(BLACKBERRY_TRACKBALL_RIGHT_PORT) & (1 << BLACKBERRY_TRACKBALL_RIGHT_PIN)) {
|
||||||
|
BlackBerryTrackball_PointerDelta.x--;
|
||||||
|
GPIO_ClearPinsInterruptFlags(BLACKBERRY_TRACKBALL_RIGHT_GPIO, 1U << BLACKBERRY_TRACKBALL_RIGHT_PIN);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (PORT_GetPinsInterruptFlags(BLACKBERRY_TRACKBALL_UP_PORT) & (1 << BLACKBERRY_TRACKBALL_UP_PIN)) {
|
||||||
|
BlackBerryTrackball_PointerDelta.y++;
|
||||||
|
GPIO_ClearPinsInterruptFlags(BLACKBERRY_TRACKBALL_UP_GPIO, 1U << BLACKBERRY_TRACKBALL_UP_PIN);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (PORT_GetPinsInterruptFlags(BLACKBERRY_TRACKBALL_DOWN_PORT) & (1 << BLACKBERRY_TRACKBALL_DOWN_PIN)) {
|
||||||
|
BlackBerryTrackball_PointerDelta.y--;
|
||||||
|
GPIO_ClearPinsInterruptFlags(BLACKBERRY_TRACKBALL_DOWN_GPIO, 1U << BLACKBERRY_TRACKBALL_DOWN_PIN);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void BLACKBERRY_TRACKBALL_IRQ_HANDLER1(void)
|
||||||
|
{
|
||||||
|
handleTrackball();
|
||||||
|
}
|
||||||
|
|
||||||
|
void BLACKBERRY_TRACKBALL_IRQ_HANDLER2(void)
|
||||||
|
{
|
||||||
|
handleTrackball();
|
||||||
|
}
|
||||||
45
keycluster/src/blackberry_trackball.h
Normal file
45
keycluster/src/blackberry_trackball.h
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
#ifndef __BLACKBERRY_TRACKBALL_H__
|
||||||
|
#define __BLACKBERRY_TRACKBALL_H__
|
||||||
|
|
||||||
|
// Includes:
|
||||||
|
|
||||||
|
#include "slave_protocol.h"
|
||||||
|
|
||||||
|
// Macros:
|
||||||
|
|
||||||
|
#define BLACKBERRY_TRACKBALL_LEFT_PORT PORTB
|
||||||
|
#define BLACKBERRY_TRACKBALL_LEFT_GPIO GPIOB
|
||||||
|
#define BLACKBERRY_TRACKBALL_LEFT_IRQ PORTB_IRQn
|
||||||
|
#define BLACKBERRY_TRACKBALL_LEFT_CLOCK kCLOCK_PortB
|
||||||
|
#define BLACKBERRY_TRACKBALL_LEFT_PIN 0
|
||||||
|
|
||||||
|
#define BLACKBERRY_TRACKBALL_RIGHT_PORT PORTB
|
||||||
|
#define BLACKBERRY_TRACKBALL_RIGHT_GPIO GPIOB
|
||||||
|
#define BLACKBERRY_TRACKBALL_RIGHT_IRQ PORTB_IRQn
|
||||||
|
#define BLACKBERRY_TRACKBALL_RIGHT_CLOCK kCLOCK_PortB
|
||||||
|
#define BLACKBERRY_TRACKBALL_RIGHT_PIN 2
|
||||||
|
|
||||||
|
#define BLACKBERRY_TRACKBALL_UP_PORT PORTA
|
||||||
|
#define BLACKBERRY_TRACKBALL_UP_GPIO GPIOA
|
||||||
|
#define BLACKBERRY_TRACKBALL_UP_IRQ PORTA_IRQn
|
||||||
|
#define BLACKBERRY_TRACKBALL_UP_CLOCK kCLOCK_PortA
|
||||||
|
#define BLACKBERRY_TRACKBALL_UP_PIN 12
|
||||||
|
|
||||||
|
#define BLACKBERRY_TRACKBALL_DOWN_PORT PORTB
|
||||||
|
#define BLACKBERRY_TRACKBALL_DOWN_GPIO GPIOB
|
||||||
|
#define BLACKBERRY_TRACKBALL_DOWN_IRQ PORTB_IRQn
|
||||||
|
#define BLACKBERRY_TRACKBALL_DOWN_CLOCK kCLOCK_PortB
|
||||||
|
#define BLACKBERRY_TRACKBALL_DOWN_PIN 6
|
||||||
|
|
||||||
|
#define BLACKBERRY_TRACKBALL_IRQ_HANDLER1 PORTA_IRQHandler
|
||||||
|
#define BLACKBERRY_TRACKBALL_IRQ_HANDLER2 PORTB_IRQHandler
|
||||||
|
|
||||||
|
// Variables:
|
||||||
|
|
||||||
|
extern pointer_delta_t BlackBerryTrackball_PointerDelta;
|
||||||
|
|
||||||
|
// Functions:
|
||||||
|
|
||||||
|
void BlackberryTrackball_Init(void);
|
||||||
|
|
||||||
|
#endif
|
||||||
19
keycluster/src/i2c.h
Normal file
19
keycluster/src/i2c.h
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
#ifndef __I2C_H__
|
||||||
|
#define __I2C_H__
|
||||||
|
|
||||||
|
// Macros:
|
||||||
|
|
||||||
|
#define I2C_BUS_BASEADDR I2C0
|
||||||
|
#define I2C_BUS_CLK_SRC I2C0_CLK_SRC
|
||||||
|
#define I2C_BUS_BAUD_RATE 100000 // 100 kHz works even with a 20 meter long bridge cable.
|
||||||
|
#define I2C_BUS_MUX kPORT_MuxAlt2
|
||||||
|
|
||||||
|
#define I2C_BUS_SDA_PORT PORTB
|
||||||
|
#define I2C_BUS_SDA_CLOCK kCLOCK_PortB
|
||||||
|
#define I2C_BUS_SDA_PIN 4
|
||||||
|
|
||||||
|
#define I2C_BUS_SCL_PORT PORTB
|
||||||
|
#define I2C_BUS_SCL_CLOCK kCLOCK_PortB
|
||||||
|
#define I2C_BUS_SCL_PIN 3
|
||||||
|
|
||||||
|
#endif
|
||||||
33
keycluster/src/i2c_watchdog.c
Normal file
33
keycluster/src/i2c_watchdog.c
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
#include "fsl_i2c.h"
|
||||||
|
#include "i2c.h"
|
||||||
|
#include "i2c_watchdog.h"
|
||||||
|
#include "test_led.h"
|
||||||
|
#include "init_peripherals.h"
|
||||||
|
|
||||||
|
// NOTE: Because of a bug in the ROM bootloader of the KL03Z, the watchdog timer is disabled and cannot be re-enabled.
|
||||||
|
// See https://community.nxp.com/thread/457893
|
||||||
|
// Therefore the hardware watchdog timer cannot be used without an extra way to enter bootloader or application mode.
|
||||||
|
static uint32_t prevWatchdogCounter = 0;
|
||||||
|
static uint32_t I2cWatchdog_RecoveryCounter; // Counter for how many times we had to recover and restart
|
||||||
|
|
||||||
|
void RunWatchdog(void)
|
||||||
|
{
|
||||||
|
static volatile uint32_t I2cWatchdog_WatchCounter = 0; // Counter for timer
|
||||||
|
static int counter = 0;
|
||||||
|
|
||||||
|
counter++;
|
||||||
|
if (counter == 100) { // We get called from KEY_SCANNER_HANDLER() which runs at 1ms, thus scaling down by 100 here to get 100 ms period
|
||||||
|
counter=0;
|
||||||
|
TestLed_Toggle();
|
||||||
|
I2cWatchdog_WatchCounter++;
|
||||||
|
|
||||||
|
if (I2cWatchdog_WatchCounter > 10) { // Do not check within the first 1000 ms, as I2C might not be running yet
|
||||||
|
if (I2C_Watchdog == prevWatchdogCounter) { // Restart I2C if there hasn't been any interrupt during 100 ms. I2C_Watchdog gets incremented for every I2C transaction
|
||||||
|
I2cWatchdog_RecoveryCounter++;
|
||||||
|
I2C_SlaveDeinit(I2C_BUS_BASEADDR);
|
||||||
|
initI2c();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
prevWatchdogCounter = I2C_Watchdog;
|
||||||
|
}
|
||||||
|
}
|
||||||
18
keycluster/src/i2c_watchdog.h
Normal file
18
keycluster/src/i2c_watchdog.h
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
#ifndef __I2C_WATCHDOG_H__
|
||||||
|
#define __I2C_WATCHDOG_H__
|
||||||
|
|
||||||
|
// Includes:
|
||||||
|
|
||||||
|
#include "fsl_lptmr.h"
|
||||||
|
|
||||||
|
// Macros:
|
||||||
|
|
||||||
|
#define I2C_WATCHDOG_LPTMR_HANDLER LPTMR0_IRQHandler
|
||||||
|
#define LPTMR_SOURCE_CLOCK CLOCK_GetFreq(kCLOCK_LpoClk)
|
||||||
|
#define LPTMR_USEC_COUNT 100000U
|
||||||
|
|
||||||
|
// Functions:
|
||||||
|
|
||||||
|
void RunWatchdog(void);
|
||||||
|
|
||||||
|
#endif
|
||||||
91
keycluster/src/init_peripherals.c
Normal file
91
keycluster/src/init_peripherals.c
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
#include "fsl_common.h"
|
||||||
|
#include "fsl_port.h"
|
||||||
|
#include "test_led.h"
|
||||||
|
#include "init_peripherals.h"
|
||||||
|
#include "i2c_addresses.h"
|
||||||
|
#include "fsl_i2c.h"
|
||||||
|
#include "fsl_clock.h"
|
||||||
|
#include "i2c.h"
|
||||||
|
#include "led_pwm.h"
|
||||||
|
#include "slave_protocol_handler.h"
|
||||||
|
#include "i2c_watchdog.h"
|
||||||
|
#include "main.h"
|
||||||
|
#include "module.h"
|
||||||
|
#include "blackberry_trackball.h"
|
||||||
|
|
||||||
|
i2c_slave_config_t slaveConfig;
|
||||||
|
i2c_slave_handle_t slaveHandle;
|
||||||
|
|
||||||
|
uint8_t userData;
|
||||||
|
uint8_t rxMessagePos;
|
||||||
|
uint8_t dosBuffer[2];
|
||||||
|
|
||||||
|
static void i2cSlaveCallback(I2C_Type *base, i2c_slave_transfer_t *xfer, void *userDataArg)
|
||||||
|
{
|
||||||
|
dosBuffer[0] = xfer->event;
|
||||||
|
dosBuffer[1] = userData;
|
||||||
|
|
||||||
|
switch (xfer->event) {
|
||||||
|
case kI2C_SlaveTransmitEvent:
|
||||||
|
SlaveTxHandler();
|
||||||
|
xfer->data = (uint8_t*)&TxMessage;
|
||||||
|
xfer->dataSize = TxMessage.length + I2C_MESSAGE_HEADER_LENGTH;
|
||||||
|
break;
|
||||||
|
case kI2C_SlaveAddressMatchEvent:
|
||||||
|
rxMessagePos = 0;
|
||||||
|
break;
|
||||||
|
case kI2C_SlaveReceiveEvent:
|
||||||
|
((uint8_t*)&RxMessage)[rxMessagePos++] = userData;
|
||||||
|
if (RxMessage.length == rxMessagePos-I2C_MESSAGE_HEADER_LENGTH) {
|
||||||
|
SlaveRxHandler();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void initInterruptPriorities(void)
|
||||||
|
{
|
||||||
|
NVIC_SetPriority(I2C0_IRQn, 1);
|
||||||
|
NVIC_SetPriority(TPM1_IRQn, 1);
|
||||||
|
NVIC_SetPriority(SPI0_IRQn, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void initI2c(void)
|
||||||
|
{
|
||||||
|
port_pin_config_t pinConfig = {
|
||||||
|
.pullSelect = kPORT_PullUp,
|
||||||
|
};
|
||||||
|
|
||||||
|
CLOCK_EnableClock(I2C_BUS_SDA_CLOCK);
|
||||||
|
CLOCK_EnableClock(I2C_BUS_SCL_CLOCK);
|
||||||
|
|
||||||
|
pinConfig.mux = I2C_BUS_MUX;
|
||||||
|
PORT_SetPinConfig(I2C_BUS_SDA_PORT, I2C_BUS_SDA_PIN, &pinConfig);
|
||||||
|
PORT_SetPinConfig(I2C_BUS_SCL_PORT, I2C_BUS_SCL_PIN, &pinConfig);
|
||||||
|
|
||||||
|
I2C_SlaveGetDefaultConfig(&slaveConfig);
|
||||||
|
slaveConfig.slaveAddress = I2C_ADDRESS_MODULE_FIRMWARE;
|
||||||
|
I2C_SlaveInit(I2C_BUS_BASEADDR, &slaveConfig);
|
||||||
|
I2C_SlaveTransferCreateHandle(I2C_BUS_BASEADDR, &slaveHandle, i2cSlaveCallback, &userData);
|
||||||
|
I2C_SlaveTransferNonBlocking(I2C_BUS_BASEADDR, &slaveHandle, kI2C_SlaveAddressMatchEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
void InitLedDriver(void)
|
||||||
|
{
|
||||||
|
CLOCK_EnableClock(LED_DRIVER_SDB_CLOCK);
|
||||||
|
PORT_SetPinMux(LED_DRIVER_SDB_PORT, LED_DRIVER_SDB_PIN, kPORT_MuxAsGpio);
|
||||||
|
GPIO_PinInit(LED_DRIVER_SDB_GPIO, LED_DRIVER_SDB_PIN, &(gpio_pin_config_t){kGPIO_DigitalOutput, 0});
|
||||||
|
GPIO_WritePinOutput(LED_DRIVER_SDB_GPIO, LED_DRIVER_SDB_PIN, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void InitPeripherals(void)
|
||||||
|
{
|
||||||
|
initInterruptPriorities();
|
||||||
|
InitLedDriver();
|
||||||
|
TestLed_Init();
|
||||||
|
LedPwm_Init();
|
||||||
|
initI2c();
|
||||||
|
BlackberryTrackball_Init();
|
||||||
|
}
|
||||||
16
keycluster/src/init_peripherals.h
Normal file
16
keycluster/src/init_peripherals.h
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#ifndef __INIT_PERIPHERALS_H__
|
||||||
|
#define __INIT_PERIPHERALS_H__
|
||||||
|
|
||||||
|
// Macros:
|
||||||
|
|
||||||
|
#define LED_DRIVER_SDB_PORT PORTB
|
||||||
|
#define LED_DRIVER_SDB_GPIO GPIOB
|
||||||
|
#define LED_DRIVER_SDB_CLOCK kCLOCK_PortB
|
||||||
|
#define LED_DRIVER_SDB_PIN 1
|
||||||
|
|
||||||
|
// Functions:
|
||||||
|
|
||||||
|
void InitPeripherals(void);
|
||||||
|
void initI2c(void);
|
||||||
|
|
||||||
|
#endif
|
||||||
22
keycluster/src/key_scanner.c
Normal file
22
keycluster/src/key_scanner.c
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#include "fsl_lptmr.h"
|
||||||
|
#include "key_scanner.h"
|
||||||
|
#include "i2c_watchdog.h"
|
||||||
|
|
||||||
|
void KEY_SCANNER_HANDLER(void)
|
||||||
|
{
|
||||||
|
KeyMatrix_ScanRow(&keyMatrix);
|
||||||
|
RunWatchdog();
|
||||||
|
LPTMR_ClearStatusFlags(KEY_SCANNER_LPTMR_BASEADDR, kLPTMR_TimerCompareFlag);
|
||||||
|
}
|
||||||
|
|
||||||
|
void InitKeyScanner(void)
|
||||||
|
{
|
||||||
|
lptmr_config_t lptmrConfig;
|
||||||
|
LPTMR_GetDefaultConfig(&lptmrConfig);
|
||||||
|
LPTMR_Init(KEY_SCANNER_LPTMR_BASEADDR, &lptmrConfig);
|
||||||
|
|
||||||
|
LPTMR_SetTimerPeriod(KEY_SCANNER_LPTMR_BASEADDR, USEC_TO_COUNT(KEY_SCANNER_INTERVAL_USEC, LPTMR_SOURCE_CLOCK));
|
||||||
|
LPTMR_EnableInterrupts(KEY_SCANNER_LPTMR_BASEADDR, kLPTMR_TimerInterruptEnable);
|
||||||
|
EnableIRQ(KEY_SCANNER_LPTMR_IRQ_ID);
|
||||||
|
LPTMR_StartTimer(KEY_SCANNER_LPTMR_BASEADDR);
|
||||||
|
}
|
||||||
22
keycluster/src/key_scanner.h
Normal file
22
keycluster/src/key_scanner.h
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#ifndef __KEY_SCANNER_H__
|
||||||
|
#define __KEY_SCANNER_H__
|
||||||
|
|
||||||
|
// Includes:
|
||||||
|
|
||||||
|
#include "main.h"
|
||||||
|
|
||||||
|
// Macros:
|
||||||
|
|
||||||
|
#define LPTMR_SOURCE_CLOCK CLOCK_GetFreq(kCLOCK_LpoClk)
|
||||||
|
|
||||||
|
#define KEY_SCANNER_LPTMR_BASEADDR LPTMR0
|
||||||
|
#define KEY_SCANNER_LPTMR_IRQ_ID LPTMR0_IRQn
|
||||||
|
#define KEY_SCANNER_HANDLER LPTMR0_IRQHandler
|
||||||
|
|
||||||
|
#define KEY_SCANNER_INTERVAL_USEC (1000 / KEYBOARD_MATRIX_ROWS_NUM)
|
||||||
|
|
||||||
|
// Functions:
|
||||||
|
|
||||||
|
void InitKeyScanner(void);
|
||||||
|
|
||||||
|
#endif
|
||||||
30
keycluster/src/led_pwm.c
Normal file
30
keycluster/src/led_pwm.c
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
#include "led_pwm.h"
|
||||||
|
#include "fsl_port.h"
|
||||||
|
|
||||||
|
void LedPwm_Init(void)
|
||||||
|
{
|
||||||
|
CLOCK_EnableClock(LED_PWM_CLOCK);
|
||||||
|
PORT_SetPinMux(LED_PWM_PORT, LED_PWM_PIN, kPORT_MuxAlt2);
|
||||||
|
|
||||||
|
// Select the clock source for the TPM counter as MCGPLLCLK.
|
||||||
|
CLOCK_SetTpmClock(1U);
|
||||||
|
|
||||||
|
tpm_config_t tpmInfo;
|
||||||
|
TPM_GetDefaultConfig(&tpmInfo);
|
||||||
|
TPM_Init(LED_PWM_TPM_BASEADDR, &tpmInfo);
|
||||||
|
|
||||||
|
tpm_chnl_pwm_signal_param_t tpmParam[1];
|
||||||
|
tpmParam[0].chnlNumber = LED_PWM_TPM_CHANNEL;
|
||||||
|
tpmParam[0].level = kTPM_LowTrue;
|
||||||
|
tpmParam[0].dutyCyclePercent = 100 - INITIAL_DUTY_CYCLE_PERCENT;
|
||||||
|
TPM_SetupPwm(LED_PWM_TPM_BASEADDR, tpmParam, 1,
|
||||||
|
kTPM_EdgeAlignedPwm, TPM_PWM_FREQUENCY, TPM_SOURCE_CLOCK);
|
||||||
|
|
||||||
|
TPM_StartTimer(LED_PWM_TPM_BASEADDR, kTPM_SystemClock);
|
||||||
|
}
|
||||||
|
|
||||||
|
void LedPwm_SetBrightness(uint8_t brightnessPercent)
|
||||||
|
{
|
||||||
|
TPM_UpdatePwmDutycycle(LED_PWM_TPM_BASEADDR, LED_PWM_TPM_CHANNEL,
|
||||||
|
kTPM_EdgeAlignedPwm, 100 - brightnessPercent);
|
||||||
|
}
|
||||||
27
keycluster/src/led_pwm.h
Normal file
27
keycluster/src/led_pwm.h
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
#ifndef __LED_PWM_H__
|
||||||
|
#define __LED_PWM_H__
|
||||||
|
|
||||||
|
// Includes:
|
||||||
|
|
||||||
|
#include "fsl_tpm.h"
|
||||||
|
|
||||||
|
// Macros:
|
||||||
|
|
||||||
|
#define LED_PWM_PORT PORTB
|
||||||
|
#define LED_PWM_CLOCK kCLOCK_PortB
|
||||||
|
#define LED_PWM_PIN 5
|
||||||
|
|
||||||
|
#define LED_PWM_TPM_BASEADDR TPM1
|
||||||
|
#define LED_PWM_TPM_CHANNEL kTPM_Chnl_1
|
||||||
|
|
||||||
|
#define TPM_SOURCE_CLOCK CLOCK_GetFreq(kCLOCK_BusClk)
|
||||||
|
#define TPM_PWM_FREQUENCY 24000U
|
||||||
|
|
||||||
|
#define INITIAL_DUTY_CYCLE_PERCENT 100U
|
||||||
|
|
||||||
|
// Functions:
|
||||||
|
|
||||||
|
void LedPwm_Init(void);
|
||||||
|
void LedPwm_SetBrightness(uint8_t brightnessPercent);
|
||||||
|
|
||||||
|
#endif
|
||||||
34
keycluster/src/main.c
Normal file
34
keycluster/src/main.c
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
#include "main.h"
|
||||||
|
#include "slave/init_clock.h"
|
||||||
|
#include "init_peripherals.h"
|
||||||
|
#include "bootloader.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "key_scanner.h"
|
||||||
|
#include "module.h"
|
||||||
|
|
||||||
|
DEFINE_BOOTLOADER_CONFIG_AREA(I2C_ADDRESS_MODULE_BOOTLOADER)
|
||||||
|
|
||||||
|
key_matrix_t keyMatrix = {
|
||||||
|
.colNum = KEYBOARD_MATRIX_COLS_NUM,
|
||||||
|
.rowNum = KEYBOARD_MATRIX_ROWS_NUM,
|
||||||
|
.cols = (key_matrix_pin_t[]) {
|
||||||
|
{PORTB, GPIOB, kCLOCK_PortB, 11},
|
||||||
|
{PORTA, GPIOA, kCLOCK_PortA, 6},
|
||||||
|
},
|
||||||
|
.rows = (key_matrix_pin_t[]) {
|
||||||
|
{PORTB, GPIOB, kCLOCK_PortB, 7},
|
||||||
|
{PORTB, GPIOB, kCLOCK_PortB, 10},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
InitClock();
|
||||||
|
InitPeripherals();
|
||||||
|
KeyMatrix_Init(&keyMatrix);
|
||||||
|
InitKeyScanner();
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
__WFI();
|
||||||
|
}
|
||||||
|
}
|
||||||
17
keycluster/src/main.h
Normal file
17
keycluster/src/main.h
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
#ifndef __MAIN_H__
|
||||||
|
#define __MAIN_H__
|
||||||
|
|
||||||
|
// Includes:
|
||||||
|
|
||||||
|
#include "key_matrix.h"
|
||||||
|
|
||||||
|
// Macros:
|
||||||
|
|
||||||
|
#define KEYBOARD_MATRIX_COLS_NUM 2
|
||||||
|
#define KEYBOARD_MATRIX_ROWS_NUM 2
|
||||||
|
|
||||||
|
// Variables:
|
||||||
|
|
||||||
|
extern key_matrix_t keyMatrix;
|
||||||
|
|
||||||
|
#endif
|
||||||
13
keycluster/src/module.h
Normal file
13
keycluster/src/module.h
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#ifndef __MODULE_H__
|
||||||
|
#define __MODULE_H__
|
||||||
|
|
||||||
|
// Macros:
|
||||||
|
|
||||||
|
#define I2C_ADDRESS_MODULE_FIRMWARE I2C_ADDRESS_LEFT_MODULE_FIRMWARE
|
||||||
|
#define I2C_ADDRESS_MODULE_BOOTLOADER I2C_ADDRESS_LEFT_MODULE_BOOTLOADER
|
||||||
|
#define MODULE_PROTOCOL_VERSION 1
|
||||||
|
#define MODULE_ID ModuleId_KeyClusterLeft
|
||||||
|
#define MODULE_KEY_COUNT (KEYBOARD_MATRIX_ROWS_NUM * KEYBOARD_MATRIX_COLS_NUM)
|
||||||
|
#define MODULE_POINTER_COUNT 1
|
||||||
|
|
||||||
|
#endif
|
||||||
115
keycluster/src/slave_protocol_handler.c
Normal file
115
keycluster/src/slave_protocol_handler.c
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
#include "slave_protocol_handler.h"
|
||||||
|
#include "test_led.h"
|
||||||
|
#include "main.h"
|
||||||
|
#include "i2c_addresses.h"
|
||||||
|
#include "i2c.h"
|
||||||
|
#include "led_pwm.h"
|
||||||
|
#include "slave_protocol.h"
|
||||||
|
#include "main.h"
|
||||||
|
#include "init_peripherals.h"
|
||||||
|
#include "bool_array_converter.h"
|
||||||
|
#include "bootloader.h"
|
||||||
|
#include "module.h"
|
||||||
|
#include "versions.h"
|
||||||
|
#include "blackberry_trackball.h"
|
||||||
|
|
||||||
|
i2c_message_t RxMessage;
|
||||||
|
i2c_message_t TxMessage;
|
||||||
|
|
||||||
|
static version_t moduleProtocolVersion = {
|
||||||
|
MODULE_PROTOCOL_MAJOR_VERSION,
|
||||||
|
MODULE_PROTOCOL_MINOR_VERSION,
|
||||||
|
MODULE_PROTOCOL_PATCH_VERSION,
|
||||||
|
};
|
||||||
|
|
||||||
|
static version_t firmwareVersion = {
|
||||||
|
FIRMWARE_MAJOR_VERSION,
|
||||||
|
FIRMWARE_MINOR_VERSION,
|
||||||
|
FIRMWARE_PATCH_VERSION,
|
||||||
|
};
|
||||||
|
|
||||||
|
void SlaveRxHandler(void)
|
||||||
|
{
|
||||||
|
if (!CRC16_IsMessageValid(&RxMessage)) {
|
||||||
|
TxMessage.length = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t commandId = RxMessage.data[0];
|
||||||
|
switch (commandId) {
|
||||||
|
case SlaveCommand_JumpToBootloader:
|
||||||
|
NVIC_SystemReset();
|
||||||
|
break;
|
||||||
|
case SlaveCommand_SetTestLed:
|
||||||
|
TxMessage.length = 0;
|
||||||
|
bool isLedOn = RxMessage.data[1];
|
||||||
|
TestLed_Set(isLedOn);
|
||||||
|
break;
|
||||||
|
case SlaveCommand_SetLedPwmBrightness:
|
||||||
|
TxMessage.length = 0;
|
||||||
|
uint8_t brightnessPercent = RxMessage.data[1];
|
||||||
|
LedPwm_SetBrightness(brightnessPercent);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SlaveTxHandler(void)
|
||||||
|
{
|
||||||
|
uint8_t commandId = RxMessage.data[0];
|
||||||
|
switch (commandId) {
|
||||||
|
case SlaveCommand_RequestProperty: {
|
||||||
|
uint8_t propertyId = RxMessage.data[1];
|
||||||
|
switch (propertyId) {
|
||||||
|
case SlaveProperty_Sync: {
|
||||||
|
memcpy(TxMessage.data, SlaveSyncString, SLAVE_SYNC_STRING_LENGTH);
|
||||||
|
TxMessage.length = SLAVE_SYNC_STRING_LENGTH;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case SlaveProperty_ModuleProtocolVersion: {
|
||||||
|
memcpy(TxMessage.data, &moduleProtocolVersion, sizeof(version_t));
|
||||||
|
TxMessage.length = sizeof(version_t);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case SlaveProperty_FirmwareVersion: {
|
||||||
|
memcpy(TxMessage.data, &firmwareVersion, sizeof(version_t));
|
||||||
|
TxMessage.length = sizeof(version_t);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case SlaveProperty_ModuleId: {
|
||||||
|
TxMessage.data[0] = MODULE_ID;
|
||||||
|
TxMessage.length = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case SlaveProperty_KeyCount: {
|
||||||
|
TxMessage.data[0] = MODULE_KEY_COUNT;
|
||||||
|
TxMessage.length = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case SlaveProperty_PointerCount: {
|
||||||
|
TxMessage.data[0] = MODULE_POINTER_COUNT;
|
||||||
|
TxMessage.length = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case SlaveCommand_RequestKeyStates:
|
||||||
|
BoolBytesToBits(keyMatrix.keyStates, TxMessage.data, MODULE_KEY_COUNT);
|
||||||
|
uint8_t messageLength = BOOL_BYTES_TO_BITS_COUNT(MODULE_KEY_COUNT);
|
||||||
|
if (MODULE_POINTER_COUNT) {
|
||||||
|
pointer_delta_t *pointerDelta = (pointer_delta_t*)(TxMessage.data + messageLength);
|
||||||
|
pointerDelta->x = BlackBerryTrackball_PointerDelta.x;
|
||||||
|
pointerDelta->y = BlackBerryTrackball_PointerDelta.y;
|
||||||
|
BlackBerryTrackball_PointerDelta.x = 0;
|
||||||
|
BlackBerryTrackball_PointerDelta.y = 0;
|
||||||
|
if (keyMatrix.keyStates[0]) {
|
||||||
|
pointerDelta->x = 1;
|
||||||
|
}
|
||||||
|
messageLength += sizeof(pointer_delta_t);
|
||||||
|
}
|
||||||
|
TxMessage.length = messageLength;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
CRC16_UpdateMessageChecksum(&TxMessage);
|
||||||
|
}
|
||||||
20
keycluster/src/slave_protocol_handler.h
Normal file
20
keycluster/src/slave_protocol_handler.h
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
#ifndef __SLAVE_PROTOCOL_HANDLER_H__
|
||||||
|
#define __SLAVE_PROTOCOL_HANDLER_H__
|
||||||
|
|
||||||
|
// Includes:
|
||||||
|
|
||||||
|
#include "fsl_port.h"
|
||||||
|
#include "crc16.h"
|
||||||
|
#include "slave_protocol.h"
|
||||||
|
|
||||||
|
// Variables:
|
||||||
|
|
||||||
|
extern i2c_message_t RxMessage;
|
||||||
|
extern i2c_message_t TxMessage;
|
||||||
|
|
||||||
|
// Functions:
|
||||||
|
|
||||||
|
void SlaveRxHandler(void);
|
||||||
|
void SlaveTxHandler(void);
|
||||||
|
|
||||||
|
#endif
|
||||||
10
keycluster/src/test_led.c
Normal file
10
keycluster/src/test_led.c
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#include "test_led.h"
|
||||||
|
#include "fsl_port.h"
|
||||||
|
|
||||||
|
extern void TestLed_Init(void)
|
||||||
|
{
|
||||||
|
CLOCK_EnableClock(TEST_LED_CLOCK);
|
||||||
|
PORT_SetPinMux(TEST_LED_PORT, TEST_LED_PIN, kPORT_MuxAsGpio);
|
||||||
|
GPIO_PinInit(TEST_LED_GPIO, TEST_LED_PIN, &(gpio_pin_config_t){kGPIO_DigitalOutput, 0});
|
||||||
|
TestLed_On();
|
||||||
|
}
|
||||||
42
keycluster/src/test_led.h
Normal file
42
keycluster/src/test_led.h
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
#ifndef __TEST_LED_H__
|
||||||
|
#define __TEST_LED_H__
|
||||||
|
|
||||||
|
// Includes:
|
||||||
|
|
||||||
|
#include "fsl_gpio.h"
|
||||||
|
|
||||||
|
// Macros:
|
||||||
|
|
||||||
|
#define LOGIC_LED_ON 0U
|
||||||
|
#define LOGIC_LED_OFF 1U
|
||||||
|
|
||||||
|
#define TEST_LED_GPIO GPIOB
|
||||||
|
#define TEST_LED_PORT PORTB
|
||||||
|
#define TEST_LED_CLOCK kCLOCK_PortB
|
||||||
|
#define TEST_LED_PIN 13
|
||||||
|
|
||||||
|
static inline void TestLed_On(void)
|
||||||
|
{
|
||||||
|
GPIO_SetPinsOutput(TEST_LED_GPIO, 1U << TEST_LED_PIN);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void TestLed_Off(void)
|
||||||
|
{
|
||||||
|
GPIO_ClearPinsOutput(TEST_LED_GPIO, 1U << TEST_LED_PIN);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void TestLed_Set(bool state)
|
||||||
|
{
|
||||||
|
GPIO_WritePinOutput(TEST_LED_GPIO, TEST_LED_PIN, state);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void TestLed_Toggle(void)
|
||||||
|
{
|
||||||
|
GPIO_TogglePinsOutput(TEST_LED_GPIO, 1U << TEST_LED_PIN);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Functions:
|
||||||
|
|
||||||
|
void TestLed_Init(void);
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -44,7 +44,8 @@ SOURCE = $(wildcard src/*.c) \
|
|||||||
../lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/drivers/fsl_lptmr.c \
|
../lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/drivers/fsl_lptmr.c \
|
||||||
../lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/drivers/fsl_spi.c \
|
../lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/drivers/fsl_spi.c \
|
||||||
../lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/drivers/fsl_tpm.c \
|
../lib/KSDK_2.0_MKL03Z8xxx4/devices/MKL03Z4/drivers/fsl_tpm.c \
|
||||||
$(wildcard ../shared/*.c)
|
$(wildcard ../shared/*.c) \
|
||||||
|
$(wildcard ../shared/slave/*.c)
|
||||||
|
|
||||||
# Header files.
|
# Header files.
|
||||||
IPATH = src \
|
IPATH = src \
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
#ifndef __CONFIG_H__
|
|
||||||
#define __CONFIG_H__
|
|
||||||
|
|
||||||
// Macros:
|
|
||||||
|
|
||||||
#define I2C_WATCHDOG_VALUE_REINIT 1
|
|
||||||
#define I2C_WATCHDOG_VALUE_REBOOT 2
|
|
||||||
|
|
||||||
// #define DEBUG_OVER_SPI
|
|
||||||
#define I2C_WATCHDOG I2C_WATCHDOG_VALUE_REINIT
|
|
||||||
// #define I2C_WATCHDOG I2C_WATCHDOG_VALUE_REBOOT
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
#ifdef DEBUG_OVER_SPI
|
|
||||||
|
|
||||||
#include "debug_over_spi.h"
|
|
||||||
#include "config.h"
|
|
||||||
#include "fsl_gpio.h"
|
|
||||||
|
|
||||||
|
|
||||||
#define EXAMPLE_SPI_MASTER (SPI0)
|
|
||||||
#define EXAMPLE_SPI_MASTER_SOURCE_CLOCK (kCLOCK_BusClk)
|
|
||||||
|
|
||||||
#define BUFFER_SIZE (64)
|
|
||||||
static uint8_t srcBuff[BUFFER_SIZE];
|
|
||||||
|
|
||||||
static spi_transfer_t xfer = {0};
|
|
||||||
static spi_master_config_t userConfig;
|
|
||||||
spi_master_handle_t handle;
|
|
||||||
|
|
||||||
static volatile bool masterFinished = true;
|
|
||||||
|
|
||||||
static void masterCallback(SPI_Type *base, spi_master_handle_t *masterHandle, status_t status, void *userData)
|
|
||||||
{
|
|
||||||
masterFinished = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DebugOverSpi_Init(void)
|
|
||||||
{
|
|
||||||
CLOCK_EnableClock(DEBUG_OVER_SPI_MOSI_CLOCK);
|
|
||||||
CLOCK_EnableClock(DEBUG_OVER_SPI_SCK_CLOCK);
|
|
||||||
|
|
||||||
PORT_SetPinMux(DEBUG_OVER_SPI_MOSI_PORT, DEBUG_OVER_SPI_MOSI_PIN, kPORT_MuxAlt3);
|
|
||||||
PORT_SetPinMux(DEBUG_OVER_SPI_SCK_PORT, DEBUG_OVER_SPI_SCK_PIN, kPORT_MuxAlt3);
|
|
||||||
|
|
||||||
GPIO_PinInit(DEBUG_OVER_SPI_MOSI_GPIO, DEBUG_OVER_SPI_MOSI_PIN, &(gpio_pin_config_t){kGPIO_DigitalOutput, 0});
|
|
||||||
GPIO_PinInit(DEBUG_OVER_SPI_SCK_GPIO, DEBUG_OVER_SPI_SCK_PIN, &(gpio_pin_config_t){kGPIO_DigitalOutput, 0});
|
|
||||||
|
|
||||||
GPIO_SetPinsOutput(DEBUG_OVER_SPI_MOSI_GPIO, 1U << DEBUG_OVER_SPI_MOSI_PIN);
|
|
||||||
GPIO_SetPinsOutput(DEBUG_OVER_SPI_SCK_GPIO, 1U << DEBUG_OVER_SPI_SCK_PIN);
|
|
||||||
|
|
||||||
SPI_MasterGetDefaultConfig(&userConfig);
|
|
||||||
uint32_t srcFreq = CLOCK_GetFreq(EXAMPLE_SPI_MASTER_SOURCE_CLOCK);
|
|
||||||
SPI_MasterInit(EXAMPLE_SPI_MASTER, &userConfig, srcFreq);
|
|
||||||
SPI_MasterTransferCreateHandle(EXAMPLE_SPI_MASTER, &handle, masterCallback, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
void DebugOverSpi_Send(uint8_t *tx, uint8_t len)
|
|
||||||
{
|
|
||||||
if (masterFinished) {
|
|
||||||
masterFinished = false;
|
|
||||||
memcpy(srcBuff, tx, MIN(BUFFER_SIZE, len));
|
|
||||||
xfer.txData = srcBuff;
|
|
||||||
xfer.dataSize = len;
|
|
||||||
SPI_MasterTransferNonBlocking(EXAMPLE_SPI_MASTER, &handle, &xfer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
#ifdef DEBUG_OVER_SPI
|
|
||||||
|
|
||||||
#ifndef __DEBUG_OVER_SPI_H__
|
|
||||||
#define __DEBUG_OVER_SPI_H__
|
|
||||||
|
|
||||||
// Includes:
|
|
||||||
|
|
||||||
#include "fsl_common.h"
|
|
||||||
#include "fsl_port.h"
|
|
||||||
#include "fsl_spi.h"
|
|
||||||
|
|
||||||
// Macros:
|
|
||||||
|
|
||||||
#define DEBUG_OVER_SPI_MOSI_PORT PORTA
|
|
||||||
#define DEBUG_OVER_SPI_MOSI_GPIO GPIOA
|
|
||||||
#define DEBUG_OVER_SPI_MOSI_CLOCK kCLOCK_PortA
|
|
||||||
#define DEBUG_OVER_SPI_MOSI_PIN 7
|
|
||||||
|
|
||||||
#define DEBUG_OVER_SPI_SCK_PORT PORTB
|
|
||||||
#define DEBUG_OVER_SPI_SCK_GPIO GPIOB
|
|
||||||
#define DEBUG_OVER_SPI_SCK_CLOCK kCLOCK_PortB
|
|
||||||
#define DEBUG_OVER_SPI_SCK_PIN 0
|
|
||||||
|
|
||||||
// Functions:
|
|
||||||
|
|
||||||
void DebugOverSpi_Init(void);
|
|
||||||
void DebugOverSpi_Send(uint8_t *tx, uint8_t len);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#else
|
|
||||||
#define DebugOverSpi_Init()
|
|
||||||
#define DebugOverSpi_Send(tx, len)
|
|
||||||
#endif
|
|
||||||
@@ -3,40 +3,31 @@
|
|||||||
#include "i2c_watchdog.h"
|
#include "i2c_watchdog.h"
|
||||||
#include "test_led.h"
|
#include "test_led.h"
|
||||||
#include "init_peripherals.h"
|
#include "init_peripherals.h"
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
/* NOTE: Because of a bug in the ROM bootloader of the KL03Z, the watchdog timer is disabled and cannot be re-enabled.
|
// NOTE: Because of a bug in the ROM bootloader of the KL03Z, the watchdog timer is disabled and cannot be re-enabled.
|
||||||
* See https://community.nxp.com/thread/457893
|
// See https://community.nxp.com/thread/457893
|
||||||
* Therefore the hardware watchdog timer cannot be used without an extra way to enter bootloader or application mode.
|
// Therefore the hardware watchdog timer cannot be used without an extra way to enter bootloader or application mode.
|
||||||
*/
|
static uint32_t prevWatchdogCounter = 0;
|
||||||
#ifdef I2C_WATCHDOG
|
static uint32_t I2cWatchdog_RecoveryCounter; // Counter for how many times we had to recover and restart
|
||||||
static uint32_t prevWatchdogCounter = 0;
|
|
||||||
static uint32_t I2cWatchdog_RecoveryCounter; /* counter for how many times we had to recover and restart */
|
|
||||||
|
|
||||||
void RunWatchdog(void)
|
void RunWatchdog(void)
|
||||||
{
|
{
|
||||||
static volatile uint32_t I2cWatchdog_WatchCounter = 0; /* counter for timer */
|
static volatile uint32_t I2cWatchdog_WatchCounter = 0; // Counter for timer
|
||||||
static int cntr = 0;
|
static int counter = 0;
|
||||||
|
|
||||||
cntr++;
|
counter++;
|
||||||
if (cntr==100) { /* we get called from KEY_SCANNER_HANDLER() which runs at 1ms, thus scaling down by 100 here to get 100 ms period */
|
if (counter == 100) { // We get called from KEY_SCANNER_HANDLER() which runs at 1ms, thus scaling down by 100 here to get 100 ms period
|
||||||
cntr=0;
|
counter=0;
|
||||||
TEST_LED_TOGGLE();
|
TestLed_Toggle();
|
||||||
I2cWatchdog_WatchCounter++;
|
I2cWatchdog_WatchCounter++;
|
||||||
|
|
||||||
if (I2cWatchdog_WatchCounter>10) { /* do not check within the first 1000 ms, as I2C might not be running yet */
|
if (I2cWatchdog_WatchCounter > 10) { // Do not check within the first 1000 ms, as I2C might not be running yet
|
||||||
if (I2C_Watchdog == prevWatchdogCounter) { // Restart I2C if there hasn't been any interrupt during 100 ms. I2C_Watchdog gets incremented for every I2C transaction
|
if (I2C_Watchdog == prevWatchdogCounter) { // Restart I2C if there hasn't been any interrupt during 100 ms. I2C_Watchdog gets incremented for every I2C transaction
|
||||||
I2cWatchdog_RecoveryCounter++;
|
I2cWatchdog_RecoveryCounter++;
|
||||||
#if I2C_WATCHDOG == I2C_WATCHDOG_VALUE_REBOOT
|
|
||||||
NVIC_SystemReset();
|
|
||||||
#endif
|
|
||||||
#if I2C_WATCHDOG == I2C_WATCHDOG_VALUE_REINIT
|
|
||||||
I2C_SlaveDeinit(I2C_BUS_BASEADDR);
|
I2C_SlaveDeinit(I2C_BUS_BASEADDR);
|
||||||
initI2c();
|
initI2c();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prevWatchdogCounter = I2C_Watchdog; /* remember previous counter */
|
prevWatchdogCounter = I2C_Watchdog;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
#include "led_pwm.h"
|
#include "led_pwm.h"
|
||||||
#include "slave_protocol_handler.h"
|
#include "slave_protocol_handler.h"
|
||||||
#include "i2c_watchdog.h"
|
#include "i2c_watchdog.h"
|
||||||
#include "debug_over_spi.h"
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
#include "module.h"
|
||||||
|
|
||||||
i2c_slave_config_t slaveConfig;
|
i2c_slave_config_t slaveConfig;
|
||||||
i2c_slave_handle_t slaveHandle;
|
i2c_slave_handle_t slaveHandle;
|
||||||
@@ -23,7 +23,6 @@ static void i2cSlaveCallback(I2C_Type *base, i2c_slave_transfer_t *xfer, void *u
|
|||||||
{
|
{
|
||||||
dosBuffer[0] = xfer->event;
|
dosBuffer[0] = xfer->event;
|
||||||
dosBuffer[1] = userData;
|
dosBuffer[1] = userData;
|
||||||
DebugOverSpi_Send(dosBuffer, 2);
|
|
||||||
|
|
||||||
switch (xfer->event) {
|
switch (xfer->event) {
|
||||||
case kI2C_SlaveTransmitEvent:
|
case kI2C_SlaveTransmitEvent:
|
||||||
@@ -66,7 +65,7 @@ void initI2c(void)
|
|||||||
PORT_SetPinConfig(I2C_BUS_SCL_PORT, I2C_BUS_SCL_PIN, &pinConfig);
|
PORT_SetPinConfig(I2C_BUS_SCL_PORT, I2C_BUS_SCL_PIN, &pinConfig);
|
||||||
|
|
||||||
I2C_SlaveGetDefaultConfig(&slaveConfig);
|
I2C_SlaveGetDefaultConfig(&slaveConfig);
|
||||||
slaveConfig.slaveAddress = I2C_ADDRESS_LEFT_KEYBOARD_HALF_FIRMWARE;
|
slaveConfig.slaveAddress = I2C_ADDRESS_MODULE_FIRMWARE;
|
||||||
I2C_SlaveInit(I2C_BUS_BASEADDR, &slaveConfig);
|
I2C_SlaveInit(I2C_BUS_BASEADDR, &slaveConfig);
|
||||||
I2C_SlaveTransferCreateHandle(I2C_BUS_BASEADDR, &slaveHandle, i2cSlaveCallback, &userData);
|
I2C_SlaveTransferCreateHandle(I2C_BUS_BASEADDR, &slaveHandle, i2cSlaveCallback, &userData);
|
||||||
I2C_SlaveTransferNonBlocking(I2C_BUS_BASEADDR, &slaveHandle, kI2C_SlaveAddressMatchEvent);
|
I2C_SlaveTransferNonBlocking(I2C_BUS_BASEADDR, &slaveHandle, kI2C_SlaveAddressMatchEvent);
|
||||||
@@ -84,8 +83,7 @@ void InitPeripherals(void)
|
|||||||
{
|
{
|
||||||
initInterruptPriorities();
|
initInterruptPriorities();
|
||||||
InitLedDriver();
|
InitLedDriver();
|
||||||
InitTestLed();
|
TestLed_Init();
|
||||||
LedPwm_Init();
|
LedPwm_Init();
|
||||||
DebugOverSpi_Init();
|
|
||||||
initI2c();
|
initI2c();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,11 @@
|
|||||||
#include "fsl_lptmr.h"
|
#include "fsl_lptmr.h"
|
||||||
#include "key_scanner.h"
|
#include "key_scanner.h"
|
||||||
#include "config.h"
|
|
||||||
#include "i2c_watchdog.h"
|
#include "i2c_watchdog.h"
|
||||||
|
|
||||||
void KEY_SCANNER_HANDLER(void)
|
void KEY_SCANNER_HANDLER(void)
|
||||||
{
|
{
|
||||||
KeyMatrix_ScanRow(&keyMatrix);
|
KeyMatrix_ScanRow(&keyMatrix);
|
||||||
#ifdef I2C_WATCHDOG
|
|
||||||
RunWatchdog();
|
RunWatchdog();
|
||||||
#endif
|
|
||||||
LPTMR_ClearStatusFlags(KEY_SCANNER_LPTMR_BASEADDR, kLPTMR_TimerCompareFlag);
|
LPTMR_ClearStatusFlags(KEY_SCANNER_LPTMR_BASEADDR, kLPTMR_TimerCompareFlag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "init_clock.h"
|
#include "slave/init_clock.h"
|
||||||
#include "init_peripherals.h"
|
#include "init_peripherals.h"
|
||||||
#include "bootloader.h"
|
#include "bootloader.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "config.h"
|
|
||||||
#include "key_scanner.h"
|
#include "key_scanner.h"
|
||||||
|
#include "module.h"
|
||||||
|
|
||||||
DEFINE_BOOTLOADER_CONFIG_AREA(I2C_ADDRESS_LEFT_KEYBOARD_HALF_BOOTLOADER)
|
DEFINE_BOOTLOADER_CONFIG_AREA(I2C_ADDRESS_MODULE_BOOTLOADER)
|
||||||
|
|
||||||
key_matrix_t keyMatrix = {
|
key_matrix_t keyMatrix = {
|
||||||
.colNum = KEYBOARD_MATRIX_COLS_NUM,
|
.colNum = KEYBOARD_MATRIX_COLS_NUM,
|
||||||
@@ -15,11 +15,7 @@ key_matrix_t keyMatrix = {
|
|||||||
{PORTB, GPIOB, kCLOCK_PortB, 11},
|
{PORTB, GPIOB, kCLOCK_PortB, 11},
|
||||||
{PORTA, GPIOA, kCLOCK_PortA, 6},
|
{PORTA, GPIOA, kCLOCK_PortA, 6},
|
||||||
{PORTA, GPIOA, kCLOCK_PortA, 8},
|
{PORTA, GPIOA, kCLOCK_PortA, 8},
|
||||||
#ifdef DEBUG_OVER_SPI
|
|
||||||
{PORTA, GPIOA, kCLOCK_PortA, 8},
|
|
||||||
#else
|
|
||||||
{PORTB, GPIOB, kCLOCK_PortB, 0},
|
{PORTB, GPIOB, kCLOCK_PortB, 0},
|
||||||
#endif
|
|
||||||
{PORTB, GPIOB, kCLOCK_PortB, 6},
|
{PORTB, GPIOB, kCLOCK_PortB, 6},
|
||||||
{PORTA, GPIOA, kCLOCK_PortA, 3},
|
{PORTA, GPIOA, kCLOCK_PortA, 3},
|
||||||
{PORTA, GPIOA, kCLOCK_PortA, 12}
|
{PORTA, GPIOA, kCLOCK_PortA, 12}
|
||||||
@@ -28,11 +24,7 @@ key_matrix_t keyMatrix = {
|
|||||||
{PORTB, GPIOB, kCLOCK_PortB, 7},
|
{PORTB, GPIOB, kCLOCK_PortB, 7},
|
||||||
{PORTB, GPIOB, kCLOCK_PortB, 10},
|
{PORTB, GPIOB, kCLOCK_PortB, 10},
|
||||||
{PORTA, GPIOA, kCLOCK_PortA, 5},
|
{PORTA, GPIOA, kCLOCK_PortA, 5},
|
||||||
#ifdef DEBUG_OVER_SPI
|
|
||||||
{PORTA, GPIOA, kCLOCK_PortA, 5},
|
|
||||||
#else
|
|
||||||
{PORTA, GPIOA, kCLOCK_PortA, 7},
|
{PORTA, GPIOA, kCLOCK_PortA, 7},
|
||||||
#endif
|
|
||||||
{PORTA, GPIOA, kCLOCK_PortA, 4}
|
{PORTA, GPIOA, kCLOCK_PortA, 4}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
// Macros:
|
// Macros:
|
||||||
|
|
||||||
|
#define I2C_ADDRESS_MODULE_FIRMWARE I2C_ADDRESS_LEFT_KEYBOARD_HALF_FIRMWARE
|
||||||
|
#define I2C_ADDRESS_MODULE_BOOTLOADER I2C_ADDRESS_LEFT_KEYBOARD_HALF_BOOTLOADER
|
||||||
#define MODULE_PROTOCOL_VERSION 1
|
#define MODULE_PROTOCOL_VERSION 1
|
||||||
#define MODULE_ID ModuleId_LeftKeyboardHalf
|
#define MODULE_ID ModuleId_LeftKeyboardHalf
|
||||||
#define MODULE_KEY_COUNT (KEYBOARD_MATRIX_ROWS_NUM * KEYBOARD_MATRIX_COLS_NUM)
|
#define MODULE_KEY_COUNT (KEYBOARD_MATRIX_ROWS_NUM * KEYBOARD_MATRIX_COLS_NUM)
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ void SlaveRxHandler(void)
|
|||||||
case SlaveCommand_SetTestLed:
|
case SlaveCommand_SetTestLed:
|
||||||
TxMessage.length = 0;
|
TxMessage.length = 0;
|
||||||
bool isLedOn = RxMessage.data[1];
|
bool isLedOn = RxMessage.data[1];
|
||||||
TEST_LED_SET(isLedOn);
|
TestLed_Set(isLedOn);
|
||||||
break;
|
break;
|
||||||
case SlaveCommand_SetLedPwmBrightness:
|
case SlaveCommand_SetLedPwmBrightness:
|
||||||
TxMessage.length = 0;
|
TxMessage.length = 0;
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#include "test_led.h"
|
#include "test_led.h"
|
||||||
#include "fsl_port.h"
|
#include "fsl_port.h"
|
||||||
|
|
||||||
extern void InitTestLed(void)
|
extern void TestLed_Init(void)
|
||||||
{
|
{
|
||||||
CLOCK_EnableClock(TEST_LED_CLOCK);
|
CLOCK_EnableClock(TEST_LED_CLOCK);
|
||||||
PORT_SetPinMux(TEST_LED_PORT, TEST_LED_PIN, kPORT_MuxAsGpio);
|
PORT_SetPinMux(TEST_LED_PORT, TEST_LED_PIN, kPORT_MuxAsGpio);
|
||||||
GPIO_PinInit(TEST_LED_GPIO, TEST_LED_PIN, &(gpio_pin_config_t){kGPIO_DigitalOutput, 0});
|
GPIO_PinInit(TEST_LED_GPIO, TEST_LED_PIN, &(gpio_pin_config_t){kGPIO_DigitalOutput, 0});
|
||||||
TEST_LED_ON();
|
TestLed_On();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,13 +15,28 @@
|
|||||||
#define TEST_LED_CLOCK kCLOCK_PortB
|
#define TEST_LED_CLOCK kCLOCK_PortB
|
||||||
#define TEST_LED_PIN 13
|
#define TEST_LED_PIN 13
|
||||||
|
|
||||||
#define TEST_LED_ON() GPIO_SetPinsOutput(TEST_LED_GPIO, 1U << TEST_LED_PIN)
|
static inline void TestLed_On(void)
|
||||||
#define TEST_LED_OFF() GPIO_ClearPinsOutput(TEST_LED_GPIO, 1U << TEST_LED_PIN)
|
{
|
||||||
#define TEST_LED_SET(state) GPIO_WritePinOutput(TEST_LED_GPIO, TEST_LED_PIN, (state))
|
GPIO_SetPinsOutput(TEST_LED_GPIO, 1U << TEST_LED_PIN);
|
||||||
#define TEST_LED_TOGGLE() GPIO_TogglePinsOutput(TEST_LED_GPIO, 1U << TEST_LED_PIN)
|
}
|
||||||
|
|
||||||
|
static inline void TestLed_Off(void)
|
||||||
|
{
|
||||||
|
GPIO_ClearPinsOutput(TEST_LED_GPIO, 1U << TEST_LED_PIN);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void TestLed_Set(bool state)
|
||||||
|
{
|
||||||
|
GPIO_WritePinOutput(TEST_LED_GPIO, TEST_LED_PIN, state);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void TestLed_Toggle(void)
|
||||||
|
{
|
||||||
|
GPIO_TogglePinsOutput(TEST_LED_GPIO, 1U << TEST_LED_PIN);
|
||||||
|
}
|
||||||
|
|
||||||
// Functions:
|
// Functions:
|
||||||
|
|
||||||
void InitTestLed(void);
|
void TestLed_Init(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Submodule lib/agent updated: ab8ae31324...fae83a4148
@@ -38,7 +38,7 @@ JLINK_SCRIPT = ../scripts/flash-right.jlink
|
|||||||
BUILD_FLAGS = -DCPU_$(PART)_cm4 -DUSB_STACK_BM -DBL_HAS_BOOTLOADER_CONFIG=1
|
BUILD_FLAGS = -DCPU_$(PART)_cm4 -DUSB_STACK_BM -DBL_HAS_BOOTLOADER_CONFIG=1
|
||||||
|
|
||||||
# Address of the app vector table. The bootloader will take up the flash before this address.
|
# Address of the app vector table. The bootloader will take up the flash before this address.
|
||||||
BL_APP_VECTOR_TABLE_ADDRESS = 0xc000
|
BL_APP_VECTOR_TABLE_ADDRESS ?= 0xc000
|
||||||
|
|
||||||
# Source files.
|
# Source files.
|
||||||
SOURCE = $(wildcard src/*.c) \
|
SOURCE = $(wildcard src/*.c) \
|
||||||
|
|||||||
@@ -457,4 +457,87 @@
|
|||||||
<resource resourceType="PROJECT" workspacePath="/uhk-right"/>
|
<resource resourceType="PROJECT" workspacePath="/uhk-right"/>
|
||||||
</configuration>
|
</configuration>
|
||||||
</storageModule>
|
</storageModule>
|
||||||
|
<storageModule moduleId="com.crt.config">
|
||||||
|
<projectStorage><?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<TargetConfig>
|
||||||
|
<Properties property_3="NXP" property_4="MK22FN512xxx12" property_count="5" version="100200"/>
|
||||||
|
<infoList vendor="NXP"><info chip="MK22FN512xxx12" name="MK22FN512xxx12"><chip><name>MK22FN512xxx12</name>
|
||||||
|
<family>K2x</family>
|
||||||
|
<vendor>NXP</vendor>
|
||||||
|
<memory can_program="true" id="Flash" is_ro="true" size="0" type="Flash"/>
|
||||||
|
<memory id="RAM" size="0" type="RAM"/>
|
||||||
|
<memoryInstance derived_from="Flash" driver="FTFA_2K.cfx" id="PROGRAM_FLASH" location="0x00000000" size="0x00080000"/>
|
||||||
|
<memoryInstance derived_from="RAM" id="SRAM_UPPER" location="0x20000000" size="0x00010000"/>
|
||||||
|
<memoryInstance derived_from="RAM" id="SRAM_LOWER" location="0x1fff0000" size="0x00010000"/>
|
||||||
|
<peripheralInstance derived_from="FTFA-FlashConfig" determined="infoFile" id="FTFA-FlashConfig" location="0x400"/>
|
||||||
|
<peripheralInstance derived_from="DMA" determined="infoFile" id="DMA" location="0x40008000"/>
|
||||||
|
<peripheralInstance derived_from="FB" determined="infoFile" id="FB" location="0x4000C000"/>
|
||||||
|
<peripheralInstance derived_from="FMC" determined="infoFile" id="FMC" location="0x4001F000"/>
|
||||||
|
<peripheralInstance derived_from="FTFA" determined="infoFile" id="FTFA" location="0x40020000"/>
|
||||||
|
<peripheralInstance derived_from="DMAMUX" determined="infoFile" id="DMAMUX" location="0x40021000"/>
|
||||||
|
<peripheralInstance derived_from="FTM0" determined="infoFile" id="FTM0" location="0x40038000"/>
|
||||||
|
<peripheralInstance derived_from="FTM1" determined="infoFile" id="FTM1" location="0x40039000"/>
|
||||||
|
<peripheralInstance derived_from="FTM2" determined="infoFile" id="FTM2" location="0x4003A000"/>
|
||||||
|
<peripheralInstance derived_from="FTM3" determined="infoFile" id="FTM3" location="0x40026000"/>
|
||||||
|
<peripheralInstance derived_from="ADC0" determined="infoFile" id="ADC0" location="0x4003B000"/>
|
||||||
|
<peripheralInstance derived_from="ADC1" determined="infoFile" id="ADC1" location="0x40027000"/>
|
||||||
|
<peripheralInstance derived_from="DAC0" determined="infoFile" id="DAC0" location="0x4003F000"/>
|
||||||
|
<peripheralInstance derived_from="DAC1" determined="infoFile" id="DAC1" location="0x40028000"/>
|
||||||
|
<peripheralInstance derived_from="RNG" determined="infoFile" id="RNG" location="0x40029000"/>
|
||||||
|
<peripheralInstance derived_from="LPUART0" determined="infoFile" id="LPUART0" location="0x4002A000"/>
|
||||||
|
<peripheralInstance derived_from="SPI0" determined="infoFile" id="SPI0" location="0x4002C000"/>
|
||||||
|
<peripheralInstance derived_from="SPI1" determined="infoFile" id="SPI1" location="0x4002D000"/>
|
||||||
|
<peripheralInstance derived_from="I2S0" determined="infoFile" id="I2S0" location="0x4002F000"/>
|
||||||
|
<peripheralInstance derived_from="CRC" determined="infoFile" id="CRC" location="0x40032000"/>
|
||||||
|
<peripheralInstance derived_from="PDB0" determined="infoFile" id="PDB0" location="0x40036000"/>
|
||||||
|
<peripheralInstance derived_from="PIT" determined="infoFile" id="PIT" location="0x40037000"/>
|
||||||
|
<peripheralInstance derived_from="RTC" determined="infoFile" id="RTC" location="0x4003D000"/>
|
||||||
|
<peripheralInstance derived_from="RFVBAT" determined="infoFile" id="RFVBAT" location="0x4003E000"/>
|
||||||
|
<peripheralInstance derived_from="LPTMR0" determined="infoFile" id="LPTMR0" location="0x40040000"/>
|
||||||
|
<peripheralInstance derived_from="RFSYS" determined="infoFile" id="RFSYS" location="0x40041000"/>
|
||||||
|
<peripheralInstance derived_from="SIM" determined="infoFile" id="SIM" location="0x40047000"/>
|
||||||
|
<peripheralInstance derived_from="PORTA" determined="infoFile" id="PORTA" location="0x40049000"/>
|
||||||
|
<peripheralInstance derived_from="PORTB" determined="infoFile" id="PORTB" location="0x4004A000"/>
|
||||||
|
<peripheralInstance derived_from="PORTC" determined="infoFile" id="PORTC" location="0x4004B000"/>
|
||||||
|
<peripheralInstance derived_from="PORTD" determined="infoFile" id="PORTD" location="0x4004C000"/>
|
||||||
|
<peripheralInstance derived_from="PORTE" determined="infoFile" id="PORTE" location="0x4004D000"/>
|
||||||
|
<peripheralInstance derived_from="WDOG" determined="infoFile" id="WDOG" location="0x40052000"/>
|
||||||
|
<peripheralInstance derived_from="EWM" determined="infoFile" id="EWM" location="0x40061000"/>
|
||||||
|
<peripheralInstance derived_from="MCG" determined="infoFile" id="MCG" location="0x40064000"/>
|
||||||
|
<peripheralInstance derived_from="OSC" determined="infoFile" id="OSC" location="0x40065000"/>
|
||||||
|
<peripheralInstance derived_from="I2C0" determined="infoFile" id="I2C0" location="0x40066000"/>
|
||||||
|
<peripheralInstance derived_from="I2C1" determined="infoFile" id="I2C1" location="0x40067000"/>
|
||||||
|
<peripheralInstance derived_from="UART0" determined="infoFile" id="UART0" location="0x4006A000"/>
|
||||||
|
<peripheralInstance derived_from="UART1" determined="infoFile" id="UART1" location="0x4006B000"/>
|
||||||
|
<peripheralInstance derived_from="UART2" determined="infoFile" id="UART2" location="0x4006C000"/>
|
||||||
|
<peripheralInstance derived_from="USB0" determined="infoFile" id="USB0" location="0x40072000"/>
|
||||||
|
<peripheralInstance derived_from="CMP0" determined="infoFile" id="CMP0" location="0x40073000"/>
|
||||||
|
<peripheralInstance derived_from="CMP1" determined="infoFile" id="CMP1" location="0x40073008"/>
|
||||||
|
<peripheralInstance derived_from="VREF" determined="infoFile" id="VREF" location="0x40074000"/>
|
||||||
|
<peripheralInstance derived_from="LLWU" determined="infoFile" id="LLWU" location="0x4007C000"/>
|
||||||
|
<peripheralInstance derived_from="PMC" determined="infoFile" id="PMC" location="0x4007D000"/>
|
||||||
|
<peripheralInstance derived_from="SMC" determined="infoFile" id="SMC" location="0x4007E000"/>
|
||||||
|
<peripheralInstance derived_from="RCM" determined="infoFile" id="RCM" location="0x4007F000"/>
|
||||||
|
<peripheralInstance derived_from="GPIOA" determined="infoFile" id="GPIOA" location="0x400FF000"/>
|
||||||
|
<peripheralInstance derived_from="GPIOB" determined="infoFile" id="GPIOB" location="0x400FF040"/>
|
||||||
|
<peripheralInstance derived_from="GPIOC" determined="infoFile" id="GPIOC" location="0x400FF080"/>
|
||||||
|
<peripheralInstance derived_from="GPIOD" determined="infoFile" id="GPIOD" location="0x400FF0C0"/>
|
||||||
|
<peripheralInstance derived_from="GPIOE" determined="infoFile" id="GPIOE" location="0x400FF100"/>
|
||||||
|
<peripheralInstance derived_from="SystemControl" determined="infoFile" id="SystemControl" location="0xE000E000"/>
|
||||||
|
<peripheralInstance derived_from="SysTick" determined="infoFile" id="SysTick" location="0xE000E010"/>
|
||||||
|
<peripheralInstance derived_from="NVIC" determined="infoFile" id="NVIC" location="0xE000E100"/>
|
||||||
|
<peripheralInstance derived_from="MCM" determined="infoFile" id="MCM" location="0xE0080000"/>
|
||||||
|
</chip>
|
||||||
|
<processor><name gcc_name="cortex-m4">Cortex-M4</name>
|
||||||
|
<family>Cortex-M</family>
|
||||||
|
</processor>
|
||||||
|
<link href="MK22F51212_internal_peripheral.xml" show="embed" type="simple"/>
|
||||||
|
</info>
|
||||||
|
</infoList>
|
||||||
|
</TargetConfig></projectStorage>
|
||||||
|
</storageModule>
|
||||||
|
<storageModule moduleId="com.nxp.mcuxpresso.core.datamodels">
|
||||||
|
<sdkName>SDK_2.x_MK22FN512xxx12</sdkName>
|
||||||
|
<sdkVersion>2.2.0</sdkVersion>
|
||||||
|
</storageModule>
|
||||||
</cproject>
|
</cproject>
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ static parser_error_t parseKeyStrokeAction(key_action_t *keyAction, uint8_t keyS
|
|||||||
static parser_error_t parseSwitchLayerAction(key_action_t *KeyAction, config_buffer_t *buffer)
|
static parser_error_t parseSwitchLayerAction(key_action_t *KeyAction, config_buffer_t *buffer)
|
||||||
{
|
{
|
||||||
uint8_t layer = ReadUInt8(buffer) + 1;
|
uint8_t layer = ReadUInt8(buffer) + 1;
|
||||||
uint8_t mode = ReadBool(buffer) ? SwitchLayerMode_Toggle : SwitchLayerMode_HoldAndDoubleTapToggle;
|
switch_layer_mode_t mode = ReadUInt8(buffer);
|
||||||
|
|
||||||
KeyAction->type = KeyActionType_SwitchLayer;
|
KeyAction->type = KeyActionType_SwitchLayer;
|
||||||
KeyAction->switchLayer.layer = layer;
|
KeyAction->switchLayer.layer = layer;
|
||||||
|
|||||||
@@ -48,10 +48,12 @@
|
|||||||
SerializedMouseAction_ScrollRight,
|
SerializedMouseAction_ScrollRight,
|
||||||
SerializedMouseAction_Accelerate,
|
SerializedMouseAction_Accelerate,
|
||||||
SerializedMouseAction_Decelerate,
|
SerializedMouseAction_Decelerate,
|
||||||
SerializedMouseAction_Last = SerializedMouseAction_Decelerate,
|
|
||||||
SerializedMouseAction_Button_4,
|
SerializedMouseAction_Button_4,
|
||||||
SerializedMouseAction_Button_5,
|
SerializedMouseAction_Button_5,
|
||||||
SerializedMouseAction_Button_6,
|
SerializedMouseAction_Button_6,
|
||||||
|
SerializedMouseAction_Button_7,
|
||||||
|
SerializedMouseAction_Button_8,
|
||||||
|
SerializedMouseAction_Last = SerializedMouseAction_Button_8,
|
||||||
} serialized_mouse_action_t;
|
} serialized_mouse_action_t;
|
||||||
|
|
||||||
// Functions:
|
// Functions:
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ parser_error_t parseScrollMouseMacroAction(config_buffer_t *buffer, macro_action
|
|||||||
|
|
||||||
parser_error_t parseDelayMacroAction(config_buffer_t *buffer, macro_action_t *macroAction)
|
parser_error_t parseDelayMacroAction(config_buffer_t *buffer, macro_action_t *macroAction)
|
||||||
{
|
{
|
||||||
int16_t delay = ReadInt16(buffer);
|
uint16_t delay = ReadUInt16(buffer);
|
||||||
|
|
||||||
macroAction->type = MacroActionType_Delay;
|
macroAction->type = MacroActionType_Delay;
|
||||||
macroAction->delay.delay = delay;
|
macroAction->delay.delay = delay;
|
||||||
|
|||||||
@@ -35,10 +35,12 @@
|
|||||||
#define I2C_EEPROM_BUS_BAUD_RATE 1000000 // 1 Mhz is the maximum speed of the EEPROM.
|
#define I2C_EEPROM_BUS_BAUD_RATE 1000000 // 1 Mhz is the maximum speed of the EEPROM.
|
||||||
#define I2C_EEPROM_BUS_MUX kPORT_MuxAlt2
|
#define I2C_EEPROM_BUS_MUX kPORT_MuxAlt2
|
||||||
|
|
||||||
|
#define I2C_EEPROM_BUS_SDA_GPIO GPIOC
|
||||||
#define I2C_EEPROM_BUS_SDA_PORT PORTC
|
#define I2C_EEPROM_BUS_SDA_PORT PORTC
|
||||||
#define I2C_EEPROM_BUS_SDA_CLOCK kCLOCK_PortC
|
#define I2C_EEPROM_BUS_SDA_CLOCK kCLOCK_PortC
|
||||||
#define I2C_EEPROM_BUS_SDA_PIN 11
|
#define I2C_EEPROM_BUS_SDA_PIN 11
|
||||||
|
|
||||||
|
#define I2C_EEPROM_BUS_SCL_GPIO GPIOC
|
||||||
#define I2C_EEPROM_BUS_SCL_PORT PORTC
|
#define I2C_EEPROM_BUS_SCL_PORT PORTC
|
||||||
#define I2C_EEPROM_BUS_SCL_CLOCK kCLOCK_PortC
|
#define I2C_EEPROM_BUS_SCL_CLOCK kCLOCK_PortC
|
||||||
#define I2C_EEPROM_BUS_SCL_PIN 10
|
#define I2C_EEPROM_BUS_SCL_PIN 10
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include "i2c.h"
|
#include "i2c.h"
|
||||||
#include "i2c_watchdog.h"
|
#include "i2c_watchdog.h"
|
||||||
#include "init_peripherals.h"
|
#include "init_peripherals.h"
|
||||||
|
#include "peripherals/test_led.h"
|
||||||
|
|
||||||
uint32_t I2cWatchdog_WatchCounter;
|
uint32_t I2cWatchdog_WatchCounter;
|
||||||
uint32_t I2cWatchdog_RecoveryCounter;
|
uint32_t I2cWatchdog_RecoveryCounter;
|
||||||
@@ -26,6 +27,7 @@ void PIT_I2C_WATCHDOG_HANDLER(void)
|
|||||||
|
|
||||||
prevWatchdogCounter = I2C_Watchdog;
|
prevWatchdogCounter = I2C_Watchdog;
|
||||||
PIT_ClearStatusFlags(PIT, PIT_I2C_WATCHDOG_CHANNEL, PIT_TFLG_TIF_MASK);
|
PIT_ClearStatusFlags(PIT, PIT_I2C_WATCHDOG_CHANNEL, PIT_TFLG_TIF_MASK);
|
||||||
|
TestLed_Toggle();
|
||||||
}
|
}
|
||||||
|
|
||||||
void InitI2cWatchdog(void)
|
void InitI2cWatchdog(void)
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
#include "init_peripherals.h"
|
#include "init_peripherals.h"
|
||||||
#include "eeprom.h"
|
#include "eeprom.h"
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
#include "key_debouncer.h"
|
|
||||||
#include "usb_api.h"
|
#include "usb_api.h"
|
||||||
#include "slave_scheduler.h"
|
#include "slave_scheduler.h"
|
||||||
#include "bootloader/wormhole.h"
|
#include "bootloader/wormhole.h"
|
||||||
@@ -21,6 +20,38 @@ bool IsBusPalOn;
|
|||||||
volatile uint32_t I2cMainBusRequestedBaudRateBps = I2C_MAIN_BUS_NORMAL_BAUD_RATE;
|
volatile uint32_t I2cMainBusRequestedBaudRateBps = I2C_MAIN_BUS_NORMAL_BAUD_RATE;
|
||||||
volatile uint32_t I2cMainBusActualBaudRateBps;
|
volatile uint32_t I2cMainBusActualBaudRateBps;
|
||||||
|
|
||||||
|
static i2c_bus_t i2cMainBus = {
|
||||||
|
.baseAddr = I2C_MAIN_BUS_BASEADDR,
|
||||||
|
.clockSrc = I2C_MAIN_BUS_CLK_SRC,
|
||||||
|
.mux = I2C_MAIN_BUS_MUX,
|
||||||
|
|
||||||
|
.sdaClock = I2C_MAIN_BUS_SDA_CLOCK,
|
||||||
|
.sdaGpio = I2C_MAIN_BUS_SDA_GPIO,
|
||||||
|
.sdaPort = I2C_MAIN_BUS_SDA_PORT,
|
||||||
|
.sdaPin = I2C_MAIN_BUS_SDA_PIN,
|
||||||
|
|
||||||
|
.sclClock = I2C_MAIN_BUS_SCL_CLOCK,
|
||||||
|
.sclGpio = I2C_MAIN_BUS_SCL_GPIO,
|
||||||
|
.sclPort = I2C_MAIN_BUS_SCL_PORT,
|
||||||
|
.sclPin = I2C_MAIN_BUS_SCL_PIN,
|
||||||
|
};
|
||||||
|
|
||||||
|
static i2c_bus_t i2cEepromBus = {
|
||||||
|
.baseAddr = I2C_EEPROM_BUS_BASEADDR,
|
||||||
|
.clockSrc = I2C_EEPROM_BUS_CLK_SRC,
|
||||||
|
.mux = I2C_EEPROM_BUS_MUX,
|
||||||
|
|
||||||
|
.sdaClock = I2C_EEPROM_BUS_SDA_CLOCK,
|
||||||
|
.sdaGpio = I2C_EEPROM_BUS_SDA_GPIO,
|
||||||
|
.sdaPort = I2C_EEPROM_BUS_SDA_PORT,
|
||||||
|
.sdaPin = I2C_EEPROM_BUS_SDA_PIN,
|
||||||
|
|
||||||
|
.sclClock = I2C_EEPROM_BUS_SCL_CLOCK,
|
||||||
|
.sclGpio = I2C_EEPROM_BUS_SCL_GPIO,
|
||||||
|
.sclPort = I2C_EEPROM_BUS_SCL_PORT,
|
||||||
|
.sclPin = I2C_EEPROM_BUS_SCL_PIN,
|
||||||
|
};
|
||||||
|
|
||||||
static void initBusPalState(void) {
|
static void initBusPalState(void) {
|
||||||
IsBusPalOn = Wormhole.magicNumber == WORMHOLE_MAGIC_NUMBER && Wormhole.enumerationMode == EnumerationMode_BusPal;
|
IsBusPalOn = Wormhole.magicNumber == WORMHOLE_MAGIC_NUMBER && Wormhole.enumerationMode == EnumerationMode_BusPal;
|
||||||
if (IsBusPalOn) {
|
if (IsBusPalOn) {
|
||||||
@@ -32,12 +63,10 @@ static void initBusPalState(void) {
|
|||||||
static void initInterruptPriorities(void)
|
static void initInterruptPriorities(void)
|
||||||
{
|
{
|
||||||
NVIC_SetPriority(PIT_I2C_WATCHDOG_IRQ_ID, 1);
|
NVIC_SetPriority(PIT_I2C_WATCHDOG_IRQ_ID, 1);
|
||||||
NVIC_SetPriority(PIT_TIMER_IRQ_ID, 2);
|
NVIC_SetPriority(I2C_EEPROM_BUS_IRQ_ID, 0);
|
||||||
NVIC_SetPriority(I2C_EEPROM_BUS_IRQ_ID, 2);
|
NVIC_SetPriority(PIT_TIMER_IRQ_ID, 3);
|
||||||
NVIC_SetPriority(PIT_KEY_SCANNER_IRQ_ID, 3);
|
NVIC_SetPriority(I2C_MAIN_BUS_IRQ_ID, 4);
|
||||||
NVIC_SetPriority(PIT_KEY_DEBOUNCER_IRQ_ID, 3);
|
NVIC_SetPriority(USB_IRQ_ID, 4);
|
||||||
NVIC_SetPriority(I2C_MAIN_BUS_IRQ_ID, 3);
|
|
||||||
NVIC_SetPriority(USB_IRQ_ID, 3);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void delay(void)
|
static void delay(void)
|
||||||
@@ -45,91 +74,73 @@ static void delay(void)
|
|||||||
for (volatile uint32_t i=0; i<62; i++);
|
for (volatile uint32_t i=0; i<62; i++);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void recoverI2c(void)
|
static void recoverI2cBus(i2c_bus_t *i2cBus)
|
||||||
{
|
{
|
||||||
PORT_SetPinMux(I2C_MAIN_BUS_SDA_PORT, I2C_MAIN_BUS_SDA_PIN, kPORT_MuxAsGpio);
|
PORT_SetPinMux(i2cBus->sdaPort, i2cBus->sdaPin, kPORT_MuxAsGpio);
|
||||||
PORT_SetPinMux(I2C_MAIN_BUS_SCL_PORT, I2C_MAIN_BUS_SCL_PIN, kPORT_MuxAsGpio);
|
PORT_SetPinMux(i2cBus->sclPort, i2cBus->sclPin, kPORT_MuxAsGpio);
|
||||||
GPIO_PinInit(I2C_MAIN_BUS_SCL_GPIO, I2C_MAIN_BUS_SCL_PIN, &(gpio_pin_config_t){kGPIO_DigitalOutput, 1});
|
GPIO_PinInit(i2cBus->sclGpio, i2cBus->sclPin, &(gpio_pin_config_t){kGPIO_DigitalOutput, 1});
|
||||||
|
|
||||||
bool isOn = true;
|
bool isOn = true;
|
||||||
for (int i=0; i<20; i++) {
|
for (int i=0; i<20; i++) {
|
||||||
GPIO_PinInit(I2C_MAIN_BUS_SDA_GPIO, I2C_MAIN_BUS_SDA_PIN, &(gpio_pin_config_t){kGPIO_DigitalInput});
|
GPIO_PinInit(i2cBus->sdaGpio, i2cBus->sdaPin, &(gpio_pin_config_t){kGPIO_DigitalInput});
|
||||||
bool isSdaHigh = GPIO_ReadPinInput(I2C_MAIN_BUS_SDA_GPIO, I2C_MAIN_BUS_SDA_PIN);
|
bool isSdaHigh = GPIO_ReadPinInput(i2cBus->sdaGpio, i2cBus->sdaPin);
|
||||||
GPIO_PinInit(I2C_MAIN_BUS_SDA_GPIO, I2C_MAIN_BUS_SDA_PIN, &(gpio_pin_config_t){kGPIO_DigitalOutput, 1});
|
GPIO_PinInit(i2cBus->sdaGpio, i2cBus->sdaPin, &(gpio_pin_config_t){kGPIO_DigitalOutput, 1});
|
||||||
|
|
||||||
if (isSdaHigh) {
|
if (isSdaHigh) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
GPIO_WritePinOutput(I2C_MAIN_BUS_SCL_GPIO, I2C_MAIN_BUS_SCL_PIN, isOn);
|
GPIO_WritePinOutput(i2cBus->sclGpio, i2cBus->sclPin, isOn);
|
||||||
delay();
|
delay();
|
||||||
isOn = !isOn;
|
isOn = !isOn;
|
||||||
}
|
}
|
||||||
|
|
||||||
GPIO_WritePinOutput(I2C_MAIN_BUS_SDA_GPIO, I2C_MAIN_BUS_SDA_PIN, 0);
|
GPIO_WritePinOutput(i2cBus->sdaGpio, i2cBus->sdaPin, 0);
|
||||||
delay();
|
delay();
|
||||||
GPIO_WritePinOutput(I2C_MAIN_BUS_SCL_GPIO, I2C_MAIN_BUS_SCL_PIN, 1);
|
GPIO_WritePinOutput(i2cBus->sclGpio, i2cBus->sclPin, 1);
|
||||||
delay();
|
delay();
|
||||||
GPIO_WritePinOutput(I2C_MAIN_BUS_SDA_GPIO, I2C_MAIN_BUS_SDA_PIN, 1);
|
GPIO_WritePinOutput(i2cBus->sdaGpio, i2cBus->sdaPin, 1);
|
||||||
delay();
|
delay();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void initI2cMainBus(void)
|
static void initI2cBus(i2c_bus_t *i2cBus)
|
||||||
{
|
{
|
||||||
CLOCK_EnableClock(I2C_MAIN_BUS_SDA_CLOCK);
|
CLOCK_EnableClock(i2cBus->sdaClock);
|
||||||
CLOCK_EnableClock(I2C_MAIN_BUS_SCL_CLOCK);
|
CLOCK_EnableClock(i2cBus->sclClock);
|
||||||
|
|
||||||
recoverI2c();
|
recoverI2cBus(i2cBus);
|
||||||
|
|
||||||
port_pin_config_t pinConfig = {
|
port_pin_config_t pinConfig = {
|
||||||
.pullSelect = kPORT_PullUp,
|
.pullSelect = kPORT_PullUp,
|
||||||
.openDrainEnable = kPORT_OpenDrainEnable,
|
.openDrainEnable = kPORT_OpenDrainEnable,
|
||||||
.mux = I2C_MAIN_BUS_MUX,
|
.mux = i2cBus->mux,
|
||||||
};
|
};
|
||||||
|
|
||||||
PORT_SetPinConfig(I2C_MAIN_BUS_SDA_PORT, I2C_MAIN_BUS_SDA_PIN, &pinConfig);
|
PORT_SetPinConfig(i2cBus->sdaPort, i2cBus->sdaPin, &pinConfig);
|
||||||
PORT_SetPinConfig(I2C_MAIN_BUS_SCL_PORT, I2C_MAIN_BUS_SCL_PIN, &pinConfig);
|
PORT_SetPinConfig(i2cBus->sclPort, i2cBus->sclPin, &pinConfig);
|
||||||
|
|
||||||
i2c_master_config_t masterConfig;
|
i2c_master_config_t masterConfig;
|
||||||
I2C_MasterGetDefaultConfig(&masterConfig);
|
I2C_MasterGetDefaultConfig(&masterConfig);
|
||||||
masterConfig.baudRate_Bps = I2cMainBusRequestedBaudRateBps;
|
masterConfig.baudRate_Bps = i2cBus == &i2cMainBus ? I2cMainBusRequestedBaudRateBps : I2C_EEPROM_BUS_BAUD_RATE;
|
||||||
uint32_t sourceClock = CLOCK_GetFreq(I2C_MAIN_BUS_CLK_SRC);
|
uint32_t sourceClock = CLOCK_GetFreq(i2cBus->clockSrc);
|
||||||
I2C_MasterInit(I2C_MAIN_BUS_BASEADDR, &masterConfig, sourceClock);
|
I2C_MasterInit(i2cBus->baseAddr, &masterConfig, sourceClock);
|
||||||
I2cMainBusActualBaudRateBps = I2C_ActualBaudRate;
|
|
||||||
|
if (i2cBus == &i2cMainBus) {
|
||||||
|
I2cMainBusActualBaudRateBps = I2C_ActualBaudRate;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReinitI2cMainBus(void)
|
void ReinitI2cMainBus(void)
|
||||||
{
|
{
|
||||||
I2C_MasterDeinit(I2C_MAIN_BUS_BASEADDR);
|
I2C_MasterDeinit(I2C_MAIN_BUS_BASEADDR);
|
||||||
initI2cMainBus();
|
initI2cBus(&i2cMainBus);
|
||||||
InitSlaveScheduler();
|
InitSlaveScheduler();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void initI2cEepromBus(void)
|
|
||||||
{
|
|
||||||
port_pin_config_t pinConfig = {
|
|
||||||
.pullSelect = kPORT_PullUp,
|
|
||||||
.openDrainEnable = kPORT_OpenDrainEnable,
|
|
||||||
.mux = I2C_EEPROM_BUS_MUX,
|
|
||||||
};
|
|
||||||
|
|
||||||
CLOCK_EnableClock(I2C_EEPROM_BUS_SDA_CLOCK);
|
|
||||||
CLOCK_EnableClock(I2C_EEPROM_BUS_SCL_CLOCK);
|
|
||||||
|
|
||||||
PORT_SetPinConfig(I2C_EEPROM_BUS_SDA_PORT, I2C_EEPROM_BUS_SDA_PIN, &pinConfig);
|
|
||||||
PORT_SetPinConfig(I2C_EEPROM_BUS_SCL_PORT, I2C_EEPROM_BUS_SCL_PIN, &pinConfig);
|
|
||||||
|
|
||||||
i2c_master_config_t masterConfig;
|
|
||||||
I2C_MasterGetDefaultConfig(&masterConfig);
|
|
||||||
masterConfig.baudRate_Bps = I2C_EEPROM_BUS_BAUD_RATE;
|
|
||||||
uint32_t sourceClock = CLOCK_GetFreq(I2C_EEPROM_BUS_CLK_SRC);
|
|
||||||
I2C_MasterInit(I2C_EEPROM_BUS_BASEADDR, &masterConfig, sourceClock);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void initI2c(void)
|
static void initI2c(void)
|
||||||
{
|
{
|
||||||
initI2cMainBus();
|
initI2cBus(&i2cMainBus);
|
||||||
initI2cEepromBus();
|
initI2cBus(&i2cEepromBus);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InitPeripherals(void)
|
void InitPeripherals(void)
|
||||||
@@ -142,9 +153,8 @@ void InitPeripherals(void)
|
|||||||
InitMergeSensor();
|
InitMergeSensor();
|
||||||
ADC_Init();
|
ADC_Init();
|
||||||
initI2c();
|
initI2c();
|
||||||
InitTestLed();
|
TestLed_Init();
|
||||||
LedPwm_Init();
|
LedPwm_Init();
|
||||||
InitI2cWatchdog();
|
InitI2cWatchdog();
|
||||||
InitKeyDebouncer();
|
|
||||||
EEPROM_Init();
|
EEPROM_Init();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,28 @@
|
|||||||
#ifndef __INIT_PERIPHERALS_H__
|
#ifndef __INIT_PERIPHERALS_H__
|
||||||
#define __INIT_PERIPHERALS_H__
|
#define __INIT_PERIPHERALS_H__
|
||||||
|
|
||||||
// Includes
|
// Includes:
|
||||||
|
|
||||||
#include "fsl_common.h"
|
#include "fsl_common.h"
|
||||||
|
|
||||||
|
// Typedefs:
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
clock_name_t clockSrc;
|
||||||
|
I2C_Type *baseAddr;
|
||||||
|
uint16_t mux;
|
||||||
|
|
||||||
|
clock_ip_name_t sdaClock;
|
||||||
|
GPIO_Type *sdaGpio;
|
||||||
|
PORT_Type *sdaPort;
|
||||||
|
uint32_t sdaPin;
|
||||||
|
|
||||||
|
clock_ip_name_t sclClock;
|
||||||
|
GPIO_Type *sclGpio;
|
||||||
|
PORT_Type *sclPort;
|
||||||
|
uint32_t sclPin;
|
||||||
|
} i2c_bus_t;
|
||||||
|
|
||||||
// Variables:
|
// Variables:
|
||||||
|
|
||||||
extern bool IsBusPalOn;
|
extern bool IsBusPalOn;
|
||||||
|
|||||||
@@ -28,9 +28,9 @@
|
|||||||
} keystroke_type_t;
|
} keystroke_type_t;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
SwitchLayerMode_Hold,
|
|
||||||
SwitchLayerMode_HoldAndDoubleTapToggle,
|
SwitchLayerMode_HoldAndDoubleTapToggle,
|
||||||
SwitchLayerMode_Toggle,
|
SwitchLayerMode_Toggle,
|
||||||
|
SwitchLayerMode_Hold,
|
||||||
} switch_layer_mode_t;
|
} switch_layer_mode_t;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
#include "key_debouncer.h"
|
|
||||||
#include "fsl_pit.h"
|
|
||||||
#include "slot.h"
|
|
||||||
#include "module.h"
|
|
||||||
#include "key_states.h"
|
|
||||||
#include "peripherals/test_led.h"
|
|
||||||
|
|
||||||
void PIT_KEY_DEBOUNCER_HANDLER(void)
|
|
||||||
{
|
|
||||||
TEST_LED_TOGGLE();
|
|
||||||
for (uint8_t slotId=0; slotId<SLOT_COUNT; slotId++) {
|
|
||||||
for (uint8_t keyId=0; keyId<MAX_KEY_COUNT_PER_MODULE; keyId++) {
|
|
||||||
uint8_t *debounceCounter = &KeyStates[slotId][keyId].debounceCounter;
|
|
||||||
if (*debounceCounter < 0xff) {
|
|
||||||
(*debounceCounter)++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
PIT_ClearStatusFlags(PIT, PIT_KEY_DEBOUNCER_CHANNEL, PIT_TFLG_TIF_MASK);
|
|
||||||
}
|
|
||||||
|
|
||||||
void InitKeyDebouncer(void)
|
|
||||||
{
|
|
||||||
pit_config_t pitConfig;
|
|
||||||
PIT_GetDefaultConfig(&pitConfig);
|
|
||||||
PIT_Init(PIT, &pitConfig);
|
|
||||||
PIT_SetTimerPeriod(PIT, PIT_KEY_DEBOUNCER_CHANNEL, MSEC_TO_COUNT(KEY_DEBOUNCER_INTERVAL_MSEC, PIT_SOURCE_CLOCK));
|
|
||||||
PIT_EnableInterrupts(PIT, PIT_KEY_DEBOUNCER_CHANNEL, kPIT_TimerInterruptEnable);
|
|
||||||
EnableIRQ(PIT_KEY_DEBOUNCER_IRQ_ID);
|
|
||||||
PIT_StartTimer(PIT, PIT_KEY_DEBOUNCER_CHANNEL);
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
#ifndef __KEY_DEBOUNCER_H__
|
|
||||||
#define __KEY_DEBOUNCER_H__
|
|
||||||
|
|
||||||
// Includes:
|
|
||||||
|
|
||||||
#include "peripherals/pit.h"
|
|
||||||
#include "fsl_common.h"
|
|
||||||
|
|
||||||
// Macros:
|
|
||||||
|
|
||||||
#define KEY_DEBOUNCER_INTERVAL_MSEC 1
|
|
||||||
#define KEY_DEBOUNCER_TIMEOUT_MSEC 80
|
|
||||||
|
|
||||||
// Functions:
|
|
||||||
|
|
||||||
void InitKeyDebouncer(void);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
#include "fsl_pit.h"
|
|
||||||
#include "key_scanner.h"
|
|
||||||
|
|
||||||
uint32_t KeyScannerCounter;
|
|
||||||
|
|
||||||
void PIT_KEY_SCANNER_HANDLER(void)
|
|
||||||
{
|
|
||||||
KeyMatrix_ScanRow(&RightKeyMatrix);
|
|
||||||
KeyScannerCounter++;
|
|
||||||
PIT_ClearStatusFlags(PIT, PIT_KEY_SCANNER_CHANNEL, PIT_TFLG_TIF_MASK);
|
|
||||||
}
|
|
||||||
|
|
||||||
void InitKeyScanner(void)
|
|
||||||
{
|
|
||||||
pit_config_t pitConfig;
|
|
||||||
PIT_GetDefaultConfig(&pitConfig);
|
|
||||||
PIT_Init(PIT, &pitConfig);
|
|
||||||
PIT_SetTimerPeriod(PIT, PIT_KEY_SCANNER_CHANNEL, USEC_TO_COUNT(KEY_SCANNER_INTERVAL_USEC, PIT_SOURCE_CLOCK));
|
|
||||||
PIT_EnableInterrupts(PIT, PIT_KEY_SCANNER_CHANNEL, kPIT_TimerInterruptEnable);
|
|
||||||
EnableIRQ(PIT_KEY_SCANNER_IRQ_ID);
|
|
||||||
PIT_StartTimer(PIT, PIT_KEY_SCANNER_CHANNEL);
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
#ifndef __KEY_SCANNER_H__
|
|
||||||
#define __KEY_SCANNER_H__
|
|
||||||
|
|
||||||
// Includes:
|
|
||||||
|
|
||||||
#include "peripherals/pit.h"
|
|
||||||
#include "right_key_matrix.h"
|
|
||||||
|
|
||||||
// Macros:
|
|
||||||
|
|
||||||
#define KEY_SCANNER_INTERVAL_USEC (1000 / RIGHT_KEY_MATRIX_ROWS_NUM)
|
|
||||||
|
|
||||||
// Variables:
|
|
||||||
|
|
||||||
extern uint32_t KeyScannerCounter;
|
|
||||||
|
|
||||||
// Functions:
|
|
||||||
|
|
||||||
void InitKeyScanner(void);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -10,10 +10,10 @@
|
|||||||
// Typedefs:
|
// Typedefs:
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
bool previous;
|
uint8_t timestamp;
|
||||||
bool current;
|
bool previous : 1;
|
||||||
bool suppressed;
|
bool current : 1;
|
||||||
uint8_t debounceCounter;
|
bool debouncing : 1;
|
||||||
} key_state_t;
|
} key_state_t;
|
||||||
|
|
||||||
// Variables:
|
// Variables:
|
||||||
|
|||||||
@@ -128,6 +128,102 @@ key_action_t CurrentKeymap[LAYER_COUNT][SLOT_COUNT][MAX_KEY_COUNT_PER_MODULE] =
|
|||||||
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_V }},
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_V }},
|
||||||
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_B }},
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_B }},
|
||||||
|
|
||||||
|
// Row 5
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_LEFT_CONTROL }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_LEFT_GUI }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_LEFT_ALT }},
|
||||||
|
{ .type = KeyActionType_SwitchLayer, .switchLayer = { .layer = LayerId_Fn }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_SPACE }},
|
||||||
|
{ .type = KeyActionType_SwitchLayer, .switchLayer = { .layer = LayerId_Mod }},
|
||||||
|
{ .type = KeyActionType_None },
|
||||||
|
},
|
||||||
|
|
||||||
|
// Left module
|
||||||
|
{
|
||||||
|
// Row 1
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_GRAVE_ACCENT_AND_TILDE }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_1_AND_EXCLAMATION }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_2_AND_AT }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_3_AND_HASHMARK }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_4_AND_DOLLAR }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_5_AND_PERCENTAGE }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_6_AND_CARET }},
|
||||||
|
|
||||||
|
// Row 2
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_TAB }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_Q }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_W }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_E }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_R }},
|
||||||
|
{ .type = KeyActionType_None },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_T }},
|
||||||
|
|
||||||
|
// Row 3
|
||||||
|
{ .type = KeyActionType_SwitchLayer, .switchLayer = { .layer = LayerId_Mouse }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_A }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_S }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_D }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_F }},
|
||||||
|
{ .type = KeyActionType_None },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_G }},
|
||||||
|
|
||||||
|
// Row 4
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_LEFT_SHIFT }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_NON_US_BACKSLASH_AND_PIPE }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_Z }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_X }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_C }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_V }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_B }},
|
||||||
|
|
||||||
|
// Row 5
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_LEFT_CONTROL }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_LEFT_GUI }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_LEFT_ALT }},
|
||||||
|
{ .type = KeyActionType_SwitchLayer, .switchLayer = { .layer = LayerId_Fn }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_SPACE }},
|
||||||
|
{ .type = KeyActionType_SwitchLayer, .switchLayer = { .layer = LayerId_Mod }},
|
||||||
|
{ .type = KeyActionType_None },
|
||||||
|
},
|
||||||
|
|
||||||
|
// Right module
|
||||||
|
{
|
||||||
|
// Row 1
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_GRAVE_ACCENT_AND_TILDE }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_1_AND_EXCLAMATION }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_2_AND_AT }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_3_AND_HASHMARK }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_4_AND_DOLLAR }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_5_AND_PERCENTAGE }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_6_AND_CARET }},
|
||||||
|
|
||||||
|
// Row 2
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_TAB }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_Q }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_W }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_E }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_R }},
|
||||||
|
{ .type = KeyActionType_None },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_T }},
|
||||||
|
|
||||||
|
// Row 3
|
||||||
|
{ .type = KeyActionType_SwitchLayer, .switchLayer = { .layer = LayerId_Mouse }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_A }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_S }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_D }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_F }},
|
||||||
|
{ .type = KeyActionType_None },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_G }},
|
||||||
|
|
||||||
|
// Row 4
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_LEFT_SHIFT }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_NON_US_BACKSLASH_AND_PIPE }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_Z }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_X }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_C }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_V }},
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_B }},
|
||||||
|
|
||||||
// Row 5
|
// Row 5
|
||||||
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_LEFT_CONTROL }},
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_LEFT_CONTROL }},
|
||||||
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_LEFT_GUI }},
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_LEFT_GUI }},
|
||||||
|
|||||||
@@ -5,12 +5,12 @@
|
|||||||
#include "keymap.h"
|
#include "keymap.h"
|
||||||
|
|
||||||
static bool heldLayers[LAYER_COUNT];
|
static bool heldLayers[LAYER_COUNT];
|
||||||
static switch_layer_mode_t pressedLayers[LAYER_COUNT];
|
static bool toggledLayers[LAYER_COUNT];
|
||||||
|
|
||||||
void updateLayerStates(void)
|
void updateLayerStates(void)
|
||||||
{
|
{
|
||||||
memset(heldLayers, false, LAYER_COUNT);
|
memset(heldLayers, false, LAYER_COUNT);
|
||||||
memset(pressedLayers, false, LAYER_COUNT);
|
memset(toggledLayers, false, LAYER_COUNT);
|
||||||
|
|
||||||
for (uint8_t slotId=0; slotId<SLOT_COUNT; slotId++) {
|
for (uint8_t slotId=0; slotId<SLOT_COUNT; slotId++) {
|
||||||
for (uint8_t keyId=0; keyId<MAX_KEY_COUNT_PER_MODULE; keyId++) {
|
for (uint8_t keyId=0; keyId<MAX_KEY_COUNT_PER_MODULE; keyId++) {
|
||||||
@@ -20,9 +20,8 @@ void updateLayerStates(void)
|
|||||||
if (action.type == KeyActionType_SwitchLayer) {
|
if (action.type == KeyActionType_SwitchLayer) {
|
||||||
if (action.switchLayer.mode != SwitchLayerMode_Toggle) {
|
if (action.switchLayer.mode != SwitchLayerMode_Toggle) {
|
||||||
heldLayers[action.switchLayer.layer] = true;
|
heldLayers[action.switchLayer.layer] = true;
|
||||||
}
|
} else if (!keyState->previous) {
|
||||||
if (action.switchLayer.mode != SwitchLayerMode_Hold && !keyState->previous && keyState->current) {
|
toggledLayers[action.switchLayer.layer] = true;
|
||||||
pressedLayers[action.switchLayer.layer] = action.switchLayer.mode;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -40,11 +39,11 @@ layer_id_t GetActiveLayer()
|
|||||||
// Handle toggled layers
|
// Handle toggled layers
|
||||||
|
|
||||||
for (layer_id_t layerId=LayerId_Mod; layerId<=LayerId_Mouse; layerId++) {
|
for (layer_id_t layerId=LayerId_Mod; layerId<=LayerId_Mouse; layerId++) {
|
||||||
if (pressedLayers[layerId]) {
|
if (toggledLayers[layerId]) {
|
||||||
if (ToggledLayer == layerId) {
|
if (ToggledLayer == layerId) {
|
||||||
ToggledLayer = LayerId_Base;
|
ToggledLayer = LayerId_Base;
|
||||||
break;
|
break;
|
||||||
} else if (ToggledLayer == LayerId_Base && pressedLayers[layerId] == SwitchLayerMode_Toggle) {
|
} else if (ToggledLayer == LayerId_Base && toggledLayers[layerId] == SwitchLayerMode_Toggle) {
|
||||||
ToggledLayer = layerId;
|
ToggledLayer = layerId;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -71,3 +70,14 @@ layer_id_t GetActiveLayer()
|
|||||||
|
|
||||||
return heldLayer;
|
return heldLayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsLayerHeld(void)
|
||||||
|
{
|
||||||
|
for (layer_id_t layerId = LayerId_Mod; layerId <= LayerId_Mouse; layerId++) {
|
||||||
|
if (heldLayers[layerId]) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
// Functions:
|
// Functions:
|
||||||
|
|
||||||
layer_id_t GetActiveLayer();
|
layer_id_t GetActiveLayer(void);
|
||||||
|
bool IsLayerHeld(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#include "macros.h"
|
#include "macros.h"
|
||||||
#include "config_parser/parse_macro.h"
|
#include "config_parser/parse_macro.h"
|
||||||
#include "config_parser/config_globals.h"
|
#include "config_parser/config_globals.h"
|
||||||
|
#include "timer.h"
|
||||||
|
|
||||||
macro_reference_t AllMacros[MAX_MACRO_NUM];
|
macro_reference_t AllMacros[MAX_MACRO_NUM];
|
||||||
uint8_t AllMacrosCount;
|
uint8_t AllMacrosCount;
|
||||||
@@ -18,69 +19,102 @@ uint8_t characterToScancode(char character)
|
|||||||
{
|
{
|
||||||
switch (character) {
|
switch (character) {
|
||||||
case 'A' ... 'Z':
|
case 'A' ... 'Z':
|
||||||
return 0;
|
|
||||||
case 'a' ... 'z':
|
case 'a' ... 'z':
|
||||||
return 0;
|
return HID_KEYBOARD_SC_A - 1 + (character & 0x1F);
|
||||||
case '1' ... '9':
|
case '1' ... '9':
|
||||||
return 0;
|
return HID_KEYBOARD_SC_1_AND_EXCLAMATION - 1 + (character & 0x0F);
|
||||||
case ')':
|
case ')':
|
||||||
case '0':
|
case '0':
|
||||||
return 0;
|
return HID_KEYBOARD_SC_0_AND_CLOSING_PARENTHESIS;
|
||||||
case '!':
|
case '!':
|
||||||
return 0;
|
return HID_KEYBOARD_SC_1_AND_EXCLAMATION;
|
||||||
case '@':
|
case '@':
|
||||||
return 0;
|
return HID_KEYBOARD_SC_2_AND_AT;
|
||||||
case '#':
|
case '#':
|
||||||
return 0;
|
return HID_KEYBOARD_SC_3_AND_HASHMARK;
|
||||||
case '$':
|
case '$':
|
||||||
return 0;
|
return HID_KEYBOARD_SC_4_AND_DOLLAR;
|
||||||
case '%':
|
case '%':
|
||||||
return 0;
|
return HID_KEYBOARD_SC_5_AND_PERCENTAGE;
|
||||||
case '^':
|
case '^':
|
||||||
return 0;
|
return HID_KEYBOARD_SC_6_AND_CARET;
|
||||||
case '&':
|
case '&':
|
||||||
return 0;
|
return HID_KEYBOARD_SC_7_AND_AMPERSAND;
|
||||||
case '*':
|
case '*':
|
||||||
return 0;
|
return HID_KEYBOARD_SC_8_AND_ASTERISK;
|
||||||
case '(':
|
case '(':
|
||||||
return 0;
|
return HID_KEYBOARD_SC_9_AND_OPENING_PARENTHESIS;
|
||||||
case '`':
|
case '`':
|
||||||
case '~':
|
case '~':
|
||||||
return 0;
|
return HID_KEYBOARD_SC_GRAVE_ACCENT_AND_TILDE;
|
||||||
case '[':
|
case '[':
|
||||||
case '{':
|
case '{':
|
||||||
return 0;
|
return HID_KEYBOARD_SC_OPENING_BRACKET_AND_OPENING_BRACE;
|
||||||
case ']':
|
case ']':
|
||||||
case '}':
|
case '}':
|
||||||
return 0;
|
return HID_KEYBOARD_SC_CLOSING_BRACKET_AND_CLOSING_BRACE;
|
||||||
case ';':
|
case ';':
|
||||||
case ':':
|
case ':':
|
||||||
return 0;
|
return HID_KEYBOARD_SC_SEMICOLON_AND_COLON;
|
||||||
case '\'':
|
case '\'':
|
||||||
case '\"':
|
case '\"':
|
||||||
return 0;
|
return HID_KEYBOARD_SC_APOSTROPHE_AND_QUOTE;
|
||||||
case '+':
|
case '+':
|
||||||
case '=':
|
case '=':
|
||||||
return 0;
|
return HID_KEYBOARD_SC_EQUAL_AND_PLUS;
|
||||||
case '\\':
|
case '\\':
|
||||||
case '|':
|
case '|':
|
||||||
return 0;
|
return HID_KEYBOARD_SC_BACKSLASH_AND_PIPE;
|
||||||
case '.':
|
case '.':
|
||||||
case '>':
|
case '>':
|
||||||
return 0;
|
return HID_KEYBOARD_SC_DOT_AND_GREATER_THAN_SIGN;
|
||||||
case ',':
|
case ',':
|
||||||
case '<':
|
case '<':
|
||||||
return 0;
|
return HID_KEYBOARD_SC_COMMA_AND_LESS_THAN_SIGN;
|
||||||
case '/':
|
case '/':
|
||||||
case '\?':
|
case '\?':
|
||||||
return 0;
|
return HID_KEYBOARD_SC_SLASH_AND_QUESTION_MARK;
|
||||||
case '-':
|
case '-':
|
||||||
case '_':
|
case '_':
|
||||||
return 0;
|
return HID_KEYBOARD_SC_MINUS_AND_UNDERSCORE;
|
||||||
|
case '\n':
|
||||||
|
return HID_KEYBOARD_SC_ENTER;
|
||||||
|
case ' ':
|
||||||
|
return HID_KEYBOARD_SC_SPACE;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool characterToShift(char character)
|
||||||
|
{
|
||||||
|
switch (character) {
|
||||||
|
case 'A' ... 'Z':
|
||||||
|
case ')':
|
||||||
|
case '!':
|
||||||
|
case '@':
|
||||||
|
case '#':
|
||||||
|
case '$':
|
||||||
|
case '%':
|
||||||
|
case '^':
|
||||||
|
case '&':
|
||||||
|
case '*':
|
||||||
|
case '(':
|
||||||
|
case '~':
|
||||||
|
case '{':
|
||||||
|
case '}':
|
||||||
|
case ':':
|
||||||
|
case '\"':
|
||||||
|
case '+':
|
||||||
|
case '|':
|
||||||
|
case '>':
|
||||||
|
case '<':
|
||||||
|
case '\?':
|
||||||
|
case '_':
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void addBasicScancode(uint8_t scancode)
|
void addBasicScancode(uint8_t scancode)
|
||||||
{
|
{
|
||||||
if (!scancode) {
|
if (!scancode) {
|
||||||
@@ -184,95 +218,192 @@ void deleteSystemScancode(uint8_t scancode)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool processKeyMacroAction(void)
|
void addScancode(uint16_t scancode, keystroke_type_t type)
|
||||||
|
{
|
||||||
|
switch (type) {
|
||||||
|
case KeystrokeType_Basic:
|
||||||
|
addBasicScancode(scancode);
|
||||||
|
break;
|
||||||
|
case KeystrokeType_Media:
|
||||||
|
addMediaScancode(scancode);
|
||||||
|
break;
|
||||||
|
case KeystrokeType_System:
|
||||||
|
addSystemScancode(scancode);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void deleteScancode(uint16_t scancode, keystroke_type_t type)
|
||||||
|
{
|
||||||
|
switch (type) {
|
||||||
|
case KeystrokeType_Basic:
|
||||||
|
deleteBasicScancode(scancode);
|
||||||
|
break;
|
||||||
|
case KeystrokeType_Media:
|
||||||
|
deleteMediaScancode(scancode);
|
||||||
|
break;
|
||||||
|
case KeystrokeType_System:
|
||||||
|
deleteSystemScancode(scancode);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool processKeyAction(void)
|
||||||
{
|
{
|
||||||
static bool pressStarted;
|
static bool pressStarted;
|
||||||
|
|
||||||
switch (currentMacroAction.key.action) {
|
switch (currentMacroAction.key.action) {
|
||||||
case MacroSubAction_Press:
|
case MacroSubAction_Tap:
|
||||||
if (!pressStarted) {
|
if (!pressStarted) {
|
||||||
pressStarted = true;
|
pressStarted = true;
|
||||||
addModifiers(currentMacroAction.key.modifierMask);
|
addModifiers(currentMacroAction.key.modifierMask);
|
||||||
switch (currentMacroAction.key.type) {
|
addScancode(currentMacroAction.key.scancode, currentMacroAction.key.type);
|
||||||
case KeystrokeType_Basic:
|
|
||||||
addBasicScancode(currentMacroAction.key.scancode);
|
|
||||||
break;
|
|
||||||
case KeystrokeType_Media:
|
|
||||||
// addMediaScancode(currentMacroAction.key.scancode);
|
|
||||||
break;
|
|
||||||
case KeystrokeType_System:
|
|
||||||
addSystemScancode(currentMacroAction.key.scancode);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
pressStarted = false;
|
pressStarted = false;
|
||||||
deleteModifiers(currentMacroAction.key.modifierMask);
|
deleteModifiers(currentMacroAction.key.modifierMask);
|
||||||
switch (currentMacroAction.key.type) {
|
deleteScancode(currentMacroAction.key.scancode, currentMacroAction.key.type);
|
||||||
case KeystrokeType_Basic:
|
|
||||||
deleteBasicScancode(currentMacroAction.key.scancode);
|
|
||||||
break;
|
|
||||||
case KeystrokeType_Media:
|
|
||||||
// deleteMediaScancode(currentMacroAction.key.scancode);
|
|
||||||
break;
|
|
||||||
case KeystrokeType_System:
|
|
||||||
deleteSystemScancode(currentMacroAction.key.scancode);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case MacroSubAction_Release:
|
case MacroSubAction_Release:
|
||||||
deleteModifiers(currentMacroAction.key.modifierMask);
|
deleteModifiers(currentMacroAction.key.modifierMask);
|
||||||
switch (currentMacroAction.key.type) {
|
deleteScancode(currentMacroAction.key.scancode, currentMacroAction.key.type);
|
||||||
case KeystrokeType_Basic:
|
|
||||||
deleteBasicScancode(currentMacroAction.key.scancode);
|
|
||||||
break;
|
|
||||||
case KeystrokeType_Media:
|
|
||||||
// deleteMediaScancode(currentMacroAction.key.scancode);
|
|
||||||
break;
|
|
||||||
case KeystrokeType_System:
|
|
||||||
deleteSystemScancode(currentMacroAction.key.scancode);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case MacroSubAction_Hold:
|
case MacroSubAction_Press:
|
||||||
addModifiers(currentMacroAction.key.modifierMask);
|
addModifiers(currentMacroAction.key.modifierMask);
|
||||||
switch (currentMacroAction.key.type) {
|
addScancode(currentMacroAction.key.scancode, currentMacroAction.key.type);
|
||||||
case KeystrokeType_Basic:
|
|
||||||
addBasicScancode(currentMacroAction.key.scancode);
|
|
||||||
break;
|
|
||||||
case KeystrokeType_Media:
|
|
||||||
// addMediaScancode(currentMacroAction.key.scancode);
|
|
||||||
break;
|
|
||||||
case KeystrokeType_System:
|
|
||||||
addSystemScancode(currentMacroAction.key.scancode);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool processDelayAction(void)
|
||||||
|
{
|
||||||
|
static bool inDelay;
|
||||||
|
static uint32_t delayStart;
|
||||||
|
|
||||||
|
if (inDelay) {
|
||||||
|
if (Timer_GetElapsedTime(&delayStart) >= currentMacroAction.delay.delay) {
|
||||||
|
inDelay = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
delayStart = CurrentTime;
|
||||||
|
inDelay = true;
|
||||||
|
}
|
||||||
|
return inDelay;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool processMouseButtonAction(void)
|
||||||
|
{
|
||||||
|
static bool pressStarted;
|
||||||
|
|
||||||
|
switch (currentMacroAction.mouseButton.action) {
|
||||||
|
case MacroSubAction_Tap:
|
||||||
|
if (!pressStarted) {
|
||||||
|
pressStarted = true;
|
||||||
|
MacroMouseReport.buttons |= currentMacroAction.mouseButton.mouseButtonsMask;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
pressStarted = false;
|
||||||
|
MacroMouseReport.buttons &= ~currentMacroAction.mouseButton.mouseButtonsMask;
|
||||||
|
break;
|
||||||
|
case MacroSubAction_Release:
|
||||||
|
MacroMouseReport.buttons &= ~currentMacroAction.mouseButton.mouseButtonsMask;
|
||||||
|
break;
|
||||||
|
case MacroSubAction_Press:
|
||||||
|
MacroMouseReport.buttons |= currentMacroAction.mouseButton.mouseButtonsMask;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool processMoveMouseAction(void)
|
||||||
|
{
|
||||||
|
static bool inMotion;
|
||||||
|
|
||||||
|
if (inMotion) {
|
||||||
|
MacroMouseReport.x = 0;
|
||||||
|
MacroMouseReport.y = 0;
|
||||||
|
inMotion = false;
|
||||||
|
} else {
|
||||||
|
MacroMouseReport.x = currentMacroAction.moveMouse.x;
|
||||||
|
MacroMouseReport.y = currentMacroAction.moveMouse.y;
|
||||||
|
inMotion = true;
|
||||||
|
}
|
||||||
|
return inMotion;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool processScrollMouseAction(void)
|
||||||
|
{
|
||||||
|
static bool inMotion;
|
||||||
|
|
||||||
|
if (inMotion) {
|
||||||
|
MacroMouseReport.wheelX = 0;
|
||||||
|
MacroMouseReport.wheelY = 0;
|
||||||
|
inMotion = false;
|
||||||
|
} else {
|
||||||
|
MacroMouseReport.wheelX = currentMacroAction.scrollMouse.x;
|
||||||
|
MacroMouseReport.wheelY = currentMacroAction.scrollMouse.y;
|
||||||
|
inMotion = true;
|
||||||
|
}
|
||||||
|
return inMotion;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool processTextAction(void)
|
||||||
|
{
|
||||||
|
static uint16_t textIndex;
|
||||||
|
static uint8_t reportIndex = USB_BASIC_KEYBOARD_MAX_KEYS;
|
||||||
|
char character;
|
||||||
|
uint8_t scancode;
|
||||||
|
|
||||||
|
if (textIndex == currentMacroAction.text.textLen) {
|
||||||
|
textIndex = 0;
|
||||||
|
reportIndex = USB_BASIC_KEYBOARD_MAX_KEYS;
|
||||||
|
memset(&MacroBasicKeyboardReport, 0, sizeof MacroBasicKeyboardReport);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (reportIndex == USB_BASIC_KEYBOARD_MAX_KEYS) {
|
||||||
|
reportIndex = 0;
|
||||||
|
memset(&MacroBasicKeyboardReport, 0, sizeof MacroBasicKeyboardReport);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
character = currentMacroAction.text.text[textIndex];
|
||||||
|
scancode = characterToScancode(character);
|
||||||
|
for (uint8_t i = 0; i < reportIndex; i++) {
|
||||||
|
if (MacroBasicKeyboardReport.scancodes[i] == scancode) {
|
||||||
|
reportIndex = USB_BASIC_KEYBOARD_MAX_KEYS;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MacroBasicKeyboardReport.scancodes[reportIndex++] = scancode;
|
||||||
|
MacroBasicKeyboardReport.modifiers = characterToShift(character) ? HID_KEYBOARD_MODIFIER_LEFTSHIFT : 0;
|
||||||
|
++textIndex;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool processCurrentMacroAction(void)
|
bool processCurrentMacroAction(void)
|
||||||
{
|
{
|
||||||
switch (currentMacroAction.type) {
|
switch (currentMacroAction.type) {
|
||||||
case MacroActionType_Delay:
|
case MacroActionType_Delay:
|
||||||
return false;
|
return processDelayAction();
|
||||||
case MacroActionType_Key:
|
case MacroActionType_Key:
|
||||||
return processKeyMacroAction();
|
return processKeyAction();
|
||||||
case MacroActionType_MouseButton:
|
case MacroActionType_MouseButton:
|
||||||
return false;
|
return processMouseButtonAction();
|
||||||
case MacroActionType_MoveMouse:
|
case MacroActionType_MoveMouse:
|
||||||
return false;
|
return processMoveMouseAction();
|
||||||
case MacroActionType_ScrollMouse:
|
case MacroActionType_ScrollMouse:
|
||||||
return false;
|
return processScrollMouseAction();
|
||||||
case MacroActionType_Text:
|
case MacroActionType_Text:
|
||||||
return false;
|
return processTextAction();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Macros_StartMacro(uint8_t index)
|
void Macros_StartMacro(uint8_t index)
|
||||||
{
|
{
|
||||||
|
if(AllMacros[index].macroActionsCount == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
MacroPlaying = true;
|
MacroPlaying = true;
|
||||||
currentMacroIndex = index;
|
currentMacroIndex = index;
|
||||||
currentMacroActionIndex = 0;
|
currentMacroActionIndex = 0;
|
||||||
|
|||||||
@@ -20,8 +20,8 @@
|
|||||||
} macro_reference_t;
|
} macro_reference_t;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
MacroSubAction_Tap,
|
||||||
MacroSubAction_Press,
|
MacroSubAction_Press,
|
||||||
MacroSubAction_Hold,
|
|
||||||
MacroSubAction_Release,
|
MacroSubAction_Release,
|
||||||
} macro_sub_action_t;
|
} macro_sub_action_t;
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
int16_t y;
|
int16_t y;
|
||||||
} ATTR_PACKED scrollMouse;
|
} ATTR_PACKED scrollMouse;
|
||||||
struct {
|
struct {
|
||||||
int16_t delay;
|
uint16_t delay;
|
||||||
} ATTR_PACKED delay;
|
} ATTR_PACKED delay;
|
||||||
struct {
|
struct {
|
||||||
const char *text;
|
const char *text;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#include "bus_pal_hardware.h"
|
#include "bus_pal_hardware.h"
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "eeprom.h"
|
#include "eeprom.h"
|
||||||
#include "key_scanner.h"
|
#include "right_key_matrix.h"
|
||||||
#include "usb_commands/usb_command_apply_config.h"
|
#include "usb_commands/usb_command_apply_config.h"
|
||||||
#include "peripherals/reset_button.h"
|
#include "peripherals/reset_button.h"
|
||||||
#include "config_parser/config_globals.h"
|
#include "config_parser/config_globals.h"
|
||||||
@@ -44,8 +44,6 @@ int main(void)
|
|||||||
} else {
|
} else {
|
||||||
InitSlaveScheduler();
|
InitSlaveScheduler();
|
||||||
KeyMatrix_Init(&RightKeyMatrix);
|
KeyMatrix_Init(&RightKeyMatrix);
|
||||||
InitKeyScanner();
|
|
||||||
UpdateUsbReports();
|
|
||||||
InitUsb();
|
InitUsb();
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
@@ -53,6 +51,8 @@ int main(void)
|
|||||||
UsbCommand_ApplyConfig();
|
UsbCommand_ApplyConfig();
|
||||||
IsConfigInitialized = true;
|
IsConfigInitialized = true;
|
||||||
}
|
}
|
||||||
|
KeyMatrix_ScanRow(&RightKeyMatrix);
|
||||||
|
++MatrixScanCounter;
|
||||||
UpdateUsbReports();
|
UpdateUsbReports();
|
||||||
__WFI();
|
__WFI();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,12 +17,4 @@
|
|||||||
#define PIT_TIMER_IRQ_ID PIT1_IRQn
|
#define PIT_TIMER_IRQ_ID PIT1_IRQn
|
||||||
#define PIT_TIMER_CHANNEL kPIT_Chnl_1
|
#define PIT_TIMER_CHANNEL kPIT_Chnl_1
|
||||||
|
|
||||||
#define PIT_KEY_SCANNER_HANDLER PIT2_IRQHandler
|
|
||||||
#define PIT_KEY_SCANNER_IRQ_ID PIT2_IRQn
|
|
||||||
#define PIT_KEY_SCANNER_CHANNEL kPIT_Chnl_2
|
|
||||||
|
|
||||||
#define PIT_KEY_DEBOUNCER_HANDLER PIT3_IRQHandler
|
|
||||||
#define PIT_KEY_DEBOUNCER_IRQ_ID PIT3_IRQn
|
|
||||||
#define PIT_KEY_DEBOUNCER_CHANNEL kPIT_Chnl_3
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,10 +1,31 @@
|
|||||||
#include "test_led.h"
|
#include "test_led.h"
|
||||||
#include "fsl_port.h"
|
#include "fsl_port.h"
|
||||||
|
#include "timer.h"
|
||||||
|
|
||||||
void InitTestLed(void)
|
void TestLed_Init(void)
|
||||||
{
|
{
|
||||||
CLOCK_EnableClock(TEST_LED_CLOCK);
|
CLOCK_EnableClock(TEST_LED_CLOCK);
|
||||||
PORT_SetPinMux(TEST_LED_GPIO_PORT, TEST_LED_GPIO_PIN, kPORT_MuxAsGpio);
|
PORT_SetPinMux(TEST_LED_GPIO_PORT, TEST_LED_GPIO_PIN, kPORT_MuxAsGpio);
|
||||||
GPIO_PinInit(TEST_LED_GPIO, TEST_LED_GPIO_PIN, &(gpio_pin_config_t){kGPIO_DigitalOutput, 1});
|
GPIO_PinInit(TEST_LED_GPIO, TEST_LED_GPIO_PIN, &(gpio_pin_config_t){kGPIO_DigitalOutput, 1});
|
||||||
TEST_LED_ON();
|
TestLed_On();
|
||||||
|
}
|
||||||
|
|
||||||
|
void TestLed_Blink(uint8_t times)
|
||||||
|
{
|
||||||
|
TestLed_Off();
|
||||||
|
Timer_Delay(500);
|
||||||
|
if (!times) {
|
||||||
|
TestLed_On();
|
||||||
|
Timer_Delay(500);
|
||||||
|
TestLed_Off();
|
||||||
|
Timer_Delay(500);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
while (times--) {
|
||||||
|
TestLed_On();
|
||||||
|
Timer_Delay(100);
|
||||||
|
TestLed_Off();
|
||||||
|
Timer_Delay(100);
|
||||||
|
}
|
||||||
|
Timer_Delay(400);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,13 +15,29 @@
|
|||||||
#define TEST_LED_CLOCK kCLOCK_PortD
|
#define TEST_LED_CLOCK kCLOCK_PortD
|
||||||
#define TEST_LED_GPIO_PIN 7U
|
#define TEST_LED_GPIO_PIN 7U
|
||||||
|
|
||||||
#define TEST_LED_ON() GPIO_SetPinsOutput(TEST_LED_GPIO, 1U << TEST_LED_GPIO_PIN)
|
static inline void TestLed_On(void)
|
||||||
#define TEST_LED_OFF() GPIO_ClearPinsOutput(TEST_LED_GPIO, 1U << TEST_LED_GPIO_PIN)
|
{
|
||||||
#define TEST_LED_SET(state) GPIO_WritePinOutput(TEST_LED_GPIO, TEST_LED_GPIO_PIN, (state))
|
GPIO_SetPinsOutput(TEST_LED_GPIO, 1U << TEST_LED_GPIO_PIN);
|
||||||
#define TEST_LED_TOGGLE() GPIO_TogglePinsOutput(TEST_LED_GPIO, 1U << TEST_LED_GPIO_PIN)
|
}
|
||||||
|
|
||||||
|
static inline void TestLed_Off(void)
|
||||||
|
{
|
||||||
|
GPIO_ClearPinsOutput(TEST_LED_GPIO, 1U << TEST_LED_GPIO_PIN);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void TestLed_Set(bool state)
|
||||||
|
{
|
||||||
|
GPIO_WritePinOutput(TEST_LED_GPIO, TEST_LED_GPIO_PIN, state);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void TestLed_Toggle(void)
|
||||||
|
{
|
||||||
|
GPIO_TogglePinsOutput(TEST_LED_GPIO, 1U << TEST_LED_GPIO_PIN);
|
||||||
|
}
|
||||||
|
|
||||||
// Functions:
|
// Functions:
|
||||||
|
|
||||||
void InitTestLed(void);
|
void TestLed_Init(void);
|
||||||
|
void TestLed_Blink(uint8_t times);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
#include "right_key_matrix.h"
|
#include "right_key_matrix.h"
|
||||||
|
|
||||||
|
uint32_t MatrixScanCounter;
|
||||||
|
|
||||||
key_matrix_t RightKeyMatrix = {
|
key_matrix_t RightKeyMatrix = {
|
||||||
.colNum = RIGHT_KEY_MATRIX_COLS_NUM,
|
.colNum = RIGHT_KEY_MATRIX_COLS_NUM,
|
||||||
.rowNum = RIGHT_KEY_MATRIX_ROWS_NUM,
|
.rowNum = RIGHT_KEY_MATRIX_ROWS_NUM,
|
||||||
|
|||||||
@@ -14,5 +14,6 @@
|
|||||||
// Variables:
|
// Variables:
|
||||||
|
|
||||||
extern key_matrix_t RightKeyMatrix;
|
extern key_matrix_t RightKeyMatrix;
|
||||||
|
extern uint32_t MatrixScanCounter;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -9,6 +9,17 @@
|
|||||||
#include "key_states.h"
|
#include "key_states.h"
|
||||||
|
|
||||||
uhk_module_state_t UhkModuleStates[UHK_MODULE_MAX_COUNT];
|
uhk_module_state_t UhkModuleStates[UHK_MODULE_MAX_COUNT];
|
||||||
|
|
||||||
|
uint8_t UhkModuleSlaveDriver_SlotIdToDriverId(uint8_t slotId)
|
||||||
|
{
|
||||||
|
return slotId-1;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t UhkModuleSlaveDriver_DriverIdToSlotId(uint8_t uhkModuleDriverId)
|
||||||
|
{
|
||||||
|
return uhkModuleDriverId+1;
|
||||||
|
}
|
||||||
|
|
||||||
static uint8_t keyStatesBuffer[MAX_KEY_COUNT_PER_MODULE];
|
static uint8_t keyStatesBuffer[MAX_KEY_COUNT_PER_MODULE];
|
||||||
static i2c_message_t txMessage;
|
static i2c_message_t txMessage;
|
||||||
|
|
||||||
@@ -17,13 +28,13 @@ static uhk_module_i2c_addresses_t moduleIdsToI2cAddresses[] = {
|
|||||||
.firmwareI2cAddress = I2C_ADDRESS_LEFT_KEYBOARD_HALF_FIRMWARE,
|
.firmwareI2cAddress = I2C_ADDRESS_LEFT_KEYBOARD_HALF_FIRMWARE,
|
||||||
.bootloaderI2cAddress = I2C_ADDRESS_LEFT_KEYBOARD_HALF_BOOTLOADER
|
.bootloaderI2cAddress = I2C_ADDRESS_LEFT_KEYBOARD_HALF_BOOTLOADER
|
||||||
},
|
},
|
||||||
{ // UhkModuleDriverId_LeftAddon
|
{ // UhkModuleDriverId_LeftModule
|
||||||
.firmwareI2cAddress = I2C_ADDRESS_LEFT_ADDON_FIRMWARE,
|
.firmwareI2cAddress = I2C_ADDRESS_LEFT_MODULE_FIRMWARE,
|
||||||
.bootloaderI2cAddress = I2C_ADDRESS_LEFT_ADDON_BOOTLOADER
|
.bootloaderI2cAddress = I2C_ADDRESS_LEFT_MODULE_BOOTLOADER
|
||||||
},
|
},
|
||||||
{ // UhkModuleDriverId_RightAddon
|
{ // UhkModuleDriverId_RightModule
|
||||||
.firmwareI2cAddress = I2C_ADDRESS_RIGHT_ADDON_FIRMWARE,
|
.firmwareI2cAddress = I2C_ADDRESS_RIGHT_MODULE_FIRMWARE,
|
||||||
.bootloaderI2cAddress = I2C_ADDRESS_RIGHT_ADDON_BOOTLOADER
|
.bootloaderI2cAddress = I2C_ADDRESS_RIGHT_MODULE_BOOTLOADER
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -55,6 +66,9 @@ void UhkModuleSlaveDriver_Init(uint8_t uhkModuleDriverId)
|
|||||||
uhk_module_i2c_addresses_t *uhkModuleI2cAddresses = moduleIdsToI2cAddresses + uhkModuleDriverId;
|
uhk_module_i2c_addresses_t *uhkModuleI2cAddresses = moduleIdsToI2cAddresses + uhkModuleDriverId;
|
||||||
uhkModuleState->firmwareI2cAddress = uhkModuleI2cAddresses->firmwareI2cAddress;
|
uhkModuleState->firmwareI2cAddress = uhkModuleI2cAddresses->firmwareI2cAddress;
|
||||||
uhkModuleState->bootloaderI2cAddress = uhkModuleI2cAddresses->bootloaderI2cAddress;
|
uhkModuleState->bootloaderI2cAddress = uhkModuleI2cAddresses->bootloaderI2cAddress;
|
||||||
|
|
||||||
|
uhkModuleState->pointerDelta.x = 0;
|
||||||
|
uhkModuleState->pointerDelta.y = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
status_t UhkModuleSlaveDriver_Update(uint8_t uhkModuleDriverId)
|
status_t UhkModuleSlaveDriver_Update(uint8_t uhkModuleDriverId)
|
||||||
@@ -221,11 +235,17 @@ status_t UhkModuleSlaveDriver_Update(uint8_t uhkModuleDriverId)
|
|||||||
break;
|
break;
|
||||||
case UhkModulePhase_ProcessKeystates:
|
case UhkModulePhase_ProcessKeystates:
|
||||||
if (CRC16_IsMessageValid(rxMessage)) {
|
if (CRC16_IsMessageValid(rxMessage)) {
|
||||||
uint8_t slotId = uhkModuleDriverId + 1;
|
uint8_t slotId = UhkModuleSlaveDriver_DriverIdToSlotId(uhkModuleDriverId);
|
||||||
BoolBitsToBytes(rxMessage->data, keyStatesBuffer, uhkModuleState->keyCount);
|
BoolBitsToBytes(rxMessage->data, keyStatesBuffer, uhkModuleState->keyCount);
|
||||||
for (uint8_t keyId=0; keyId<uhkModuleState->keyCount; keyId++) {
|
for (uint8_t keyId=0; keyId < uhkModuleState->keyCount; keyId++) {
|
||||||
KeyStates[slotId][keyId].current = keyStatesBuffer[keyId];
|
KeyStates[slotId][keyId].current = keyStatesBuffer[keyId];
|
||||||
}
|
}
|
||||||
|
if (uhkModuleState->pointerCount) {
|
||||||
|
uint8_t keyStatesLength = BOOL_BYTES_TO_BITS_COUNT(uhkModuleState->keyCount);
|
||||||
|
pointer_delta_t *pointerDelta = (pointer_delta_t*)(rxMessage->data + keyStatesLength);
|
||||||
|
uhkModuleState->pointerDelta.x += pointerDelta->x;
|
||||||
|
uhkModuleState->pointerDelta.y += pointerDelta->y;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
status = kStatus_Uhk_IdleCycle;
|
status = kStatus_Uhk_IdleCycle;
|
||||||
*uhkModulePhase = UhkModulePhase_SetTestLed;
|
*uhkModulePhase = UhkModulePhase_SetTestLed;
|
||||||
|
|||||||
@@ -6,20 +6,19 @@
|
|||||||
#include "fsl_common.h"
|
#include "fsl_common.h"
|
||||||
#include "crc16.h"
|
#include "crc16.h"
|
||||||
#include "versions.h"
|
#include "versions.h"
|
||||||
|
#include "usb_interfaces/usb_interface_mouse.h"
|
||||||
|
|
||||||
// Macros:
|
// Macros:
|
||||||
|
|
||||||
#define UHK_MODULE_MAX_COUNT 3
|
#define UHK_MODULE_MAX_COUNT 3
|
||||||
#define MAX_PWM_BRIGHTNESS 0x64
|
#define MAX_PWM_BRIGHTNESS 0x64
|
||||||
#define SLOT_ID_TO_UHK_MODULE_DRIVER_ID(slotId) ((slotId)-1)
|
|
||||||
#define UHK_MODULE_DRIVER_ID_TO_SLOT_ID(uhkModuleDriverId) ((uhkModuleDriverId)+1)
|
|
||||||
|
|
||||||
// Typedefs:
|
// Typedefs:
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
UhkModuleDriverId_LeftKeyboardHalf,
|
UhkModuleDriverId_LeftKeyboardHalf,
|
||||||
UhkModuleDriverId_LeftAddon,
|
UhkModuleDriverId_LeftModule,
|
||||||
UhkModuleDriverId_RightAddon,
|
UhkModuleDriverId_RightModule,
|
||||||
} uhk_module_id_t;
|
} uhk_module_id_t;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@@ -83,6 +82,7 @@
|
|||||||
uint8_t bootloaderI2cAddress;
|
uint8_t bootloaderI2cAddress;
|
||||||
uint8_t keyCount;
|
uint8_t keyCount;
|
||||||
uint8_t pointerCount;
|
uint8_t pointerCount;
|
||||||
|
pointer_delta_t pointerDelta;
|
||||||
} uhk_module_state_t;
|
} uhk_module_state_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@@ -96,6 +96,9 @@
|
|||||||
|
|
||||||
// Functions:
|
// Functions:
|
||||||
|
|
||||||
|
uint8_t UhkModuleSlaveDriver_SlotIdToDriverId(uint8_t slotId);
|
||||||
|
uint8_t UhkModuleSlaveDriver_DriverIdToSlotId(uint8_t uhkModuleDriverId);
|
||||||
|
|
||||||
void UhkModuleSlaveDriver_Init(uint8_t uhkModuleDriverId);
|
void UhkModuleSlaveDriver_Init(uint8_t uhkModuleDriverId);
|
||||||
status_t UhkModuleSlaveDriver_Update(uint8_t uhkModuleDriverId);
|
status_t UhkModuleSlaveDriver_Update(uint8_t uhkModuleDriverId);
|
||||||
void UhkModuleSlaveDriver_Disconnect(uint8_t uhkModuleDriverId);
|
void UhkModuleSlaveDriver_Disconnect(uint8_t uhkModuleDriverId);
|
||||||
|
|||||||
@@ -24,12 +24,12 @@ uhk_slave_t Slaves[] = {
|
|||||||
{
|
{
|
||||||
.init = UhkModuleSlaveDriver_Init,
|
.init = UhkModuleSlaveDriver_Init,
|
||||||
.update = UhkModuleSlaveDriver_Update,
|
.update = UhkModuleSlaveDriver_Update,
|
||||||
.perDriverId = UhkModuleDriverId_LeftAddon,
|
.perDriverId = UhkModuleDriverId_LeftModule,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.init = UhkModuleSlaveDriver_Init,
|
.init = UhkModuleSlaveDriver_Init,
|
||||||
.update = UhkModuleSlaveDriver_Update,
|
.update = UhkModuleSlaveDriver_Update,
|
||||||
.perDriverId = UhkModuleDriverId_RightAddon,
|
.perDriverId = UhkModuleDriverId_RightModule,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.init = LedSlaveDriver_Init,
|
.init = LedSlaveDriver_Init,
|
||||||
|
|||||||
113
right/src/test_switches.c
Normal file
113
right/src/test_switches.c
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
#include "test_switches.h"
|
||||||
|
#include "led_display.h"
|
||||||
|
#include "key_action.h"
|
||||||
|
#include "keymap.h"
|
||||||
|
|
||||||
|
bool TestSwitches = false;
|
||||||
|
|
||||||
|
static const key_action_t TestKeymap[1][2][MAX_KEY_COUNT_PER_MODULE] = {
|
||||||
|
// Base layer
|
||||||
|
{
|
||||||
|
// Right keyboard half
|
||||||
|
{
|
||||||
|
// Row 1
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_7_AND_AMPERSAND } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_8_AND_ASTERISK } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_9_AND_OPENING_PARENTHESIS } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_0_AND_CLOSING_PARENTHESIS } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_MINUS_AND_UNDERSCORE } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_EQUAL_AND_PLUS } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_BACKSPACE } },
|
||||||
|
|
||||||
|
// Row 2
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_U } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_I } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_O } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_P } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_OPENING_BRACKET_AND_OPENING_BRACE } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_CLOSING_BRACKET_AND_CLOSING_BRACE } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_BACKSLASH_AND_PIPE } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_Y } },
|
||||||
|
|
||||||
|
// Row 3
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_J } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_K } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_L } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_SEMICOLON_AND_COLON } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_APOSTROPHE_AND_QUOTE } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_KEYPAD_PLUS } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_H } },
|
||||||
|
|
||||||
|
// Row 4
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_N } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_M } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_COMMA_AND_LESS_THAN_SIGN } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_DOT_AND_GREATER_THAN_SIGN } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_SLASH_AND_QUESTION_MARK } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_RIGHT_SHIFT } },
|
||||||
|
{ .type = KeyActionType_None },
|
||||||
|
|
||||||
|
// Row 5
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_KEYPAD_6_AND_RIGHT_ARROW } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_KEYPAD_ASTERISK } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_KEYPAD_7_AND_HOME } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_KEYPAD_8_AND_UP_ARROW } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_KEYPAD_9_AND_PAGE_UP } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_KEYPAD_0_AND_INSERT } },
|
||||||
|
},
|
||||||
|
|
||||||
|
// Left keyboard half
|
||||||
|
{
|
||||||
|
// Row 1
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_GRAVE_ACCENT_AND_TILDE } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_1_AND_EXCLAMATION } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_2_AND_AT } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_3_AND_HASHMARK } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_4_AND_DOLLAR } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_5_AND_PERCENTAGE } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_6_AND_CARET } },
|
||||||
|
|
||||||
|
// Row 2
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_ESCAPE } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_Q } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_W } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_E } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_R } },
|
||||||
|
{ .type = KeyActionType_None },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_T } },
|
||||||
|
|
||||||
|
// Row 3
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_KEYPAD_MINUS } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_A } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_S } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_D } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_F } },
|
||||||
|
{ .type = KeyActionType_None },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_G } },
|
||||||
|
|
||||||
|
// Row 4
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_LEFT_SHIFT } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_NON_US_BACKSLASH_AND_PIPE } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_Z } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_X } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_C } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_V } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_B } },
|
||||||
|
|
||||||
|
// Row 5
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_KEYPAD_1_AND_END } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_KEYPAD_2_AND_DOWN_ARROW } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_KEYPAD_3_AND_PAGE_DOWN } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_KEYPAD_4_AND_LEFT_ARROW } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_KEYPAD_SLASH } },
|
||||||
|
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_KEYPAD_5 } },
|
||||||
|
{ .type = KeyActionType_None },
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void TestSwitches_Activate(void)
|
||||||
|
{
|
||||||
|
memcpy(&CurrentKeymap, &TestKeymap, sizeof TestKeymap);
|
||||||
|
LedDisplay_SetText(3, "TES");
|
||||||
|
}
|
||||||
16
right/src/test_switches.h
Normal file
16
right/src/test_switches.h
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#ifndef __TEST_MODE_H__
|
||||||
|
#define __TEST_MODE_H__
|
||||||
|
|
||||||
|
// Includes:
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
// Functions:
|
||||||
|
|
||||||
|
void TestSwitches_Activate(void);
|
||||||
|
|
||||||
|
// Variables:
|
||||||
|
|
||||||
|
extern bool TestSwitches;
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -1,12 +1,18 @@
|
|||||||
#include "fsl_pit.h"
|
#include "fsl_pit.h"
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
|
#include "peripherals/test_led.h"
|
||||||
|
|
||||||
static volatile uint32_t CurrentTime;
|
volatile uint32_t CurrentTime;
|
||||||
|
static uint32_t timerClockFrequency;
|
||||||
|
static volatile uint32_t delayLength;
|
||||||
|
|
||||||
void PIT_TIMER_HANDLER(void)
|
void PIT_TIMER_HANDLER(void)
|
||||||
{
|
{
|
||||||
CurrentTime++;
|
CurrentTime++;
|
||||||
PIT_ClearStatusFlags(PIT, PIT_TIMER_CHANNEL, PIT_TFLG_TIF_MASK);
|
if (delayLength) {
|
||||||
|
--delayLength;
|
||||||
|
}
|
||||||
|
PIT_ClearStatusFlags(PIT, PIT_TIMER_CHANNEL, kPIT_TimerFlag);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Timer_Init(void)
|
void Timer_Init(void)
|
||||||
@@ -15,28 +21,39 @@ void Timer_Init(void)
|
|||||||
PIT_GetDefaultConfig(&pitConfig);
|
PIT_GetDefaultConfig(&pitConfig);
|
||||||
PIT_Init(PIT, &pitConfig);
|
PIT_Init(PIT, &pitConfig);
|
||||||
|
|
||||||
// TODO: Why the interval needs to be multiplied by two to arrive to the correct timing?
|
timerClockFrequency = PIT_SOURCE_CLOCK;
|
||||||
// Figure it out and clean this up.
|
PIT_SetTimerPeriod(PIT, PIT_TIMER_CHANNEL, MSEC_TO_COUNT(TIMER_INTERVAL_MSEC, timerClockFrequency));
|
||||||
PIT_SetTimerPeriod(PIT, PIT_TIMER_CHANNEL, MSEC_TO_COUNT(TIMER_INTERVAL_MSEC*2, PIT_SOURCE_CLOCK));
|
|
||||||
|
|
||||||
PIT_EnableInterrupts(PIT, PIT_TIMER_CHANNEL, kPIT_TimerInterruptEnable);
|
PIT_EnableInterrupts(PIT, PIT_TIMER_CHANNEL, kPIT_TimerInterruptEnable);
|
||||||
EnableIRQ(PIT_TIMER_IRQ_ID);
|
EnableIRQ(PIT_TIMER_IRQ_ID);
|
||||||
PIT_StartTimer(PIT, PIT_TIMER_CHANNEL);
|
PIT_StartTimer(PIT, PIT_TIMER_CHANNEL);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t Timer_GetCurrentTime() {
|
uint32_t Timer_GetCurrentTimeMicros() {
|
||||||
return CurrentTime;
|
uint32_t primask, count, ms;
|
||||||
|
primask = DisableGlobalIRQ(); // Make sure the read is atomic
|
||||||
|
count = PIT_GetCurrentTimerCount(PIT, PIT_TIMER_CHANNEL); // Read the current timer count
|
||||||
|
ms = CurrentTime; // Read the overflow counter
|
||||||
|
EnableGlobalIRQ(primask); // Enable interrupts again if they where enabled before - this should make it interrupt safe
|
||||||
|
|
||||||
|
// Calculate the counter value in microseconds - note that the PIT timer is counting downward, so we need to subtract the count from the period value
|
||||||
|
uint32_t us = 1000U * TIMER_INTERVAL_MSEC - COUNT_TO_USEC(count, timerClockFrequency);
|
||||||
|
return ms * 1000U * TIMER_INTERVAL_MSEC + us;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Timer_SetCurrentTime(uint32_t *time)
|
void Timer_SetCurrentTimeMicros(uint32_t *time)
|
||||||
{
|
{
|
||||||
*time = CurrentTime;
|
*time = Timer_GetCurrentTimeMicros();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t Timer_GetElapsedTime(uint32_t *time)
|
uint32_t Timer_GetElapsedTime(uint32_t *time)
|
||||||
{
|
{
|
||||||
uint32_t elapsedTime = CurrentTime - *time;
|
return CurrentTime - *time;
|
||||||
return elapsedTime;
|
}
|
||||||
|
|
||||||
|
uint32_t Timer_GetElapsedTimeMicros(uint32_t *time)
|
||||||
|
{
|
||||||
|
return Timer_GetCurrentTimeMicros() - *time;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t Timer_GetElapsedTimeAndSetCurrent(uint32_t *time)
|
uint32_t Timer_GetElapsedTimeAndSetCurrent(uint32_t *time)
|
||||||
@@ -45,3 +62,18 @@ uint32_t Timer_GetElapsedTimeAndSetCurrent(uint32_t *time)
|
|||||||
*time = CurrentTime;
|
*time = CurrentTime;
|
||||||
return elapsedTime;
|
return elapsedTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t Timer_GetElapsedTimeAndSetCurrentMicros(uint32_t *time)
|
||||||
|
{
|
||||||
|
uint32_t elapsedTime = Timer_GetElapsedTimeMicros(time);
|
||||||
|
*time = Timer_GetCurrentTimeMicros();
|
||||||
|
return elapsedTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Timer_Delay(uint32_t length)
|
||||||
|
{
|
||||||
|
delayLength = length;
|
||||||
|
while (delayLength) {
|
||||||
|
;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -9,12 +9,19 @@
|
|||||||
|
|
||||||
#define TIMER_INTERVAL_MSEC 1
|
#define TIMER_INTERVAL_MSEC 1
|
||||||
|
|
||||||
|
// Variables:
|
||||||
|
|
||||||
|
extern volatile uint32_t CurrentTime;
|
||||||
|
|
||||||
// Functions:
|
// Functions:
|
||||||
|
|
||||||
void Timer_Init(void);
|
void Timer_Init(void);
|
||||||
uint32_t Timer_GetCurrentTime();
|
uint32_t Timer_GetCurrentTimeMicros();
|
||||||
void Timer_SetCurrentTime(uint32_t *time);
|
void Timer_SetCurrentTimeMicros(uint32_t *time);
|
||||||
uint32_t Timer_GetElapsedTime(uint32_t *time);
|
uint32_t Timer_GetElapsedTime(uint32_t *time);
|
||||||
|
uint32_t Timer_GetElapsedTimeMicros(uint32_t *time);
|
||||||
uint32_t Timer_GetElapsedTimeAndSetCurrent(uint32_t *time);
|
uint32_t Timer_GetElapsedTimeAndSetCurrent(uint32_t *time);
|
||||||
|
uint32_t Timer_GetElapsedTimeAndSetCurrentMicros(uint32_t *time);
|
||||||
|
void Timer_Delay(uint32_t length);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#include "i2c_watchdog.h"
|
#include "i2c_watchdog.h"
|
||||||
#include "buffer.h"
|
#include "buffer.h"
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
#include "key_scanner.h"
|
#include "right_key_matrix.h"
|
||||||
#include "usb_report_updater.h"
|
#include "usb_report_updater.h"
|
||||||
#include "usb_interfaces/usb_interface_basic_keyboard.h"
|
#include "usb_interfaces/usb_interface_basic_keyboard.h"
|
||||||
#include "usb_interfaces/usb_interface_media_keyboard.h"
|
#include "usb_interfaces/usb_interface_media_keyboard.h"
|
||||||
@@ -20,9 +20,9 @@ void UsbCommand_GetDebugBuffer(void)
|
|||||||
SetDebugBufferUint32(5, I2cSlaveScheduler_Counter);
|
SetDebugBufferUint32(5, I2cSlaveScheduler_Counter);
|
||||||
SetDebugBufferUint32(9, I2cWatchdog_WatchCounter);
|
SetDebugBufferUint32(9, I2cWatchdog_WatchCounter);
|
||||||
SetDebugBufferUint32(13, I2cWatchdog_RecoveryCounter);
|
SetDebugBufferUint32(13, I2cWatchdog_RecoveryCounter);
|
||||||
SetDebugBufferUint32(17, KeyScannerCounter);
|
SetDebugBufferUint32(17, MatrixScanCounter);
|
||||||
SetDebugBufferUint32(21, UsbReportUpdateCounter);
|
SetDebugBufferUint32(21, UsbReportUpdateCounter);
|
||||||
SetDebugBufferUint32(25, Timer_GetCurrentTime());
|
SetDebugBufferUint32(25, CurrentTime);
|
||||||
SetDebugBufferUint32(29, UsbGenericHidActionCounter);
|
SetDebugBufferUint32(29, UsbGenericHidActionCounter);
|
||||||
SetDebugBufferUint32(33, UsbBasicKeyboardActionCounter);
|
SetDebugBufferUint32(33, UsbBasicKeyboardActionCounter);
|
||||||
SetDebugBufferUint32(37, UsbMediaKeyboardActionCounter);
|
SetDebugBufferUint32(37, UsbMediaKeyboardActionCounter);
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ void UsbCommand_GetDeviceProperty(void)
|
|||||||
SetUsbTxBufferUint32(6, I2cMainBusActualBaudRateBps);
|
SetUsbTxBufferUint32(6, I2cMainBusActualBaudRateBps);
|
||||||
break;
|
break;
|
||||||
case DevicePropertyId_Uptime:
|
case DevicePropertyId_Uptime:
|
||||||
SetUsbTxBufferUint32(1, Timer_GetCurrentTime());
|
SetUsbTxBufferUint32(1, CurrentTime);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
SetUsbTxBufferUint8(0, UsbStatusCode_GetDeviceProperty_InvalidProperty);
|
SetUsbTxBufferUint8(0, UsbStatusCode_GetDeviceProperty_InvalidProperty);
|
||||||
|
|||||||
@@ -10,6 +10,6 @@ void UsbCommand_GetKeyboardState(void)
|
|||||||
SetUsbTxBufferUint8(1, IsEepromBusy);
|
SetUsbTxBufferUint8(1, IsEepromBusy);
|
||||||
SetUsbTxBufferUint8(2, MERGE_SENSOR_IS_MERGED);
|
SetUsbTxBufferUint8(2, MERGE_SENSOR_IS_MERGED);
|
||||||
SetUsbTxBufferUint8(3, UhkModuleStates[UhkModuleDriverId_LeftKeyboardHalf].moduleId);
|
SetUsbTxBufferUint8(3, UhkModuleStates[UhkModuleDriverId_LeftKeyboardHalf].moduleId);
|
||||||
SetUsbTxBufferUint8(4, UhkModuleStates[UhkModuleDriverId_LeftAddon].moduleId);
|
SetUsbTxBufferUint8(4, UhkModuleStates[UhkModuleDriverId_LeftModule].moduleId);
|
||||||
SetUsbTxBufferUint8(5, UhkModuleStates[UhkModuleDriverId_RightAddon].moduleId);
|
SetUsbTxBufferUint8(5, UhkModuleStates[UhkModuleDriverId_RightModule].moduleId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ void UsbCommand_GetModuleProperty()
|
|||||||
module_property_id_t modulePropertyId = GetUsbRxBufferUint8(2);
|
module_property_id_t modulePropertyId = GetUsbRxBufferUint8(2);
|
||||||
switch (modulePropertyId) {
|
switch (modulePropertyId) {
|
||||||
case ModulePropertyId_VersionNumbers: {
|
case ModulePropertyId_VersionNumbers: {
|
||||||
uint8_t moduleDriverId = SLOT_ID_TO_UHK_MODULE_DRIVER_ID(slotId);
|
uint8_t moduleDriverId = UhkModuleSlaveDriver_SlotIdToDriverId(slotId);
|
||||||
uhk_module_state_t *moduleState = UhkModuleStates + moduleDriverId;
|
uhk_module_state_t *moduleState = UhkModuleStates + moduleDriverId;
|
||||||
GenericHidOutBuffer[1] = moduleState->moduleId;
|
GenericHidOutBuffer[1] = moduleState->moduleId;
|
||||||
memcpy(GenericHidOutBuffer + 2, &moduleState->moduleProtocolVersion, sizeof(version_t));
|
memcpy(GenericHidOutBuffer + 2, &moduleState->moduleProtocolVersion, sizeof(version_t));
|
||||||
|
|||||||
28
right/src/usb_commands/usb_command_get_variable.c
Normal file
28
right/src/usb_commands/usb_command_get_variable.c
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
#include "usb_protocol_handler.h"
|
||||||
|
#include "usb_commands/usb_command_get_variable.h"
|
||||||
|
#include "key_matrix.h"
|
||||||
|
#include "test_switches.h"
|
||||||
|
#include "usb_report_updater.h"
|
||||||
|
|
||||||
|
void UsbCommand_GetVariable(void)
|
||||||
|
{
|
||||||
|
usb_variable_id_t variableId = GetUsbRxBufferUint8(1);
|
||||||
|
|
||||||
|
switch (variableId) {
|
||||||
|
case UsbVariable_TestSwitches:
|
||||||
|
SetUsbTxBufferUint8(1, TestSwitches);
|
||||||
|
break;
|
||||||
|
case UsbVariable_TestUsbStack:
|
||||||
|
SetUsbTxBufferUint8(1, TestUsbStack);
|
||||||
|
break;
|
||||||
|
case UsbVariable_DebounceTimePress:
|
||||||
|
SetUsbTxBufferUint8(1, DebounceTimePress);
|
||||||
|
break;
|
||||||
|
case UsbVariable_DebounceTimeRelease:
|
||||||
|
SetUsbTxBufferUint8(1, DebounceTimeRelease);
|
||||||
|
break;
|
||||||
|
case UsbVariable_UsbReportSemaphore:
|
||||||
|
SetUsbTxBufferUint8(1, UsbReportUpdateSemaphore);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
8
right/src/usb_commands/usb_command_get_variable.h
Normal file
8
right/src/usb_commands/usb_command_get_variable.h
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#ifndef __USB_COMMAND_GET_VARIABLE_H__
|
||||||
|
#define __USB_COMMAND_GET_VARIABLE_H__
|
||||||
|
|
||||||
|
// Functions:
|
||||||
|
|
||||||
|
void UsbCommand_GetVariable(void);
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -12,6 +12,6 @@ void UsbCommand_JumpToModuleBootloader(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t uhkModuleDriverId = SLOT_ID_TO_UHK_MODULE_DRIVER_ID(slotId);
|
uint8_t uhkModuleDriverId = UhkModuleSlaveDriver_SlotIdToDriverId(slotId);
|
||||||
UhkModuleStates[uhkModuleDriverId].phase = UhkModulePhase_JumpToBootloader;
|
UhkModuleStates[uhkModuleDriverId].phase = UhkModulePhase_JumpToBootloader;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,6 @@
|
|||||||
void UsbCommand_SetTestLed(void)
|
void UsbCommand_SetTestLed(void)
|
||||||
{
|
{
|
||||||
bool isTestLedOn = GetUsbRxBufferUint8(1);
|
bool isTestLedOn = GetUsbRxBufferUint8(1);
|
||||||
TEST_LED_SET(isTestLedOn);
|
TestLed_Set(isTestLedOn);
|
||||||
UhkModuleStates[UhkModuleDriverId_LeftKeyboardHalf].sourceVars.isTestLedOn = isTestLedOn;
|
UhkModuleStates[UhkModuleDriverId_LeftKeyboardHalf].sourceVars.isTestLedOn = isTestLedOn;
|
||||||
}
|
}
|
||||||
|
|||||||
31
right/src/usb_commands/usb_command_set_variable.c
Normal file
31
right/src/usb_commands/usb_command_set_variable.c
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
#include "usb_protocol_handler.h"
|
||||||
|
#include "usb_commands/usb_command_set_variable.h"
|
||||||
|
#include "key_matrix.h"
|
||||||
|
#include "test_switches.h"
|
||||||
|
#include "usb_report_updater.h"
|
||||||
|
|
||||||
|
void UsbCommand_SetVariable(void)
|
||||||
|
{
|
||||||
|
usb_variable_id_t variableId = GetUsbRxBufferUint8(1);
|
||||||
|
|
||||||
|
switch (variableId) {
|
||||||
|
case UsbVariable_TestSwitches:
|
||||||
|
if (GetUsbRxBufferUint8(2)) {
|
||||||
|
TestSwitches = true;
|
||||||
|
TestSwitches_Activate();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case UsbVariable_TestUsbStack:
|
||||||
|
TestUsbStack = GetUsbRxBufferUint8(2);
|
||||||
|
break;
|
||||||
|
case UsbVariable_DebounceTimePress:
|
||||||
|
DebounceTimePress = GetUsbRxBufferUint8(2);
|
||||||
|
break;
|
||||||
|
case UsbVariable_DebounceTimeRelease:
|
||||||
|
DebounceTimeRelease = GetUsbRxBufferUint8(2);
|
||||||
|
break;
|
||||||
|
case UsbVariable_UsbReportSemaphore:
|
||||||
|
UsbReportUpdateSemaphore = GetUsbRxBufferUint8(2);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
8
right/src/usb_commands/usb_command_set_variable.h
Normal file
8
right/src/usb_commands/usb_command_set_variable.h
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#ifndef __USB_COMMAND_SET_VARIABLE_H__
|
||||||
|
#define __USB_COMMAND_SET_VARIABLE_H__
|
||||||
|
|
||||||
|
// Functions:
|
||||||
|
|
||||||
|
void UsbCommand_SetVariable(void);
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -163,23 +163,30 @@ static usb_device_class_config_list_struct_t UsbDeviceCompositeConfigList = {
|
|||||||
}
|
}
|
||||||
}};
|
}};
|
||||||
|
|
||||||
bool IsHostSleeping = false;
|
volatile bool SleepModeActive = true;
|
||||||
|
static volatile bool wakeUpHostAllowed;
|
||||||
|
|
||||||
static void suspendHost(void) {
|
static void suspendUhk(void) {
|
||||||
IsHostSleeping = true;
|
SleepModeActive = true;
|
||||||
LedSlaveDriver_DisableLeds();
|
LedSlaveDriver_DisableLeds();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WakeUpHost(bool sendResume) {
|
static void wakeUpUhk(void) {
|
||||||
if (sendResume) { // The device should wake up the host.
|
SleepModeActive = false;
|
||||||
// Send resume signal - this will call USB_DeviceKhciControl(khciHandle, kUSB_DeviceControlResume, NULL);
|
|
||||||
USB_DeviceSetStatus(UsbCompositeDevice.deviceHandle, kUSB_DeviceStatusBus, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
IsHostSleeping = false;
|
|
||||||
LedSlaveDriver_UpdateLeds();
|
LedSlaveDriver_UpdateLeds();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WakeUpHost(void) {
|
||||||
|
if (!wakeUpHostAllowed) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Send resume signal - this will call USB_DeviceKhciControl(khciHandle, kUSB_DeviceControlResume, NULL);
|
||||||
|
USB_DeviceSetStatus(UsbCompositeDevice.deviceHandle, kUSB_DeviceStatusBus, NULL);
|
||||||
|
while (SleepModeActive) {
|
||||||
|
;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static usb_status_t usbDeviceCallback(usb_device_handle handle, uint32_t event, void *param)
|
static usb_status_t usbDeviceCallback(usb_device_handle handle, uint32_t event, void *param)
|
||||||
{
|
{
|
||||||
usb_status_t status = kStatus_USB_Error;
|
usb_status_t status = kStatus_USB_Error;
|
||||||
@@ -190,10 +197,6 @@ static usb_status_t usbDeviceCallback(usb_device_handle handle, uint32_t event,
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsHostSleeping) {
|
|
||||||
WakeUpHost(false); // Wake up the keyboard if there is any activity on the bus.
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case kUSB_DeviceEventBusReset:
|
case kUSB_DeviceEventBusReset:
|
||||||
UsbCompositeDevice.attach = 0;
|
UsbCompositeDevice.attach = 0;
|
||||||
@@ -201,17 +204,17 @@ static usb_status_t usbDeviceCallback(usb_device_handle handle, uint32_t event,
|
|||||||
break;
|
break;
|
||||||
case kUSB_DeviceEventSuspend:
|
case kUSB_DeviceEventSuspend:
|
||||||
if (UsbCompositeDevice.attach) {
|
if (UsbCompositeDevice.attach) {
|
||||||
suspendHost(); // The host sends this event when it goes to sleep, so turn off all the LEDs.
|
suspendUhk(); // The host sends this event when it goes to sleep, so turn off all the LEDs.
|
||||||
status = kStatus_USB_Success;
|
status = kStatus_USB_Success;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case kUSB_DeviceEventResume:
|
case kUSB_DeviceEventResume:
|
||||||
// We will just wake up the host if there is any activity on the bus.
|
wakeUpUhk();
|
||||||
// The problem is that the host won't send a resume event when it boots, so the lights will never come back on.
|
|
||||||
status = kStatus_USB_Success;
|
status = kStatus_USB_Success;
|
||||||
break;
|
break;
|
||||||
case kUSB_DeviceEventSetConfiguration:
|
case kUSB_DeviceEventSetConfiguration:
|
||||||
UsbCompositeDevice.attach = 1;
|
UsbCompositeDevice.attach = 1;
|
||||||
|
wakeUpUhk();
|
||||||
UsbCompositeDevice.currentConfiguration = *temp8;
|
UsbCompositeDevice.currentConfiguration = *temp8;
|
||||||
UsbGenericHidSetConfiguration(UsbCompositeDevice.genericHidHandle, *temp8);
|
UsbGenericHidSetConfiguration(UsbCompositeDevice.genericHidHandle, *temp8);
|
||||||
UsbBasicKeyboardSetConfiguration(UsbCompositeDevice.basicKeyboardHandle, *temp8);
|
UsbBasicKeyboardSetConfiguration(UsbCompositeDevice.basicKeyboardHandle, *temp8);
|
||||||
@@ -266,6 +269,10 @@ static usb_status_t usbDeviceCallback(usb_device_handle handle, uint32_t event,
|
|||||||
case kUSB_DeviceEventGetHidPhysicalDescriptor:
|
case kUSB_DeviceEventGetHidPhysicalDescriptor:
|
||||||
status = USB_DeviceGetHidPhysicalDescriptor(handle, (usb_device_get_hid_physical_descriptor_struct_t *)param);
|
status = USB_DeviceGetHidPhysicalDescriptor(handle, (usb_device_get_hid_physical_descriptor_struct_t *)param);
|
||||||
break;
|
break;
|
||||||
|
case kUSB_DeviceEventSetRemoteWakeup:
|
||||||
|
wakeUpHostAllowed = *temp8;
|
||||||
|
status = kStatus_USB_Success;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
|
|||||||
@@ -28,12 +28,12 @@
|
|||||||
|
|
||||||
// Variables:
|
// Variables:
|
||||||
|
|
||||||
extern bool IsHostSleeping;
|
extern volatile bool SleepModeActive;
|
||||||
extern usb_composite_device_t UsbCompositeDevice;
|
extern usb_composite_device_t UsbCompositeDevice;
|
||||||
|
|
||||||
//Functions:
|
//Functions:
|
||||||
|
|
||||||
void InitUsb(void);
|
void InitUsb(void);
|
||||||
void WakeUpHost(bool sendResume);
|
void WakeUpHost(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -12,7 +12,13 @@
|
|||||||
// Macros:
|
// Macros:
|
||||||
|
|
||||||
#define USB_COMPOSITE_CONFIGURATION_INDEX 1
|
#define USB_COMPOSITE_CONFIGURATION_INDEX 1
|
||||||
#define USB_CONFIGURATION_DESCRIPTOR_TOTAL_LENGTH 141
|
#define USB_CONFIGURATION_DESCRIPTOR_TOTAL_LENGTH \
|
||||||
|
(5 * USB_DESCRIPTOR_LENGTH_INTERFACE + 5 * USB_DESCRIPTOR_LENGTH_HID + \
|
||||||
|
6 * USB_DESCRIPTOR_LENGTH_ENDPOINT + USB_DESCRIPTOR_LENGTH_CONFIGURE)
|
||||||
|
|
||||||
|
// Variables:
|
||||||
|
|
||||||
|
extern uint8_t UsbConfigurationDescriptor[USB_CONFIGURATION_DESCRIPTOR_TOTAL_LENGTH];
|
||||||
|
|
||||||
// Functions:
|
// Functions:
|
||||||
|
|
||||||
|
|||||||
@@ -2,33 +2,80 @@
|
|||||||
#include "usb_descriptor_hid.h"
|
#include "usb_descriptor_hid.h"
|
||||||
#include "usb_descriptor_mouse_report.h"
|
#include "usb_descriptor_mouse_report.h"
|
||||||
#include "usb_descriptor_generic_hid_report.h"
|
#include "usb_descriptor_generic_hid_report.h"
|
||||||
|
#include "usb_descriptor_configuration.h"
|
||||||
|
|
||||||
|
#define USB_GENERIC_HID_DESCRIPTOR_INDEX \
|
||||||
|
(USB_DESCRIPTOR_LENGTH_CONFIGURE + USB_DESCRIPTOR_LENGTH_INTERFACE)
|
||||||
|
|
||||||
|
#define USB_BASIC_KEYBOARD_HID_DESCRIPTOR_INDEX \
|
||||||
|
(USB_GENERIC_HID_DESCRIPTOR_INDEX + USB_DESCRIPTOR_LENGTH_HID + \
|
||||||
|
2 * USB_DESCRIPTOR_LENGTH_ENDPOINT + USB_DESCRIPTOR_LENGTH_INTERFACE)
|
||||||
|
|
||||||
|
#define USB_MEDIA_KEYBOARD_HID_DESCRIPTOR_INDEX \
|
||||||
|
(USB_BASIC_KEYBOARD_HID_DESCRIPTOR_INDEX + USB_DESCRIPTOR_LENGTH_HID + \
|
||||||
|
USB_DESCRIPTOR_LENGTH_ENDPOINT + USB_DESCRIPTOR_LENGTH_INTERFACE)
|
||||||
|
|
||||||
|
#define USB_SYSTEM_KEYBOARD_HID_DESCRIPTOR_INDEX \
|
||||||
|
(USB_MEDIA_KEYBOARD_HID_DESCRIPTOR_INDEX + USB_DESCRIPTOR_LENGTH_HID + \
|
||||||
|
USB_DESCRIPTOR_LENGTH_ENDPOINT + USB_DESCRIPTOR_LENGTH_INTERFACE)
|
||||||
|
|
||||||
|
#define USB_MOUSE_HID_DESCRIPTOR_INDEX \
|
||||||
|
(USB_SYSTEM_KEYBOARD_HID_DESCRIPTOR_INDEX + USB_DESCRIPTOR_LENGTH_HID + \
|
||||||
|
USB_DESCRIPTOR_LENGTH_ENDPOINT + USB_DESCRIPTOR_LENGTH_INTERFACE)
|
||||||
|
|
||||||
usb_status_t USB_DeviceGetHidDescriptor(
|
usb_status_t USB_DeviceGetHidDescriptor(
|
||||||
usb_device_handle handle, usb_device_get_hid_descriptor_struct_t *hidDescriptor)
|
usb_device_handle handle, usb_device_get_hid_descriptor_struct_t *hidDescriptor)
|
||||||
{
|
{
|
||||||
return kStatus_USB_InvalidRequest;
|
hidDescriptor->length = USB_DESCRIPTOR_LENGTH_HID;
|
||||||
|
|
||||||
|
switch (hidDescriptor->interfaceNumber) {
|
||||||
|
case USB_GENERIC_HID_INTERFACE_INDEX:
|
||||||
|
hidDescriptor->buffer = &UsbConfigurationDescriptor[USB_GENERIC_HID_DESCRIPTOR_INDEX];
|
||||||
|
break;
|
||||||
|
case USB_BASIC_KEYBOARD_INTERFACE_INDEX:
|
||||||
|
hidDescriptor->buffer = &UsbConfigurationDescriptor[USB_BASIC_KEYBOARD_HID_DESCRIPTOR_INDEX];
|
||||||
|
break;
|
||||||
|
case USB_MEDIA_KEYBOARD_INTERFACE_INDEX:
|
||||||
|
hidDescriptor->buffer = &UsbConfigurationDescriptor[USB_MEDIA_KEYBOARD_HID_DESCRIPTOR_INDEX];
|
||||||
|
break;
|
||||||
|
case USB_SYSTEM_KEYBOARD_INTERFACE_INDEX:
|
||||||
|
hidDescriptor->buffer = &UsbConfigurationDescriptor[USB_SYSTEM_KEYBOARD_HID_DESCRIPTOR_INDEX];
|
||||||
|
break;
|
||||||
|
case USB_MOUSE_INTERFACE_INDEX:
|
||||||
|
hidDescriptor->buffer = &UsbConfigurationDescriptor[USB_MOUSE_HID_DESCRIPTOR_INDEX];
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return kStatus_USB_InvalidRequest;
|
||||||
|
}
|
||||||
|
return kStatus_USB_Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
usb_status_t USB_DeviceGetHidReportDescriptor(
|
usb_status_t USB_DeviceGetHidReportDescriptor(
|
||||||
usb_device_handle handle, usb_device_get_hid_report_descriptor_struct_t *hidReportDescriptor)
|
usb_device_handle handle, usb_device_get_hid_report_descriptor_struct_t *hidReportDescriptor)
|
||||||
{
|
{
|
||||||
if (USB_GENERIC_HID_INTERFACE_INDEX == hidReportDescriptor->interfaceNumber) {
|
switch (hidReportDescriptor->interfaceNumber) {
|
||||||
hidReportDescriptor->buffer = UsbGenericHidReportDescriptor;
|
case USB_GENERIC_HID_INTERFACE_INDEX:
|
||||||
hidReportDescriptor->length = USB_GENERIC_HID_REPORT_DESCRIPTOR_LENGTH;
|
hidReportDescriptor->buffer = UsbGenericHidReportDescriptor;
|
||||||
} else if (USB_BASIC_KEYBOARD_INTERFACE_INDEX == hidReportDescriptor->interfaceNumber) {
|
hidReportDescriptor->length = USB_GENERIC_HID_REPORT_DESCRIPTOR_LENGTH;
|
||||||
hidReportDescriptor->buffer = UsbBasicKeyboardReportDescriptor;
|
break;
|
||||||
hidReportDescriptor->length = USB_BASIC_KEYBOARD_REPORT_DESCRIPTOR_LENGTH;
|
case USB_BASIC_KEYBOARD_INTERFACE_INDEX:
|
||||||
} else if (USB_MEDIA_KEYBOARD_INTERFACE_INDEX == hidReportDescriptor->interfaceNumber) {
|
hidReportDescriptor->buffer = UsbBasicKeyboardReportDescriptor;
|
||||||
hidReportDescriptor->buffer = UsbMediaKeyboardReportDescriptor;
|
hidReportDescriptor->length = USB_BASIC_KEYBOARD_REPORT_DESCRIPTOR_LENGTH;
|
||||||
hidReportDescriptor->length = USB_MEDIA_KEYBOARD_REPORT_DESCRIPTOR_LENGTH;
|
break;
|
||||||
} else if (USB_SYSTEM_KEYBOARD_INTERFACE_INDEX == hidReportDescriptor->interfaceNumber) {
|
case USB_MEDIA_KEYBOARD_INTERFACE_INDEX:
|
||||||
hidReportDescriptor->buffer = UsbSystemKeyboardReportDescriptor;
|
hidReportDescriptor->buffer = UsbMediaKeyboardReportDescriptor;
|
||||||
hidReportDescriptor->length = USB_MEDIA_KEYBOARD_REPORT_DESCRIPTOR_LENGTH;
|
hidReportDescriptor->length = USB_MEDIA_KEYBOARD_REPORT_DESCRIPTOR_LENGTH;
|
||||||
} else if (USB_MOUSE_INTERFACE_INDEX == hidReportDescriptor->interfaceNumber) {
|
break;
|
||||||
hidReportDescriptor->buffer = UsbMouseReportDescriptor;
|
case USB_SYSTEM_KEYBOARD_INTERFACE_INDEX:
|
||||||
hidReportDescriptor->length = USB_MOUSE_REPORT_DESCRIPTOR_LENGTH;
|
hidReportDescriptor->buffer = UsbSystemKeyboardReportDescriptor;
|
||||||
} else {
|
hidReportDescriptor->length = USB_MEDIA_KEYBOARD_REPORT_DESCRIPTOR_LENGTH;
|
||||||
return kStatus_USB_InvalidRequest;
|
break;
|
||||||
|
case USB_MOUSE_INTERFACE_INDEX:
|
||||||
|
hidReportDescriptor->buffer = UsbMouseReportDescriptor;
|
||||||
|
hidReportDescriptor->length = USB_MOUSE_REPORT_DESCRIPTOR_LENGTH;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return kStatus_USB_InvalidRequest;
|
||||||
}
|
}
|
||||||
return kStatus_USB_Success;
|
return kStatus_USB_Success;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
#include "led_display.h"
|
#include "led_display.h"
|
||||||
#include "usb_composite_device.h"
|
#include "usb_composite_device.h"
|
||||||
|
#include "usb_report_updater.h"
|
||||||
|
|
||||||
static usb_basic_keyboard_report_t usbBasicKeyboardReports[2];
|
static usb_basic_keyboard_report_t usbBasicKeyboardReports[2];
|
||||||
uint32_t UsbBasicKeyboardActionCounter;
|
uint32_t UsbBasicKeyboardActionCounter;
|
||||||
usb_basic_keyboard_report_t* ActiveUsbBasicKeyboardReport = usbBasicKeyboardReports;
|
usb_basic_keyboard_report_t* ActiveUsbBasicKeyboardReport = usbBasicKeyboardReports;
|
||||||
volatile bool IsUsbBasicKeyboardReportSent = false;
|
|
||||||
static uint8_t usbBasicKeyboardInBuffer[USB_BASIC_KEYBOARD_REPORT_LENGTH];
|
static uint8_t usbBasicKeyboardInBuffer[USB_BASIC_KEYBOARD_REPORT_LENGTH];
|
||||||
|
|
||||||
static usb_basic_keyboard_report_t* getInactiveUsbBasicKeyboardReport(void)
|
usb_basic_keyboard_report_t* GetInactiveUsbBasicKeyboardReport(void)
|
||||||
{
|
{
|
||||||
return ActiveUsbBasicKeyboardReport == usbBasicKeyboardReports ? usbBasicKeyboardReports+1 : usbBasicKeyboardReports;
|
return ActiveUsbBasicKeyboardReport == usbBasicKeyboardReports ? usbBasicKeyboardReports+1 : usbBasicKeyboardReports;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SwitchActiveUsbBasicKeyboardReport(void)
|
static void SwitchActiveUsbBasicKeyboardReport(void)
|
||||||
{
|
{
|
||||||
ActiveUsbBasicKeyboardReport = getInactiveUsbBasicKeyboardReport();
|
ActiveUsbBasicKeyboardReport = GetInactiveUsbBasicKeyboardReport();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResetActiveUsbBasicKeyboardReport(void)
|
void ResetActiveUsbBasicKeyboardReport(void)
|
||||||
@@ -22,14 +22,20 @@ void ResetActiveUsbBasicKeyboardReport(void)
|
|||||||
bzero(ActiveUsbBasicKeyboardReport, USB_BASIC_KEYBOARD_REPORT_LENGTH);
|
bzero(ActiveUsbBasicKeyboardReport, USB_BASIC_KEYBOARD_REPORT_LENGTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
static usb_status_t UsbBasicKeyboardAction(void)
|
usb_status_t UsbBasicKeyboardAction(void)
|
||||||
{
|
{
|
||||||
usb_status_t status = USB_DeviceHidSend(
|
if (!UsbCompositeDevice.attach) {
|
||||||
|
return kStatus_USB_Error; // The device is not attached
|
||||||
|
}
|
||||||
|
|
||||||
|
usb_status_t usb_status = USB_DeviceHidSend(
|
||||||
UsbCompositeDevice.basicKeyboardHandle, USB_BASIC_KEYBOARD_ENDPOINT_INDEX,
|
UsbCompositeDevice.basicKeyboardHandle, USB_BASIC_KEYBOARD_ENDPOINT_INDEX,
|
||||||
(uint8_t*)getInactiveUsbBasicKeyboardReport(), USB_BASIC_KEYBOARD_REPORT_LENGTH);
|
(uint8_t *)ActiveUsbBasicKeyboardReport, USB_BASIC_KEYBOARD_REPORT_LENGTH);
|
||||||
IsUsbBasicKeyboardReportSent = true;
|
if (usb_status == kStatus_USB_Success) {
|
||||||
UsbBasicKeyboardActionCounter++;
|
UsbBasicKeyboardActionCounter++;
|
||||||
return status;
|
SwitchActiveUsbBasicKeyboardReport();
|
||||||
|
}
|
||||||
|
return usb_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
usb_status_t UsbBasicKeyboardCallback(class_handle_t handle, uint32_t event, void *param)
|
usb_status_t UsbBasicKeyboardCallback(class_handle_t handle, uint32_t event, void *param)
|
||||||
@@ -37,11 +43,14 @@ usb_status_t UsbBasicKeyboardCallback(class_handle_t handle, uint32_t event, voi
|
|||||||
usb_status_t error = kStatus_USB_Error;
|
usb_status_t error = kStatus_USB_Error;
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
|
// This event is received when the report has been sent
|
||||||
case kUSB_DeviceHidEventSendResponse:
|
case kUSB_DeviceHidEventSendResponse:
|
||||||
|
UsbReportUpdateSemaphore &= ~(1 << USB_BASIC_KEYBOARD_INTERFACE_INDEX);
|
||||||
if (UsbCompositeDevice.attach) {
|
if (UsbCompositeDevice.attach) {
|
||||||
return UsbBasicKeyboardAction();
|
error = kStatus_USB_Success;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case kUSB_DeviceHidEventRecvResponse:
|
||||||
case kUSB_DeviceHidEventGetReport:
|
case kUSB_DeviceHidEventGetReport:
|
||||||
error = kStatus_USB_InvalidRequest;
|
error = kStatus_USB_InvalidRequest;
|
||||||
break;
|
break;
|
||||||
@@ -61,7 +70,7 @@ usb_status_t UsbBasicKeyboardCallback(class_handle_t handle, uint32_t event, voi
|
|||||||
report->reportBuffer = usbBasicKeyboardInBuffer;
|
report->reportBuffer = usbBasicKeyboardInBuffer;
|
||||||
error = kStatus_USB_Success;
|
error = kStatus_USB_Success;
|
||||||
} else {
|
} else {
|
||||||
error = kStatus_USB_InvalidRequest;
|
error = kStatus_USB_AllocFail;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -79,16 +88,10 @@ usb_status_t UsbBasicKeyboardCallback(class_handle_t handle, uint32_t event, voi
|
|||||||
|
|
||||||
usb_status_t UsbBasicKeyboardSetConfiguration(class_handle_t handle, uint8_t configuration)
|
usb_status_t UsbBasicKeyboardSetConfiguration(class_handle_t handle, uint8_t configuration)
|
||||||
{
|
{
|
||||||
if (USB_COMPOSITE_CONFIGURATION_INDEX == configuration) {
|
|
||||||
return UsbBasicKeyboardAction();
|
|
||||||
}
|
|
||||||
return kStatus_USB_Error;
|
return kStatus_USB_Error;
|
||||||
}
|
}
|
||||||
|
|
||||||
usb_status_t UsbBasicKeyboardSetInterface(class_handle_t handle, uint8_t interface, uint8_t alternateSetting)
|
usb_status_t UsbBasicKeyboardSetInterface(class_handle_t handle, uint8_t interface, uint8_t alternateSetting)
|
||||||
{
|
{
|
||||||
if (USB_BASIC_KEYBOARD_INTERFACE_INDEX == interface) {
|
|
||||||
return UsbBasicKeyboardAction();
|
|
||||||
}
|
|
||||||
return kStatus_USB_Error;
|
return kStatus_USB_Error;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,6 @@
|
|||||||
|
|
||||||
// Variables:
|
// Variables:
|
||||||
|
|
||||||
extern volatile bool IsUsbBasicKeyboardReportSent;
|
|
||||||
extern uint32_t UsbBasicKeyboardActionCounter;
|
extern uint32_t UsbBasicKeyboardActionCounter;
|
||||||
extern usb_basic_keyboard_report_t* ActiveUsbBasicKeyboardReport;
|
extern usb_basic_keyboard_report_t* ActiveUsbBasicKeyboardReport;
|
||||||
|
|
||||||
@@ -42,6 +41,7 @@
|
|||||||
usb_status_t UsbBasicKeyboardSetInterface(class_handle_t handle, uint8_t interface, uint8_t alternateSetting);
|
usb_status_t UsbBasicKeyboardSetInterface(class_handle_t handle, uint8_t interface, uint8_t alternateSetting);
|
||||||
|
|
||||||
void ResetActiveUsbBasicKeyboardReport(void);
|
void ResetActiveUsbBasicKeyboardReport(void);
|
||||||
void SwitchActiveUsbBasicKeyboardReport(void);
|
usb_basic_keyboard_report_t* GetInactiveUsbBasicKeyboardReport(void);
|
||||||
|
usb_status_t UsbBasicKeyboardAction(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -7,6 +7,10 @@ uint8_t GenericHidOutBuffer[USB_GENERIC_HID_OUT_BUFFER_LENGTH];
|
|||||||
|
|
||||||
static usb_status_t UsbReceiveData(void)
|
static usb_status_t UsbReceiveData(void)
|
||||||
{
|
{
|
||||||
|
if (!UsbCompositeDevice.attach) {
|
||||||
|
return kStatus_USB_Error; // The device is not attached
|
||||||
|
}
|
||||||
|
|
||||||
return USB_DeviceHidRecv(UsbCompositeDevice.genericHidHandle,
|
return USB_DeviceHidRecv(UsbCompositeDevice.genericHidHandle,
|
||||||
USB_GENERIC_HID_ENDPOINT_OUT_INDEX,
|
USB_GENERIC_HID_ENDPOINT_OUT_INDEX,
|
||||||
GenericHidInBuffer,
|
GenericHidInBuffer,
|
||||||
@@ -18,7 +22,11 @@ usb_status_t UsbGenericHidCallback(class_handle_t handle, uint32_t event, void *
|
|||||||
usb_status_t error = kStatus_USB_Error;
|
usb_status_t error = kStatus_USB_Error;
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
|
// This event is received when the report has been sent
|
||||||
case kUSB_DeviceHidEventSendResponse:
|
case kUSB_DeviceHidEventSendResponse:
|
||||||
|
if (UsbCompositeDevice.attach) {
|
||||||
|
error = kStatus_USB_Success;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case kUSB_DeviceHidEventRecvResponse:
|
case kUSB_DeviceHidEventRecvResponse:
|
||||||
UsbProtocolHandler();
|
UsbProtocolHandler();
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
#include "usb_composite_device.h"
|
#include "usb_composite_device.h"
|
||||||
|
#include "usb_report_updater.h"
|
||||||
|
|
||||||
uint32_t UsbMediaKeyboardActionCounter;
|
uint32_t UsbMediaKeyboardActionCounter;
|
||||||
static usb_media_keyboard_report_t usbMediaKeyboardReports[2];
|
static usb_media_keyboard_report_t usbMediaKeyboardReports[2];
|
||||||
usb_media_keyboard_report_t* ActiveUsbMediaKeyboardReport = usbMediaKeyboardReports;
|
usb_media_keyboard_report_t* ActiveUsbMediaKeyboardReport = usbMediaKeyboardReports;
|
||||||
volatile bool IsUsbMediaKeyboardReportSent = false;
|
|
||||||
|
|
||||||
static usb_media_keyboard_report_t* getInactiveUsbMediaKeyboardReport(void)
|
usb_media_keyboard_report_t* GetInactiveUsbMediaKeyboardReport(void)
|
||||||
{
|
{
|
||||||
return ActiveUsbMediaKeyboardReport == usbMediaKeyboardReports ? usbMediaKeyboardReports+1 : usbMediaKeyboardReports;
|
return ActiveUsbMediaKeyboardReport == usbMediaKeyboardReports ? usbMediaKeyboardReports+1 : usbMediaKeyboardReports;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SwitchActiveUsbMediaKeyboardReport(void)
|
static void SwitchActiveUsbMediaKeyboardReport(void)
|
||||||
{
|
{
|
||||||
ActiveUsbMediaKeyboardReport = getInactiveUsbMediaKeyboardReport();
|
ActiveUsbMediaKeyboardReport = GetInactiveUsbMediaKeyboardReport();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResetActiveUsbMediaKeyboardReport(void)
|
void ResetActiveUsbMediaKeyboardReport(void)
|
||||||
@@ -20,14 +20,20 @@ void ResetActiveUsbMediaKeyboardReport(void)
|
|||||||
bzero(ActiveUsbMediaKeyboardReport, USB_MEDIA_KEYBOARD_REPORT_LENGTH);
|
bzero(ActiveUsbMediaKeyboardReport, USB_MEDIA_KEYBOARD_REPORT_LENGTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
static usb_status_t UsbMediaKeyboardAction(void)
|
usb_status_t UsbMediaKeyboardAction(void)
|
||||||
{
|
{
|
||||||
usb_status_t status = USB_DeviceHidSend(
|
if (!UsbCompositeDevice.attach) {
|
||||||
|
return kStatus_USB_Error; // The device is not attached
|
||||||
|
}
|
||||||
|
|
||||||
|
usb_status_t usb_status = USB_DeviceHidSend(
|
||||||
UsbCompositeDevice.mediaKeyboardHandle, USB_MEDIA_KEYBOARD_ENDPOINT_INDEX,
|
UsbCompositeDevice.mediaKeyboardHandle, USB_MEDIA_KEYBOARD_ENDPOINT_INDEX,
|
||||||
(uint8_t*)getInactiveUsbMediaKeyboardReport(), USB_MEDIA_KEYBOARD_REPORT_LENGTH);
|
(uint8_t *)ActiveUsbMediaKeyboardReport, USB_MEDIA_KEYBOARD_REPORT_LENGTH);
|
||||||
IsUsbMediaKeyboardReportSent = true;
|
if (usb_status == kStatus_USB_Success) {
|
||||||
UsbMediaKeyboardActionCounter++;
|
UsbMediaKeyboardActionCounter++;
|
||||||
return status;
|
SwitchActiveUsbMediaKeyboardReport();
|
||||||
|
}
|
||||||
|
return usb_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
usb_status_t UsbMediaKeyboardCallback(class_handle_t handle, uint32_t event, void *param)
|
usb_status_t UsbMediaKeyboardCallback(class_handle_t handle, uint32_t event, void *param)
|
||||||
@@ -35,11 +41,14 @@ usb_status_t UsbMediaKeyboardCallback(class_handle_t handle, uint32_t event, voi
|
|||||||
usb_status_t error = kStatus_USB_Error;
|
usb_status_t error = kStatus_USB_Error;
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
|
// This event is received when the report has been sent
|
||||||
case kUSB_DeviceHidEventSendResponse:
|
case kUSB_DeviceHidEventSendResponse:
|
||||||
|
UsbReportUpdateSemaphore &= ~(1 << USB_MEDIA_KEYBOARD_INTERFACE_INDEX);
|
||||||
if (UsbCompositeDevice.attach) {
|
if (UsbCompositeDevice.attach) {
|
||||||
return UsbMediaKeyboardAction();
|
error = kStatus_USB_Success;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case kUSB_DeviceHidEventRecvResponse:
|
||||||
case kUSB_DeviceHidEventGetReport:
|
case kUSB_DeviceHidEventGetReport:
|
||||||
case kUSB_DeviceHidEventSetReport:
|
case kUSB_DeviceHidEventSetReport:
|
||||||
case kUSB_DeviceHidEventRequestReportBuffer:
|
case kUSB_DeviceHidEventRequestReportBuffer:
|
||||||
@@ -59,16 +68,10 @@ usb_status_t UsbMediaKeyboardCallback(class_handle_t handle, uint32_t event, voi
|
|||||||
|
|
||||||
usb_status_t UsbMediaKeyboardSetConfiguration(class_handle_t handle, uint8_t configuration)
|
usb_status_t UsbMediaKeyboardSetConfiguration(class_handle_t handle, uint8_t configuration)
|
||||||
{
|
{
|
||||||
if (USB_COMPOSITE_CONFIGURATION_INDEX == configuration) {
|
|
||||||
return UsbMediaKeyboardAction();
|
|
||||||
}
|
|
||||||
return kStatus_USB_Error;
|
return kStatus_USB_Error;
|
||||||
}
|
}
|
||||||
|
|
||||||
usb_status_t UsbMediaKeyboardSetInterface(class_handle_t handle, uint8_t interface, uint8_t alternateSetting)
|
usb_status_t UsbMediaKeyboardSetInterface(class_handle_t handle, uint8_t interface, uint8_t alternateSetting)
|
||||||
{
|
{
|
||||||
if (USB_MEDIA_KEYBOARD_INTERFACE_INDEX == interface) {
|
|
||||||
return UsbMediaKeyboardAction();
|
|
||||||
}
|
|
||||||
return kStatus_USB_Error;
|
return kStatus_USB_Error;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,6 @@
|
|||||||
|
|
||||||
// Variables:
|
// Variables:
|
||||||
|
|
||||||
extern volatile bool IsUsbMediaKeyboardReportSent;
|
|
||||||
extern uint32_t UsbMediaKeyboardActionCounter;
|
extern uint32_t UsbMediaKeyboardActionCounter;
|
||||||
extern usb_media_keyboard_report_t* ActiveUsbMediaKeyboardReport;
|
extern usb_media_keyboard_report_t* ActiveUsbMediaKeyboardReport;
|
||||||
|
|
||||||
@@ -39,6 +38,7 @@
|
|||||||
usb_status_t UsbMediaKeyboardSetInterface(class_handle_t handle, uint8_t interface, uint8_t alternateSetting);
|
usb_status_t UsbMediaKeyboardSetInterface(class_handle_t handle, uint8_t interface, uint8_t alternateSetting);
|
||||||
|
|
||||||
void ResetActiveUsbMediaKeyboardReport(void);
|
void ResetActiveUsbMediaKeyboardReport(void);
|
||||||
void SwitchActiveUsbMediaKeyboardReport(void);
|
usb_media_keyboard_report_t* GetInactiveUsbMediaKeyboardReport(void);
|
||||||
|
usb_status_t UsbMediaKeyboardAction();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
#include "usb_composite_device.h"
|
#include "usb_composite_device.h"
|
||||||
|
#include "usb_report_updater.h"
|
||||||
|
|
||||||
uint32_t UsbMouseActionCounter;
|
uint32_t UsbMouseActionCounter;
|
||||||
static usb_mouse_report_t usbMouseReports[2];
|
static usb_mouse_report_t usbMouseReports[2];
|
||||||
usb_mouse_report_t* ActiveUsbMouseReport = usbMouseReports;
|
usb_mouse_report_t* ActiveUsbMouseReport = usbMouseReports;
|
||||||
volatile bool IsUsbMouseReportSent = false;
|
|
||||||
|
|
||||||
static usb_mouse_report_t* getInactiveUsbMouseReport(void)
|
usb_mouse_report_t* GetInactiveUsbMouseReport(void)
|
||||||
{
|
{
|
||||||
return ActiveUsbMouseReport == usbMouseReports ? usbMouseReports+1 : usbMouseReports;
|
return ActiveUsbMouseReport == usbMouseReports ? usbMouseReports+1 : usbMouseReports;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SwitchActiveUsbMouseReport(void)
|
static void SwitchActiveUsbMouseReport(void)
|
||||||
{
|
{
|
||||||
ActiveUsbMouseReport = getInactiveUsbMouseReport();
|
ActiveUsbMouseReport = GetInactiveUsbMouseReport();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResetActiveUsbMouseReport(void)
|
void ResetActiveUsbMouseReport(void)
|
||||||
@@ -20,25 +20,35 @@ void ResetActiveUsbMouseReport(void)
|
|||||||
bzero(ActiveUsbMouseReport, USB_MOUSE_REPORT_LENGTH);
|
bzero(ActiveUsbMouseReport, USB_MOUSE_REPORT_LENGTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
static volatile usb_status_t usbMouseAction(void)
|
usb_status_t UsbMouseAction(void)
|
||||||
{
|
{
|
||||||
usb_mouse_report_t *mouseReport = getInactiveUsbMouseReport();
|
if (!UsbCompositeDevice.attach) {
|
||||||
IsUsbMouseReportSent = true;
|
return kStatus_USB_Error; // The device is not attached
|
||||||
return USB_DeviceHidSend(UsbCompositeDevice.mouseHandle, USB_MOUSE_ENDPOINT_INDEX,
|
}
|
||||||
(uint8_t*)mouseReport, USB_MOUSE_REPORT_LENGTH);
|
|
||||||
|
usb_status_t usb_status = USB_DeviceHidSend(
|
||||||
|
UsbCompositeDevice.mouseHandle, USB_MOUSE_ENDPOINT_INDEX,
|
||||||
|
(uint8_t *)ActiveUsbMouseReport, USB_MOUSE_REPORT_LENGTH);
|
||||||
|
if (usb_status == kStatus_USB_Success) {
|
||||||
|
UsbMouseActionCounter++;
|
||||||
|
SwitchActiveUsbMouseReport();
|
||||||
|
}
|
||||||
|
return usb_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
usb_status_t UsbMouseCallback(class_handle_t handle, uint32_t event, void *param)
|
usb_status_t UsbMouseCallback(class_handle_t handle, uint32_t event, void *param)
|
||||||
{
|
{
|
||||||
UsbMouseActionCounter++;
|
|
||||||
usb_status_t error = kStatus_USB_Error;
|
usb_status_t error = kStatus_USB_Error;
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
|
// This event is received when the report has been sent
|
||||||
case kUSB_DeviceHidEventSendResponse:
|
case kUSB_DeviceHidEventSendResponse:
|
||||||
|
UsbReportUpdateSemaphore &= ~(1 << USB_MOUSE_INTERFACE_INDEX);
|
||||||
if (UsbCompositeDevice.attach) {
|
if (UsbCompositeDevice.attach) {
|
||||||
return usbMouseAction();
|
error = kStatus_USB_Success;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case kUSB_DeviceHidEventRecvResponse:
|
||||||
case kUSB_DeviceHidEventGetReport:
|
case kUSB_DeviceHidEventGetReport:
|
||||||
case kUSB_DeviceHidEventSetReport:
|
case kUSB_DeviceHidEventSetReport:
|
||||||
case kUSB_DeviceHidEventRequestReportBuffer:
|
case kUSB_DeviceHidEventRequestReportBuffer:
|
||||||
@@ -58,16 +68,10 @@ usb_status_t UsbMouseCallback(class_handle_t handle, uint32_t event, void *param
|
|||||||
|
|
||||||
usb_status_t UsbMouseSetConfiguration(class_handle_t handle, uint8_t configuration)
|
usb_status_t UsbMouseSetConfiguration(class_handle_t handle, uint8_t configuration)
|
||||||
{
|
{
|
||||||
if (USB_COMPOSITE_CONFIGURATION_INDEX == configuration) {
|
|
||||||
return usbMouseAction();
|
|
||||||
}
|
|
||||||
return kStatus_USB_Error;
|
return kStatus_USB_Error;
|
||||||
}
|
}
|
||||||
|
|
||||||
usb_status_t UsbMouseSetInterface(class_handle_t handle, uint8_t interface, uint8_t alternateSetting)
|
usb_status_t UsbMouseSetInterface(class_handle_t handle, uint8_t interface, uint8_t alternateSetting)
|
||||||
{
|
{
|
||||||
if (USB_MOUSE_INTERFACE_INDEX == interface) {
|
|
||||||
return usbMouseAction();
|
|
||||||
}
|
|
||||||
return kStatus_USB_Error;
|
return kStatus_USB_Error;
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user