322 Commits

Author SHA1 Message Date
László Monda
2ab727b423 Bump version to 8.6.0, update changelog and versions.h 2019-08-23 20:39:48 +02:00
László Monda
ecdcfea8a4 Merge pull request #239 from UltimateHackingKeyboard/chore-refactor-release-script
chore: refactor the make-release.js file
2019-08-23 19:31:15 +02:00
László Monda
f73d3a1c22 Merge pull request #240 from UltimateHackingKeyboard/chore-sign-cla
Sign CLA
2019-08-23 19:29:29 +02:00
Róbert Kiss
53a1065219 Sign CLA
I have read the Agreement, and fully agree to it by signing it with my GitHub username.
2019-08-23 19:24:49 +02:00
Róbert Kiss
2b8156cad8 chore: refactor the make-release.js file 2019-08-23 19:22:10 +02:00
László Monda
c564d04b22 Add SerializedMouseAction_Button_[78] and set SerializedMouseAction_Last to SerializedMouseAction_Button_8 2019-08-22 23:08:54 +02:00
László Monda
65e1e5e25a Merge pull request #238 from stephengroat/patch-1
stephengroat sign cla
2019-08-09 12:55:06 +02:00
Stephen
0a28a395fc stephengroat sign cla 2019-08-08 23:51:38 -07:00
László Monda
08e567797e Reorder signatures alphabetically. 2019-07-21 23:36:34 +02:00
László Monda
0e53bee212 Merge pull request #236 from eltang/sign-cla
Sign CLA
2019-07-21 23:08:13 +02:00
Eric Tang
d8d8a543c0 Sign CLA 2019-07-21 15:54:11 -05:00
László Monda
97cff6438e Merge pull request #232 from Lauszus/patch-1
Sign CLA
2019-07-02 02:43:59 +02:00
Kristian Sloth Lauszus
7755c57478 Sign CLA 2019-07-01 19:38:53 +02:00
László Monda
8aea024ed2 Merge pull request #226 from santiagogf89/patch-1
Sign CLA
2019-06-24 19:29:02 +02:00
Santiago
e5a7ded3d1 Sign CLA
I have read the Agreement, and fully agree to it by signing it with my GitHub username.
2019-06-24 17:58:27 +02:00
László Monda
d9d8a91817 Scroll instead of moving the pointer with the blackberry trackball. 2019-06-13 14:54:41 +02:00
László Monda
262eb4a695 Fix blackberry trackball directions. 2019-06-13 14:44:13 +02:00
László Monda
b4cd3fab9b Rename BLACKBERRY_TRACKBALL_{TOP,BOTTOM} to BLACKBERRY_TRACKBALL_{UP,DOWN} 2019-06-13 14:37:14 +02:00
László Monda
3e87ed851a Make the blackberry trackball pointer move in all 4 directions. 2019-06-13 14:26:19 +02:00
László Monda
60dade7e18 Make the BlackBerry trackball work in one direction. 2019-06-12 01:44:27 +02:00
László Monda
6c0ebc3223 Merge branch 'master' of github.com:UltimateHackingKeyboard/firmware 2019-06-11 22:00:27 +02:00
László Monda
a857780e42 Add pointer_delta_t and make the master and slaves handle it. 2019-06-11 21:58:40 +02:00
Erich Styger
6e77dece04 singed CLA 2019-06-11 12:47:20 +02:00
László Monda
a57fedec70 Use UhkModuleSlaveDriver_DriverIdToSlotId() in UhkModuleSlaveDriver_Update() 2019-06-11 00:46:47 +02:00
László Monda
95003cf55d Reimplement SLOT_ID_TO_UHK_MODULE_DRIVER_ID as UhkModuleSlaveDriver_SlotIdToDriverId and UHK_MODULE_DRIVER_ID_TO_SLOT_ID as UhkModuleSlaveDriver_DriverIdToSlotId 2019-06-11 00:42:32 +02:00
László Monda
4486f607da Make condition slightly more readable. 2019-06-11 00:28:21 +02:00
László Monda
0caf0144dc Rename UhkModuleDriverId_{Left,Right}Addon to UhkModuleDriverId_{Left,Right}Module 2019-06-10 23:02:12 +02:00
László Monda
3686b2a6ff Fix installation instructions regarding the GNU ARM Eclipse Plugins 2019-06-09 22:55:53 +02:00
László Monda
bf286b944e Merge pull request #225 from xdever/cla
Sign CLA
2019-06-09 20:27:29 +02:00
Róbert Csordás
19cdca27e7 CLA 2019-06-09 12:58:42 +02:00
László Monda
657f998afa Merge pull request #224 from kareltucek/cla
Sign CLA
2019-06-08 20:45:42 +02:00
Karel Tuček
d6d5178d87 sign cla 2019-06-08 17:50:08 +02:00
László Monda
06d1643b4f Merge pull request #223 from UltimateHackingKeyboard/sign-cla
Sign CLA
2019-06-07 21:49:50 +02:00
László Monda
3058438d88 Sign CLA. 2019-06-07 21:48:14 +02:00
László Monda
10150c4eca Update CONTRIBUTING.md 2019-06-07 21:46:44 +02:00
László Monda
196dfe3d15 Add CLA. 2019-06-07 21:26:32 +02:00
László Monda
d08de0e31d Include module.h instead of modules.h 2019-05-22 22:13:19 +02:00
László Monda
e948af3df4 Rename I2C_ADDRESS_*_ADDON_* defines to I2C_ADDRESS_*_MODULE_* 2019-05-21 23:05:10 +02:00
László Monda
fc300fff0c Add I2C_ADDRESS_MODULE_BOOTLOADER 2019-05-16 00:22:51 +02:00
László Monda
16c5cac395 Add I2C_ADDRESS_MODULE_FIRMWARE. 2019-05-16 00:18:51 +02:00
László Monda
e2e14ac73b Change the I2C address of the key cluster to I2C_ADDRESS_LEFT_MODULE_BOOTLOADER 2019-05-16 00:00:11 +02:00
László Monda
cfb15b6902 Rename *_ADDON_* I2C addresses to *_MODULE_* 2019-05-15 23:59:04 +02:00
László Monda
92752a5963 Reference the latest Agent. 2019-05-15 23:50:12 +02:00
László Monda
6b74a01a0b Change module id to ModuleId_KeyClusterLeft, MODULE_POINTER_COUNT to 1 and the keyboard matrix size to 2x2. 2019-05-15 23:19:14 +02:00
László Monda
b92bf86b99 Add firmware for the key cluster module based on the firmware of the left keyboard half. 2019-05-15 22:58:05 +02:00
László Monda
8f98bf3d2f Merge pull request #217 from kareltucek/empty_macro_fix
Fix play of empty macro
2019-04-01 13:14:50 +02:00
Karel Tuček
a712ac6c8a Fix play of empty macro 2019-04-01 12:51:59 +02:00
László Monda
f54967ddab Merge pull request #215 from kareltucek/type_fix
fix wrong type
2019-04-01 02:19:45 +02:00
Karel Tuček
4832384cf3 fix key->mouseButton 2019-03-31 22:21:47 +02:00
Karel Tuček
f310e26c8e fix wrong type 2019-03-31 21:35:26 +02:00
László Monda
afb434a4bd Try to fix chatter by maintaining the strobe between the invocations of KeyMatrix_ScanRow() 2019-03-29 09:26:37 +01:00
László Monda
ff14aa8842 Merge pull request #210 from p4elkin/canonical-readme-update
add https://github.com/p4elkin/firmware to the list of featured forks
2019-03-06 10:33:51 +01:00
Aleksandr Pchelintcev
0ed9c62602 add https://github.com/p4elkin/firmware to the list of featured forks 2019-03-06 09:17:37 +02:00
László Monda
1373380221 Update README.md 2019-02-09 18:43:25 +01:00
László Monda
3f8314474a Update README.md 2019-02-09 18:40:58 +01:00
László Monda
da5e668ad2 Link the latest 10.3.0 MCUXpresso IDE versions. 2019-02-09 04:34:59 +01:00
László Monda
5e382c67e9 Update README.md 2019-02-08 07:04:51 +01:00
László Monda
9076a3a6c0 Blink the right test LED at the same 100ms interval as the left test LED. 2019-02-07 00:27:43 +01:00
László Monda
6ab0c2eb72 Bump version to 8.5.4, update changelog, package.json and versions.h 2019-01-05 16:16:37 +01:00
László Monda
2e73bb9ea1 Merge pull request #203 from UltimateHackingKeyboard/sticky-modifiers
Adjust the behavior of sticky modifiers
2018-12-26 03:42:47 +01:00
Eric Tang
e5ac605b4c Adjust the behavior of sticky modiifers 2018-12-25 16:08:10 -08:00
László Monda
fb220038b7 Merge pull request #200 from kareltucek/origin_master
Feature firmware forks in readme
2018-11-18 14:44:46 +01:00
Karel Tuček
464c56f599 Feature firmware forks in Readme 2018-11-18 12:36:34 +01:00
László Monda
a59b43b433 Bump version to 8.5.3, update package.json, changelog, versions.h and reference the latest Agent. 2018-10-20 01:20:31 +02:00
László Monda
ceb2f3de00 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. 2018-10-20 01:11:36 +02:00
László Monda
5cd4030a93 Merge branch 'master' of github.com:UltimateHackingKeyboard/firmware 2018-10-06 21:33:16 +02:00
László Monda
21ae72dd9e Bump version to 8.5.2, update changelog, package.json, versions.h, and Agent. 2018-10-06 21:31:32 +02:00
László Monda
dba61c6a42 Merge pull request #186 from UltimateHackingKeyboard/action-cache
Extend the behavior of keys upon layer changes to keymap changes
2018-10-06 20:56:06 +02:00
László Monda
f61acc483b Update ISSUE_TEMPLATE 2018-10-06 20:26:47 +02:00
László Monda
fb38e4099b Update ISSUE_TEMPLATE 2018-10-06 20:03:51 +02:00
László Monda
5fe19abe06 Merge branch 'master' into action-cache 2018-10-06 19:44:08 +02:00
Eric Tang
06e34fdcbc Convert the layer cache to an action cache 2018-10-06 10:02:46 -05:00
Eric Tang
cc6666b96d Don't suppress keys upon keymap changes 2018-10-06 10:02:23 -05:00
László Monda
a22dfdd917 Update version to 8.5.1, changelog, package.json and versions.h 2018-10-04 23:10:58 +02:00
László Monda
8b69a25dda Reset UsbReportUpdateSemaphore if it gets stuck for 100ms. This should fix occasional freezes. 2018-10-04 23:04:13 +02:00
László Monda
6f2b45c27c Update changelog, package.json, versions.h and Agent reference. 2018-10-04 22:46:01 +02:00
László Monda
98f7d512de Extract CurrentTime and remove Timer_{Get,Set}CurrentTime() 2018-10-04 20:38:36 +02:00
László Monda
c5cf738fd0 Expose UsbReportUpdateSemaphore via UsbCommand_{Get,Set}Variable() 2018-10-04 19:23:38 +02:00
László Monda
af31ae210a Move the pointer not by 1 but by 5 pixels when testing the USB stack to make the pointer easier to see. 2018-09-26 16:34:01 +02:00
László Monda
44799995b9 Update default issue text to include Karabiner Elements. 2018-09-26 00:03:20 +02:00
László Monda
3f5f83a19b Add issue template. 2018-09-25 23:55:56 +02:00
László Monda
bc4f35e578 Delete issue template. 2018-09-25 23:55:26 +02:00
László Monda
e9309aab16 Add issue template regarding Karabiner Elements 2018-09-25 23:52:09 +02:00
László Monda
f004b84399 Merge pull request #175 from UltimateHackingKeyboard/macro-engine
Use the correct scancode so that commas are outputted
2018-09-19 14:22:01 +02:00
Eric Tang
58f8120611 Use the correct scancode so that commas are outputted 2018-09-18 23:10:08 -05:00
László Monda
5b71fb7aaa Merge pull request #168 from UltimateHackingKeyboard/primary-role-modifiers
Send primary role modifiers consistently
2018-09-03 08:38:08 +02:00
Eric Tang
9d0f41bf5e Send primary role modifiers consistently 2018-09-02 00:02:40 -05:00
László Monda
47a3a8ad80 Merge pull request #163 from UltimateHackingKeyboard/layer-deactivation
Only allow layer switcher keys to deactivate toggled layers
2018-08-26 20:47:10 +02:00
Eric Tang
b4908bf2ac Only allow layer switcher keys to deactivate toggled layers 2018-08-26 11:46:38 -05:00
Eric Tang
846342e851 Deactivate secondary roles when switching keymaps 2018-08-25 07:22:48 -05:00
László Monda
3196abe574 Bump firmware version to 8.4.5, update changelog, package.json and versions.h 2018-08-21 21:56:41 +02:00
László Monda
5f0bae1840 Merge branch 'layer-cache' 2018-08-21 16:11:07 +02:00
László Monda
c3a38c8b59 Split the point to point that features Agent installation and running the external tool. 2018-08-21 04:21:06 +02:00
László Monda
1f9d31cad4 Update build instructions. 2018-08-21 04:18:54 +02:00
László Monda
b89de6655e Upgrade to the latest MCUXpresso IDE. 2018-08-21 03:50:30 +02:00
Eric Tang
4a1b747197 Implement a layer cache 2018-08-19 11:28:28 -07:00
László Monda
eca87d2f62 Merge pull request #159 from UltimateHackingKeyboard/suppress-keys
Suppress pressed keys when the layer or keymap changes
2018-08-19 05:00:10 +02:00
Eric Tang
2e2b9d08a9 Suppress pressed keys when the layer or keymap changes 2018-08-18 19:52:07 -07:00
László Monda
b4c2204e50 Bump firmware version to 8.4.4, update changelog, package.json and versions.h 2018-08-14 00:07:21 +02:00
László Monda
4c0546de6c Merge branch 'master' of github.com:UltimateHackingKeyboard/firmware 2018-08-13 23:08:53 +02:00
László Monda
bea4c34a51 Merge pull request #154 from UltimateHackingKeyboard/secondary-role
Ensure that secondary roles are triggered consistently
2018-08-13 23:03:48 +02:00
László Monda
bdc6232780 Merge branch 'master' of github.com:UltimateHackingKeyboard/firmware 2018-08-13 22:38:41 +02:00
László Monda
1d2d1c5049 Merge pull request #153 from UltimateHackingKeyboard/wake
Don't wake the host if a key is held down through the beginning of sleep
2018-08-13 21:42:46 +02:00
Eric Tang
67f07abd0d Ensure that secondary roles are triggered consistently 2018-08-13 12:30:36 -07:00
Eric Tang
4bfcd6e02c Don't wake the host if a key is held down through the beginning of sleep 2018-08-13 12:07:08 -07:00
László Monda
7eb190489b Bump firmware version to 8.4.3, update changelog, package.json, versions.h 2018-08-12 10:41:43 +02:00
László Monda
640c034111 Compensate "double tap to lock layer" timeouts for the timer fix to make them as long as before 8.3.3 2018-08-11 01:53:45 +02:00
László Monda
a6f12848ed Add timer related changelog entry. 2018-08-11 01:48:44 +02:00
László Monda
47f6a27e48 Move left/src/init_clock.[ch] to shared/slave 2018-08-06 00:16:26 +02:00
László Monda
9cc383a91d Delete config.h 2018-08-05 22:49:31 +02:00
László Monda
a441cdf5d2 Delete debug_over_spi.[ch] 2018-08-05 22:47:55 +02:00
László Monda
8297dd5c48 Don't include the debug over SPI code from any file. 2018-08-05 22:44:11 +02:00
László Monda
225a481938 Fix coding style. 2018-08-05 22:31:48 +02:00
László Monda
5572952dc8 Use one liner comment style. 2018-08-05 22:28:30 +02:00
László Monda
7d011237f8 Always use the I2C watchdog for the left half. Remove I2C_WATCHDOG and relevant preprocessor stuff. 2018-08-05 22:24:34 +02:00
László Monda
1a47c6e629 Minor MCUXpresso .cproject file modification. 2018-08-05 22:22:21 +02:00
László Monda
047a232e7e Update .cproject file to make MCUXpresso IDE not pop up the warning regarding SDK version. 2018-08-04 23:48:11 +02:00
László Monda
28f5999cbb Bump firmware version to 8.4.2, update changelog and versions.h 2018-08-02 13:00:31 +02:00
László Monda
fe7505a2df Merge branch 'master' of github.com:UltimateHackingKeyboard/firmware 2018-08-02 12:51:22 +02:00
László Monda
b6ac16074c Merge pull request #149 from UltimateHackingKeyboard/secondary-role
Fix various secondary role bugs
2018-08-02 03:41:25 +02:00
Eric Tang
0bf205c5d2 Keep sticky modifiers active when modifier-only keys are pressed 2018-08-01 18:12:12 -07:00
Eric Tang
e4a99a9400 Make sticky modifiers work consistently 2018-08-01 16:36:29 -07:00
Eric Tang
1e9b5833eb Correctly handle keypresses which triggers a secondary role 2018-08-01 15:53:55 -07:00
Eric Tang
79b052fca7 Remove redundant conditions 2018-07-31 16:12:51 -07:00
László Monda
baee0b5682 Bump firmware version to 8.4.1, update changelog, package.json, versions.h 2018-07-31 23:57:33 +02:00
László Monda
6153d54f59 Merge pull request #144 from UltimateHackingKeyboard/sleep-wake
Make some improvements to the sleep/wake code
2018-07-26 22:47:40 +02:00
Eric Tang
0a6ebe2903 Remove the old code for detecting new keypresses 2018-07-25 15:16:15 -07:00
László Monda
1fbbeb0f33 Bump firmware version to 8.4.0, update changelog, package.json, versions.h 2018-07-24 15:30:18 +02:00
László Monda
456f0e9e58 Merge branch 'master' of github.com:UltimateHackingKeyboard/firmware 2018-07-24 14:50:53 +02:00
László Monda
0248a0e79f Set debounce press and release time to 50ms by default. 2018-07-24 14:50:16 +02:00
Eric Tang
0e5ec29433 Tweak the logic of the USB stack test 2018-07-22 21:22:48 -07:00
Eric Tang
2d7cd68459 Make some improvements to the sleep/wake code 2018-07-22 13:13:29 -07:00
László Monda
5ac10fabcb Add back simulateKeypresses. 2018-07-22 16:24:05 +02:00
László Monda
b11017609d Merge pull request #143 from UltimateHackingKeyboard/usb-variables
Expose variables via USB
2018-07-22 16:04:55 +02:00
Eric Tang
c3a5d258e5 Rename the test mode for clarity 2018-07-20 17:31:00 -07:00
Eric Tang
a2866feb77 Temporarily allow the USB stack test to be activated through USB 2018-07-20 17:23:44 -07:00
Eric Tang
8c50192d6c Introduce a new way of activating the test mode 2018-07-20 17:17:59 -07:00
Eric Tang
63d82d92db Expose variables via USB 2018-07-20 17:17:30 -07:00
László Monda
1bced1be13 Merge branch 'debounce-configuration' 2018-07-16 18:24:38 +02:00
Eric Tang
86196d438c Add a test mode 2018-07-05 20:15:33 -07:00
Eric Tang
d722b3d173 Make debounce times configurable on the fly 2018-07-05 14:41:19 -07:00
Eric Tang
2ef5c49090 Merge branch 'interrupt-removal' 2018-07-05 14:34:33 -07:00
Eric Tang
5a137392ee Remove the key scanning interrupt 2018-07-05 12:43:38 -07:00
Eric Tang
27d12ea31f Remove the debouncing interrupt 2018-07-05 12:33:55 -07:00
Eric Tang
9ba09ec8eb Convert key_state_t to a bit field 2018-07-05 11:50:13 -07:00
László Monda
014addd777 Bump version to 8.3.3, update changelog, package.json, versions.h 2018-07-03 01:26:40 +02:00
László Monda
4562a17155 Make the test code exercise the media and mouse interfaces too. 2018-07-03 00:34:39 +02:00
Eric Tang
950843ca2c Use return instead of break 2018-07-01 17:17:42 -07:00
László Monda
9600f46f83 Merge branch 'waking-on-keypress' 2018-07-01 22:34:35 +02:00
Eric Tang
ef7589d83a Fix the mouse scrolling issue 2018-07-01 08:34:59 -07:00
Eric Tang
84f48ed055 Wake up the host when a new keypress is detected 2018-07-01 08:34:17 -07:00
László Monda
ebef301e27 Merge pull request #123 from Lauszus/dev
Fix issue with keyboard freezing
2018-07-01 16:19:50 +02:00
László Monda
5b8b8d93e4 Merge pull request #135 from Lauszus/travis
Remove Eclipse build from the Travis job and cache the gcc archives
2018-07-01 00:43:07 +02:00
Kristian Sloth Lauszus
d48049535e Remove Eclipse build from the Travis job and cache the gcc archives 2018-07-01 00:32:03 +02:00
Kristian Sloth Lauszus
5bd479ab8e Fixed unused variable
This was due to a merge conflict in c69f664e85
2018-07-01 00:04:26 +02:00
Kristian Sloth Lauszus
372151848a Just define the usb_status_t variable inside the if-statements 2018-06-30 23:44:58 +02:00
Kristian Sloth Lauszus
5b32c0da43 Disable the key press test code 2018-06-30 23:42:39 +02:00
Kristian Sloth Lauszus
edf34de4b5 Fixed comment 2018-06-30 23:23:12 +02:00
Kristian Sloth Lauszus
8c7eb079ec Re-added code from 994e2f6b79 2018-06-30 23:03:50 +02:00
Kristian Sloth Lauszus
6612f7cced Fixed warning 2018-06-30 22:48:52 +02:00
Kristian Sloth Lauszus
7606f311c8 Fix coding style 2018-06-30 22:38:23 +02:00
Kristian Sloth Lauszus
9fe73233af Fix merge issue 2018-06-30 22:36:48 +02:00
Kristian Sloth Lauszus
cba1ef97b6 Revert "Set the USB interrupt priority to the maximum possible" 2018-06-30 22:31:32 +02:00
Kristian Sloth Lauszus
c69f664e85 Merge branch 'master' into dev
# Conflicts:
#	right/src/timer.c
#	right/src/timer.h
#	right/src/usb_report_updater.c
2018-06-30 22:27:52 +02:00
Kristian Sloth Lauszus
6c895988de Merge branch 'Lauszus-dev' into dev
# Conflicts:
#	right/src/usb_interfaces/usb_interface_basic_keyboard.c
#	right/src/usb_interfaces/usb_interface_media_keyboard.c
#	right/src/usb_interfaces/usb_interface_mouse.c
#	right/src/usb_interfaces/usb_interface_system_keyboard.c
#	right/src/usb_report_updater.c
2018-06-30 22:23:32 +02:00
Eric Tang
f16a004583 Revert "Default to kStatus_USB_Success"
This reverts commit 6eceb6ad30.
2018-06-30 13:06:23 -07:00
Kristian Sloth Lauszus
c870f335a7 Set the other interrupts back to the value there were before 2018-06-30 18:55:31 +02:00
Kristian Sloth Lauszus
b6f59563c7 Revert cancelling a transfer, as the USB endpoint is still locked up 2018-06-30 18:25:03 +02:00
Kristian Sloth Lauszus
409bd01af6 Decreasing the USB priority actually works better
Needs more testing
2018-06-30 17:28:19 +02:00
Kristian Sloth Lauszus
b9b5eb2c76 Make sure the device is attached before sending the report 2018-06-30 17:06:59 +02:00
Kristian Sloth Lauszus
11a8ffbaf5 Make sure the composite device is attached before setting the kStatus_USB_Success flag 2018-06-30 17:06:59 +02:00
Kristian Sloth Lauszus
9938f14d20 Set the USB interrupt priority to the maximum possible 2018-06-30 17:06:59 +02:00
Kristian Sloth Lauszus
217259ba63 Cancel the ongoing transfer if it is still in progress 2018-06-30 17:06:58 +02:00
Eric Tang
e5afa33b79 Allow scanning to continue if the host is asleep 2018-06-29 23:06:31 -07:00
Eric Tang
d3dfc9bd2c Revert "Simplify logic"
This reverts commit 994e2f6b79.
2018-06-29 23:01:31 -07:00
Eric Tang
8f6251bc4d Only set the semaphore if the report is successfully requested 2018-06-29 23:01:20 -07:00
Eric Tang
b93f211502 Don't retry sending a report if it fails 2018-06-29 22:44:42 -07:00
Eric Tang
69411e53e9 Rename usbMouseAction to UsbMouseAction 2018-06-29 17:23:15 -07:00
Eric Tang
39819e6058 Type Backspace instead of b 2018-06-29 13:29:40 -07:00
Eric Tang
bd97bba4b5 Wake up the host before attempting to send reports 2018-06-29 13:19:49 -07:00
Eric Tang
4214f3e0b6 Use a semaphore to control the rate at which reports are updated 2018-06-29 13:08:24 -07:00
Eric Tang
6eceb6ad30 Default to kStatus_USB_Success 2018-06-29 12:54:06 -07:00
Eric Tang
994e2f6b79 Simplify logic 2018-06-29 12:43:59 -07:00
Eric Tang
baa5e8f037 Remove redundant guard clauses 2018-06-29 12:37:53 -07:00
Eric Tang
cbd5f1b500 Redefine USB_CONFIGURATION_DESCRIPTOR_TOTAL_LENGTH 2018-06-28 17:25:14 -07:00
Eric Tang
c1dc4be8c8 Fix USB_DeviceGetHidDescriptor 2018-06-28 17:25:09 -07:00
Eric Tang
1bd8c7dca8 Use a switch statement 2018-06-28 16:10:26 -07:00
László Monda
d72ea4dde5 Merge pull request #131 from UltimateHackingKeyboard/macro-engine
Implement the macro engine
2018-06-27 23:02:09 +02:00
Eric Tang
5d621880ec Merge branch 'dev' of https://github.com/Lauszus/firmware into Lauszus-dev 2018-06-27 13:44:17 -07:00
László Monda
5c3e2966c4 Restore the logic of the key debouncer. Make it only debounce keypresses and set its timeout to 100ms. 2018-06-27 21:42:15 +02:00
László Monda
d21fe30139 Bump firmware version to 8.3.2. Update changelog, package.json and versions.h 2018-06-27 14:26:29 +02:00
László Monda
224d9eae42 Merge pull request #130 from UltimateHackingKeyboard/key-release-debouncing
Fix key chattering
2018-06-27 14:13:05 +02:00
Kristian Sloth Lauszus
8c02f3db53 Merge branch 'master' into dev
# Conflicts:
#	right/src/usb_interfaces/usb_interface_basic_keyboard.c
#	right/src/usb_interfaces/usb_interface_basic_keyboard.h
#	right/src/usb_interfaces/usb_interface_media_keyboard.c
#	right/src/usb_interfaces/usb_interface_media_keyboard.h
#	right/src/usb_interfaces/usb_interface_mouse.c
#	right/src/usb_interfaces/usb_interface_mouse.h
#	right/src/usb_interfaces/usb_interface_system_keyboard.c
#	right/src/usb_interfaces/usb_interface_system_keyboard.h
#	right/src/usb_report_updater.c
2018-06-27 10:12:40 +02:00
Eric Tang
02bbeb7177 Fix the formatting in timer.c 2018-06-26 22:13:13 -07:00
Eric Tang
cdfabaec42 Make the debounce counters count down 2018-06-26 21:58:48 -07:00
Eric Tang
0e9525ce9a Don't clear the whole report 2018-06-26 18:39:41 -07:00
Eric Tang
633a6cec77 Clear the report at the end of a move mouse or scroll mouse macro 2018-06-26 18:39:41 -07:00
Eric Tang
d35a7cc644 Clear the report at the end of a text macro 2018-06-26 18:39:41 -07:00
Eric Tang
76a91c010b Implement the text macro action 2018-06-26 18:39:41 -07:00
Eric Tang
54b0a595bc Rename functions for consistency 2018-06-26 18:39:41 -07:00
Eric Tang
4b9aa0860c Implement the mouse macro actions 2018-06-26 18:39:41 -07:00
Eric Tang
df8792a60d Fix code formatting 2018-06-26 18:39:41 -07:00
Eric Tang
5988fce59b Implement the delay macro action 2018-06-26 18:39:41 -07:00
Eric Tang
314eb0d771 Stop macros from repeating 2018-06-26 18:39:41 -07:00
Eric Tang
c1f5a96e1b Correctly pass pointers to the active reports to memcpy 2018-06-26 18:39:41 -07:00
Eric Tang
64592d7032 Add TestLed_Blink 2018-06-26 18:39:41 -07:00
Eric Tang
c6b180b8f5 Convert macros for controlling test LEDs to functions 2018-06-26 18:39:40 -07:00
Eric Tang
0155447c6a Rename InitTestLed to TestLed_Init 2018-06-26 18:37:49 -07:00
Eric Tang
04f4053bde Add a delay function 2018-06-26 18:37:49 -07:00
Eric Tang
09a58b607c Reduce code duplication 2018-06-26 18:34:38 -07:00
Eric Tang
be82530412 Rename macro key actions in accordance with Agent 2018-06-26 18:34:38 -07:00
Eric Tang
6e11c0b8af Handle macro actions and make the macro engine preempt normal behavior 2018-06-26 18:34:38 -07:00
Eric Tang
9fade6368c Correct the type of macro delay variables 2018-06-26 18:32:51 -07:00
Eric Tang
ff99c2e734 Change KEY_DEBOUNCER_TIMEOUT_MSEC to match keyswitch datasheets 2018-06-26 18:27:01 -07:00
Eric Tang
6d356114a8 Debounce key releases 2018-06-26 18:24:30 -07:00
Eric Tang
3041132959 Merge pull request #129 from UltimateHackingKeyboard/revert-120-dev
Revert "The UHK now only sends out data when it changes"
2018-06-26 18:13:36 -07:00
Eric Tang
2877773cac Revert "The UHK now only sends out data when it changes" 2018-06-26 17:59:57 -07:00
Kristian Sloth Lauszus
a061febd01 Merge test code 2018-06-24 23:57:49 +02:00
Kristian Sloth Lauszus
e3773fd5c0 Removed some unused code 2018-06-24 19:47:28 +02:00
Kristian Sloth Lauszus
a92835454d Make sure the keyboard is not read if any of the endpoints are busy sending data 2018-06-24 18:43:21 +02:00
Kristian Sloth Lauszus
64e5fa7ecb Just read the interruptInPipeBusy flag instead of storing the transfer state in a separate variable and switch the active report back if the HID Send command fails 2018-06-24 18:43:21 +02:00
Kristian Sloth Lauszus
d1894fb62a Removed call to UpdateUsbReports() before usb has been initialised 2018-06-24 18:43:21 +02:00
Kristian Sloth Lauszus
fe7065be4a Select the "MK22FN512xxx12" under MCU settings 2018-06-23 18:47:26 +02:00
Kristian Sloth Lauszus
e7b3127af1 Send out the mouse position and wheel values continuously if the report is not zeros, but only send the mouse button states when they change 2018-06-23 18:20:09 +02:00
Kristian Sloth Lauszus
724378cf6c Make sure we do not try to send another report before the old one has finished sending 2018-06-23 17:33:20 +02:00
Kristian Sloth Lauszus
14eb9c6ec0 Merge branch 'timer' into dev 2018-06-22 21:50:31 +02:00
Kristian Sloth Lauszus
9a8b1ef8b9 The PIT timer is counting downward, so we need to subtract the count from the period value 2018-06-22 21:50:14 +02:00
Kristian Sloth Lauszus
2cc94bd1fc The BL_APP_VECTOR_TABLE_ADDRESS should be overridable 2018-06-22 18:26:51 +02:00
Kristian Sloth Lauszus
ad8de4dd56 Increase the resolution of the elapsed timer when reading the keyboard 2018-06-22 18:03:27 +02:00
Kristian Sloth Lauszus
5e97ad1b3c Just compare the active report with the inactive report stored in each interface driver 2018-06-22 17:55:21 +02:00
Kristian Sloth Lauszus
fe06ed0a4b Merge branch 'timer' into dev 2018-06-22 17:48:53 +02:00
Kristian Sloth Lauszus
d449123fab Fix PIT timer period and added functions for getting the current time in microseconds 2018-06-22 17:39:22 +02:00
Kristian Sloth Lauszus
4d483e7896 Limit the update frequency for reading the keyboard 2018-06-15 14:03:59 +02:00
László Monda
b1cbeefa28 Add base layer key mappings for the left and right modules for testing purposes. 2018-06-13 02:41:01 +02:00
Kristian Sloth Lauszus
9be3cf4865 Invalidate the stored report if the command fails
Fixes #122
2018-06-08 20:23:58 +02:00
László Monda
65006cc376 Bump firmware version to 8.3.1, update changelog, package.json, versions.h 2018-06-07 15:26:06 +02:00
László Monda
fc01b29823 Lowercase isLayerDoubleTapToggled. 2018-06-07 15:25:39 +02:00
László Monda
462595ef03 Extract handleSwitchLayerAction() 2018-06-07 14:50:49 +02:00
László Monda
b0d85795f4 Make the double tap to lock feature behave well. 2018-06-07 14:42:23 +02:00
László Monda
2c91ef51db Make releasing locked layers possible again. 2018-06-07 04:10:48 +02:00
László Monda
a54e7ac0a8 Set toggledLayers[action.switchLayer.layer] = true 2018-06-07 04:03:45 +02:00
László Monda
64f54c268b Clean up the layer toggle code a bit. 2018-06-07 03:55:40 +02:00
László Monda
d889d51a7d Merge pull request #120 from Lauszus/dev
The UHK now only sends out data when it changes
2018-06-07 03:02:36 +02:00
Kristian Sloth Lauszus
b284e9fa58 Make sure we send out a all zero report once when the a mouse report has been sent 2018-06-07 02:10:27 +02:00
Kristian Sloth Lauszus
1a0da7971a Send out the mouse report continuously if the report is not zeros 2018-06-07 01:56:16 +02:00
Kristian Sloth Lauszus
53a82a5f57 Removed unused variables, as the actions are no longer sent from within the interrupts 2018-06-07 01:50:12 +02:00
Kristian Sloth Lauszus
10985abcdb The UHK now only sends out data when it changes
Fixes #72, fixes #84 and fixes #85
2018-06-07 00:18:40 +02:00
László Monda
e60a282742 Bump firmware version to 8.3.0, update changelog and package.json 2018-06-03 14:36:18 +02:00
László Monda
a691b16ebe Make the serializer handle SwitchLayerMode_Hold, not only SwitchLayerMode_HoldAndDoubleTapToggle and SwitchLayerMode_Toggle. 2018-06-03 14:24:42 +02:00
László Monda
c38114648a Set key debounce timeout from 80ms to 100ms. This should further reduce key chattering. 2018-05-29 01:31:14 +02:00
László Monda
3fc4419f4f Bump firmware version to 8.2.5, update changelog, package.json, and versions.h 2018-05-27 01:53:41 +02:00
László Monda
033bdf6491 Merge initI2cMainBus() and initI2cEepromBus() as initI2cBus() 2018-05-27 01:43:14 +02:00
László Monda
18e3ba9558 Merge recoverI2c() and recoverI2cEeprom() as recoverI2cBus(), add i2c_bus_t. 2018-05-26 22:37:10 +02:00
László Monda
3fb552cc55 Reinitialize the EEPROM upon firmware startup and set the I2C EEPROM interrupt priority to 0. This seems to really fix #67. 2018-05-26 17:06:05 +02:00
László Monda
d093c84fb4 Fix HardwareConfig->signature{Length}="FTY" and re-release the latest version. 2018-05-21 15:25:24 +02:00
László Monda
95d7197394 Bump firmware version to 8.2.4, update the changelog, package.json and versions.h 2018-05-21 14:26:41 +02:00
László Monda
989774ced9 Make the EEPROM interrupt higher priority than the interrupts of the key scanner, key debouncer, I2C main bus and USB. Fixes #67. 2018-05-21 12:41:34 +02:00
László Monda
0e29276a56 Read the hardware and user configuration from the EEPROM even in factory reset mode. 2018-05-21 12:04:12 +02:00
László Monda
5b90d78518 Add IsFactoryResetModeEnabled. 2018-05-21 02:21:30 +02:00
László Monda
d2eb4b43c7 Add LED_DISPLAY_DEBUG_MODE and LedDisplay_DebugString, making the LED display usable for debugging purposes. 2018-05-20 12:00:05 +02:00
László Monda
a545324693 Set HardwareConfig->signature to "FTY" when the keyboard is in factory reset mode, so that Agent can act on it. 2018-05-20 01:36:27 +02:00
László Monda
27b02c32b5 Set key debounce timeout from 60ms to 80ms. This should further reduce key chattering. 2018-05-16 17:37:30 +02:00
László Monda
01e92e57f4 Bump firmware version to 8.2.3, update changelog, package.json and versions.h 2018-05-15 23:21:16 +02:00
László Monda
51b2631012 Make saving the user configuration faster by only writing the part of the EEPROM which actually contains the user configuration. Resolves #111. 2018-05-15 02:40:21 +02:00
László Monda
66c877f7bd Don't switch keymaps instead of playing macros. Fixes #86. 2018-05-15 01:47:24 +02:00
László Monda
7c1431f0ab Bump firmware version to 8.2.2, update changelog, package.json, versions.h 2018-05-09 00:24:24 +02:00
László Monda
772078f8f6 Don't use the link-time optimizer because it screws up the firmware. 2018-05-09 00:19:02 +02:00
László Monda
46244b8f5f Get rid of the -B parameter of make because it's been made redundant by make clean. 2018-05-09 00:11:33 +02:00
László Monda
5fc59f40bc Make clean the left and right firmwares before building them. 2018-05-08 13:00:10 +02:00
László Monda
460cd3c602 Merge pull request #115 from Lauszus/lto
Enable the link-time optimizer for the left side, as this was also us…
2018-05-08 01:39:12 +02:00
Kristian Sloth Lauszus
e391d6dac8 Enable the link-time optimizer for the left side, as this was also used before the Makefile were added 2018-05-08 01:22:52 +02:00
László Monda
41afff5ea4 Update README.md 2018-05-08 00:28:43 +02:00
László Monda
187ae2821b Update README.md 2018-05-08 00:23:11 +02:00
László Monda
cb52c273b4 Merge pull request #114 from Lauszus/dev
Removed unneeded sources
2018-05-08 00:02:47 +02:00
László Monda
5a523e64d8 Always unconditionally rebuild every object file when creating a release. 2018-05-08 00:00:08 +02:00
László Monda
970f622bff Set DEBUG=0 by default. 2018-05-07 23:56:28 +02:00
Kristian Sloth Lauszus
293438fa61 Removed unneeded sources 2018-05-07 22:23:21 +02:00
László Monda
455c1a30cb Make make-release.js work again now that the build system has changed. 2018-05-07 13:16:46 +02:00
László Monda
58e4919c0e Revert {left,right}/build/.cprojects 2018-05-07 09:06:44 +02:00
László Monda
dd7b0a6e3b Make builds parallel by adding -j8 to make commands in build configurations and external tool configurations. 2018-05-07 00:58:13 +02:00
László Monda
59396baf76 Don't make external configurations overwrite PATH. 2018-05-06 23:23:23 +02:00
László Monda
8d9340c05b Merge branch 'master' of github.com:UltimateHackingKeyboard/firmware 2018-05-06 23:20:17 +02:00
László Monda
0930a000fa Merge pull request #113 from Lauszus/make
Make
2018-05-06 23:00:27 +02:00
Kristian Sloth Lauszus
332560d2d2 Merge branch 'master' into make 2018-05-06 21:25:46 +02:00
Kristian Sloth Lauszus
0344a79f65 Updated the KSDK_2.0_MKL03Z8xxx4 submodule 2018-05-06 20:28:14 +02:00
Kristian Sloth Lauszus
4577b118bc Revert "Set the MCU type for both projects"
This reverts commit 8bb9711793.
2018-05-06 20:26:44 +02:00
László Monda
ad8aca5793 Merge branch 'make' of https://github.com/Lauszus/firmware 2018-05-06 20:19:07 +02:00
Kristian Sloth Lauszus
8bb9711793 Set the MCU type for both projects
This is needed if we want to use MCUXpresso's config tools
2018-05-06 20:16:51 +02:00
Kristian Sloth Lauszus
3cb0490e5e Modified launch configurations to use the Makefile to flash the firmware 2018-05-06 20:16:51 +02:00
Kristian Sloth Lauszus
58fa1ed6a4 Use the bundled Makefiles instead of having the IDE generate them automatically 2018-05-06 20:16:51 +02:00
László Monda
9aa78ef5bf Merge pull request #112 from Lauszus/descriptor
Fix vender specific usage page entry
2018-05-06 20:14:51 +02:00
Kristian Sloth Lauszus
7c4c354828 Updated LED status comment 2018-05-06 15:23:07 +02:00
Kristian Sloth Lauszus
c3407e1410 Added Makefiles as linked resources, so they show up in the IDE 2018-05-06 15:22:24 +02:00
Kristian Sloth Lauszus
492243f801 Added _pvHeapStart entry
This is needed for Semihosting
2018-05-06 15:19:38 +02:00
Kristian Sloth Lauszus
6f0b1adc14 Fix vender specific usage page entry
See: https://github.com/node-hid/node-hid/issues/258
2018-05-06 15:11:22 +02:00
László Monda
b917a97e93 Parse long media macro actions. 2018-05-03 00:42:20 +02:00
László Monda
bf69f28ed1 Merge pull request #110 from Lauszus/make
Added Makefiles for compiling the two projects
2018-05-03 00:22:05 +02:00
László Monda
6854fa68dc Bump firmware version to 8.2.1 and update the changelog. 2018-05-02 14:57:24 +02:00
László Monda
14b6e49692 Don't suppress modifiers upon releasing a layer. Fixes #82. 2018-05-02 14:49:56 +02:00
Kristian Sloth Lauszus
10802f3f73 Build both the debug and release builds 2018-05-02 10:47:25 +02:00
Kristian Sloth Lauszus
66252eabf0 Added JLink flash scripts 2018-05-02 10:47:25 +02:00
Kristian Sloth Lauszus
0c4c736552 Use automatic variables for getting the file name and use the MAKEFILE_LIST variable to rebuild the project when any of the Makefiles change 2018-05-02 09:34:19 +02:00
Kristian Sloth Lauszus
aa4105bdc3 Updated license to "GPLv2 or later", so it is compatible with GPLv3 2018-05-02 03:00:30 +02:00
Kristian Sloth Lauszus
101abffec4 Moved the linker script into the source directory 2018-05-02 02:56:03 +02:00
Kristian Sloth Lauszus
b8268f55a3 Moved the BL_APP_VECTOR_TABLE_ADDRESS define into Makedefs.mk 2018-05-02 02:56:03 +02:00
Kristian Sloth Lauszus
2214f00667 Added command for flashing the images via the bootloader 2018-05-02 02:31:39 +02:00
Kristian Sloth Lauszus
a2fae5bbef Readded Eclipse build 2018-05-02 01:08:20 +02:00
Kristian Sloth Lauszus
47e026006e Forgot to fix linker errors for both linker scripts in: e0528e1714 2018-05-02 01:05:40 +02:00
Kristian Sloth Lauszus
379d827982 Only compile the project using Make 2018-05-02 00:45:47 +02:00
Kristian Sloth Lauszus
d9d26814e8 Fix warnings 2018-05-02 00:35:28 +02:00
Kristian Sloth Lauszus
611c36fe00 Added Makefiles for compiling the two projects 2018-05-02 00:13:52 +02:00
László Monda
e9cd3a96c2 Don't reinitialize LED driver ICs upon suspend and resume. 2018-04-28 17:08:25 +02:00
László Monda
8856c484b6 Add LedDisplay_UpdateAll() 2018-04-28 16:21:54 +02:00
László Monda
b97841fdae Delete I2C_WATCHDOG and always enable the watchdog. 2018-04-28 15:04:56 +02:00
László Monda
69143bed9c Replace "computer" with "host". 2018-04-28 15:00:32 +02:00
László Monda
ebd0e3b762 Make ParseConfig() restore indicator icons. Fixes #107 2018-04-28 14:43:13 +02:00
László Monda
ec8301ae62 Expose IsHostSleeping instead of IsHostSleeping() 2018-04-28 13:11:25 +02:00
László Monda
3d4d78387e Remove LED_DRIVER_STRESS_TEST. 2018-04-28 12:36:12 +02:00
László Monda
c2582729f2 Remove LED_DRIVERS_ENABLED. 2018-04-28 11:43:01 +02:00
László Monda
9d66f5ff76 Rename identifiers. 2018-04-28 11:38:38 +02:00
László Monda
06ebed5537 Rename some variables and clean up coding style. 2018-04-28 11:19:01 +02:00
László Monda
02d6fb4628 Rename version from 8.1.6 to 8.2.0 because the minor device protocol version has changed. 2018-04-20 09:55:44 +02:00
149 changed files with 3961 additions and 1125 deletions

1
.gitignore vendored
View File

@@ -1,2 +1,3 @@
package-lock.json
node_modules
build_make

View File

@@ -1,25 +1,22 @@
language: generic
language: c
os:
- linux
- osx
cache:
directories:
- $HOME/Library/Caches/Homebrew/Cask
install: eclipse -noSplash
-application org.eclipse.equinox.p2.director
-repository http://gnuarmeclipse.sourceforge.net/updates
-installIUs ilg.gnuarmeclipse.managedbuild.cross.feature.group
-profileProperties org.eclipse.update.install.features=true
script: eclipse -noSplash
-application org.eclipse.cdt.managedbuilder.core.headlessbuild
-import $TRAVIS_BUILD_DIR/left/build
-import $TRAVIS_BUILD_DIR/right/build
-build all
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 gcc-arm-embedded-4.8-2014q1-20140314
- nix-env -i eclipse-cpp
- os: osx
env: PATH="$PATH:/Applications/Eclipse CPP.app/Contents/MacOS"
before_install: brew update && brew bundle -v
# Cache for the gcc archives
- $HOME/gcc-cache/
install:
- 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
- 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
- tar -xf $HOME/gcc-cache/$GCC_NAME -C $HOME
- export PATH=$PATH:$HOME/gcc-arm-none-eabi-7-2017-q4-major/bin
script:
- make -C left clean && make -j2 -C left DEBUG=1
- 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=0

View File

@@ -1,2 +0,0 @@
cask "eclipse-cpp"
cask "./gcc-arm-embedded.rb"

View File

@@ -5,7 +5,162 @@ 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/)
and this project adheres to the [UHK Versioning](VERSIONING.md) conventions.
## [8.1.6] - 2018-04-10
## [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 buttons 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
Device Protocol: 4.3.**1** | Module Protocol: 4.0.0 | User Config: 4.0.1 | Hardware Config: 1.0.0
- Fix the bug that made the hardware and user configuration not load from the EEPROM on some hosts right after firmware update.
- Set the signature of the hardware config to "FTY" in the RAM when the keyboard is in factory reset mode, allowing Agent to be aware of the factory reset state. `DEVICEPROTOCOL:PATCH`
- Load the hardware and user configuration from the EEPROM even in factory reset mode.
- Set key debounce timeout from 60ms to 80ms. This should further reduce key chattering.
## [8.2.3] - 2018-05-15
Device Protocol: 4.3.0 | Module Protocol: 4.0.0 | User Config: 4.0.1 | Hardware Config: 1.0.0
- Don't switch keymaps instead of playing macros.
- Make saving the user configuration faster by only writing the part of the EEPROM which actually contains the user configuration.
## [8.2.2] - 2018-05-09
Device Protocol: 4.3.0 | Module Protocol: 4.0.0 | User Config: 4.0.**1** | Hardware Config: 1.0.0
- Parse long media macro actions. `USERCONFIG:PATCH`
- Fix vendor-specific USB usage page entry. This makes the HIDAPI Linux/hidraw driver able to access interface 0.
## [8.2.1] - 2018-05-02
Device Protocol: 4.3.0 | Module Protocol: 4.0.0 | User Config: 4.0.0 | Hardware Config: 1.0.0
- Don't suppress modifier keys upon releasing a layer.
- Restore Caps Lock indicator when saving the configuration.
## [8.2.0] - 2018-04-20
Device Protocol: 4.**3.0** | Module Protocol: 4.0.0 | User Config: 4.0.0 | Hardware Config: 1.0.0

View File

@@ -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
## Literal structure

8
ISSUE_TEMPLATE Normal file
View 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.

View File

@@ -4,32 +4,41 @@
This repository hosts the firmware of the [Ultimate Hacking Keyboard](https://ultimatehackingkeyboard.com/).
## Updating to the latest firmware
If you want to use the latest firmware version for your UHK, then instead of going through the pain of building the firmware, simply download the [latest release of Agent](https://github.com/UltimateHackingKeyboard/agent/releases/latest) and update to the latest firmware version within Agent with a click of a button.
Want to update your UHK to the latest firmware version? Simply download the [latest release of Agent](https://github.com/UltimateHackingKeyboard/agent/releases/latest) which includes the latest firmware version. You'll be easily able to update the firmware within Agent.
If you're one of the brave few who wants to hack the firmware then read on.
## Cloning the repository
Please make sure to clone this repo with:
1. Make sure to clone this repo with:
`git clone --recursive git@github.com:UltimateHackingKeyboard/firmware.git`
This will download the dependent submodules, which are required to build the firmware.
2. Download and install MCUXpresso IDE for [Linux](https://storage.googleapis.com/ugl-static/mcuxpresso-ide/mcuxpressoide-10.3.0_2200.x86_64.deb.bin), [Mac](https://storage.googleapis.com/ugl-static/mcuxpresso-ide/MCUXpressoIDE_10.3.0_2200.pkg), or [Windows](https://storage.googleapis.com/ugl-static/mcuxpresso-ide/MCUXpressoIDE_10.3.0_2200.exe).
## Importing the firmware
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.
Install [Kinetis Design Studio](http://www.nxp.com/products/software-and-tools/run-time-software/kinetis-software-and-tools/ides-for-kinetis-mcus/kinetis-design-studio-integrated-development-environment-ide:KDS_IDE) (KDS), 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.
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.
## Building and flashing the firmware
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 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.
For the right keyboard half, flash [the bootloader](https://github.com/UltimateHackingKeyboard/bootloader) first.
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.
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*.
## Contributing
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
View 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

View File

@@ -1,35 +0,0 @@
cask 'gcc-arm-embedded' do
version '4_8-2014q3'
sha256 '6b30901738b09a8d22fdfff99e991217444b80ac492a6163af5c06a3baaa3487'
# launchpad.net/gcc-arm-embedded/ was verified as official when first introduced to the cask
url "https://launchpad.net/gcc-arm-embedded/4.8/4.8-2014-q3-update/+download/gcc-arm-none-eabi-#{version}-20140805-mac.tar.bz2"
name 'GCC ARM Embedded'
homepage 'https://developer.arm.com/open-source/gnu-toolchain/gnu-rm'
binary "gcc-arm-none-eabi-#{version}/bin/arm-none-eabi-addr2line"
binary "gcc-arm-none-eabi-#{version}/bin/arm-none-eabi-ar"
binary "gcc-arm-none-eabi-#{version}/bin/arm-none-eabi-as"
binary "gcc-arm-none-eabi-#{version}/bin/arm-none-eabi-c++"
binary "gcc-arm-none-eabi-#{version}/bin/arm-none-eabi-c++filt"
binary "gcc-arm-none-eabi-#{version}/bin/arm-none-eabi-cpp"
binary "gcc-arm-none-eabi-#{version}/bin/arm-none-eabi-elfedit"
binary "gcc-arm-none-eabi-#{version}/bin/arm-none-eabi-g++"
binary "gcc-arm-none-eabi-#{version}/bin/arm-none-eabi-gcc"
binary "gcc-arm-none-eabi-#{version}/bin/arm-none-eabi-gcc-ar"
binary "gcc-arm-none-eabi-#{version}/bin/arm-none-eabi-gcc-nm"
binary "gcc-arm-none-eabi-#{version}/bin/arm-none-eabi-gcc-ranlib"
binary "gcc-arm-none-eabi-#{version}/bin/arm-none-eabi-gcov"
binary "gcc-arm-none-eabi-#{version}/bin/arm-none-eabi-gdb"
binary "gcc-arm-none-eabi-#{version}/bin/arm-none-eabi-gprof"
binary "gcc-arm-none-eabi-#{version}/bin/arm-none-eabi-ld"
binary "gcc-arm-none-eabi-#{version}/bin/arm-none-eabi-ld.bfd"
binary "gcc-arm-none-eabi-#{version}/bin/arm-none-eabi-nm"
binary "gcc-arm-none-eabi-#{version}/bin/arm-none-eabi-objcopy"
binary "gcc-arm-none-eabi-#{version}/bin/arm-none-eabi-objdump"
binary "gcc-arm-none-eabi-#{version}/bin/arm-none-eabi-ranlib"
binary "gcc-arm-none-eabi-#{version}/bin/arm-none-eabi-readelf"
binary "gcc-arm-none-eabi-#{version}/bin/arm-none-eabi-size"
binary "gcc-arm-none-eabi-#{version}/bin/arm-none-eabi-strings"
binary "gcc-arm-none-eabi-#{version}/bin/arm-none-eabi-strip"
end

58
keycluster/Makefile Normal file
View 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
View 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
View 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
View File

@@ -0,0 +1,4 @@
/.settings/
/uhk60-keycluster_debug/
/uhk60-keycluster_release/
/uhk60-keycluster_release/

155
keycluster/build/.project Normal file
View 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>

View 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="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;memoryBlockExpressionList context=&quot;Context string&quot;/&gt;&#13;&#10;"/>
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
</launchConfiguration>

View 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>

View 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="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;memoryBlockExpressionList context=&quot;Context string&quot;/&gt;&#13;&#10;"/>
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
</launchConfiguration>

View 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>

View 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();
}

View 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
View 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

View 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;
}
}

View 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

View 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();
}

View 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

View 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);
}

View 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
View 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
View 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
View 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
View 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
View 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

View 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);
}

View 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
View 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
View 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

58
left/Makefile Normal file
View 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_left
# 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 left half of the keyboard.
FLASH_CMD = node ../lib/agent/packages/usb/update-module-firmware.js leftHalf $(PROJECT_OBJ:.axf=.bin)
# Path to the JLink script used for the left half.
JLINK_SCRIPT = ../scripts/flash-left.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

View File

@@ -5,16 +5,16 @@
<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-left_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"/>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
</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.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="${cross_rm} -rf" description="" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1792027861" name="uhk60-left_debug" parent="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug">
<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-left_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"/>
@@ -61,7 +61,7 @@
<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:/k64f}/debug" id="ilg.gnuarmeclipse.managedbuild.cross.builder.1406291427" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" stopOnErr="false" superClass="ilg.gnuarmeclipse.managedbuild.cross.builder"/>
<builder buildPath="${workspace_loc:/uhk-left}/../" 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"/>
@@ -165,16 +165,16 @@
<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-left_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"/>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
</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.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="${cross_rm} -rf" description="" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1939339834.1792647078" name="uhk60-left_release" parent="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release">
<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-left_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"/>
@@ -220,7 +220,7 @@
<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:/k64f}/release" id="ilg.gnuarmeclipse.managedbuild.cross.builder.1689719605" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" stopOnErr="false" superClass="ilg.gnuarmeclipse.managedbuild.cross.builder"/>
<builder buildPath="${workspace_loc:/uhk-left}/../" 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"/>

View File

@@ -31,6 +31,16 @@
<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>

View File

@@ -1,34 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.cdt.launch.applicationLaunchType">
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB" value="true"/>
<listAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB_LIST"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="gdb"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_ON_FORK" value="false"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.GDB_INIT" value=".gdbinit"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.NON_STOP" value="false"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.REVERSE" value="false"/>
<listAttribute key="org.eclipse.cdt.dsf.gdb.SOLIB_PATH"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.TRACEPOINT_MODE" value="TP_NORMAL_ONLY"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.internal.ui.launching.LocalApplicationCDebuggerTab.DEFAULTS_SET" value="true"/>
<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_ID" value="gdb"/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="run"/>
<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_ARGUMENTS" value="leftHalf uhk60-left_debug/uhk-left.bin"/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="../../lib/agent/packages/usb/update-module-firmware.js"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="uhk-left"/>
<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"/>
<booleanAttribute key="org.eclipse.cdt.launch.use_terminal" value="true"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/uhk-left"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
<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-left}/../"/>
</launchConfiguration>

View File

@@ -1,48 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.cdt.launch.applicationLaunchType">
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB" value="true"/>
<listAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB_LIST"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="gdb"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_ON_FORK" value="false"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.GDB_INIT" value=".gdbinit"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.NON_STOP" value="false"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.REVERSE" value="false"/>
<listAttribute key="org.eclipse.cdt.dsf.gdb.SOLIB_PATH"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.TRACEPOINT_MODE" value="TP_NORMAL_ONLY"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.internal.ui.launching.LocalApplicationCDebuggerTab.DEFAULTS_SET" value="true"/>
<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_ID" value="gdb"/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="run"/>
<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_ARGUMENTS" value="leftHalf uhk60-left_release/uhk-left.bin"/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="../../lib/agent/packages/usb/update-module-firmware.js"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="uhk-left"/>
<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"/>
<booleanAttribute key="org.eclipse.cdt.launch.use_terminal" value="true"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/uhk-left"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.DefaultEvent" value="true"/>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.HideUnresolvedSymbols" value="true"/>
<stringAttribute key="org.eclipse.linuxtools.internal.perf.attr.Kernel.Location" value=""/>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.Kernel.SourceLineNumbers" value="false"/>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.ModuleSymbols" value="false"/>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.MultipleEvents" value="false"/>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.Multiplex" value="false"/>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.Record.Realtime" value="false"/>
<intAttribute key="org.eclipse.linuxtools.internal.perf.attr.Record.Realtime.Priority" value="1"/>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.Record.Verbose" value="false"/>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.ShowSourceDisassembly" value="false"/>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.ShowStat" value="false"/>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.SourceLineNumbers" value="true"/>
<intAttribute key="org.eclipse.linuxtools.internal.perf.attr.StatRunCount" value="1"/>
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
<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-left}/../"/>
</launchConfiguration>

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -3,40 +3,31 @@
#include "i2c_watchdog.h"
#include "test_led.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.
* 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.
*/
#ifdef I2C_WATCHDOG
static uint32_t prevWatchdogCounter = 0;
static uint32_t I2cWatchdog_RecoveryCounter; /* counter for how many times we had to recover and restart */
// 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 cntr = 0;
static volatile uint32_t I2cWatchdog_WatchCounter = 0; // Counter for timer
static int counter = 0;
cntr++;
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 */
cntr=0;
TEST_LED_TOGGLE();
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 (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++;
#if I2C_WATCHDOG == I2C_WATCHDOG_VALUE_REBOOT
NVIC_SystemReset();
#endif
#if I2C_WATCHDOG == I2C_WATCHDOG_VALUE_REINIT
I2C_SlaveDeinit(I2C_BUS_BASEADDR);
initI2c();
#endif
}
}
prevWatchdogCounter = I2C_Watchdog; /* remember previous counter */
prevWatchdogCounter = I2C_Watchdog;
}
}
#endif

View File

@@ -9,8 +9,8 @@
#include "led_pwm.h"
#include "slave_protocol_handler.h"
#include "i2c_watchdog.h"
#include "debug_over_spi.h"
#include "main.h"
#include "module.h"
i2c_slave_config_t slaveConfig;
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[1] = userData;
DebugOverSpi_Send(dosBuffer, 2);
switch (xfer->event) {
case kI2C_SlaveTransmitEvent:
@@ -66,7 +65,7 @@ void initI2c(void)
PORT_SetPinConfig(I2C_BUS_SCL_PORT, I2C_BUS_SCL_PIN, &pinConfig);
I2C_SlaveGetDefaultConfig(&slaveConfig);
slaveConfig.slaveAddress = I2C_ADDRESS_LEFT_KEYBOARD_HALF_FIRMWARE;
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);
@@ -84,8 +83,7 @@ void InitPeripherals(void)
{
initInterruptPriorities();
InitLedDriver();
InitTestLed();
TestLed_Init();
LedPwm_Init();
DebugOverSpi_Init();
initI2c();
}

View File

@@ -1,14 +1,11 @@
#include "fsl_lptmr.h"
#include "key_scanner.h"
#include "config.h"
#include "i2c_watchdog.h"
void KEY_SCANNER_HANDLER(void)
{
KeyMatrix_ScanRow(&keyMatrix);
#ifdef I2C_WATCHDOG
RunWatchdog();
#endif
LPTMR_ClearStatusFlags(KEY_SCANNER_LPTMR_BASEADDR, kLPTMR_TimerCompareFlag);
}

View File

@@ -1,12 +1,12 @@
#include "main.h"
#include "init_clock.h"
#include "slave/init_clock.h"
#include "init_peripherals.h"
#include "bootloader.h"
#include <stdio.h>
#include "config.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 = {
.colNum = KEYBOARD_MATRIX_COLS_NUM,
@@ -15,11 +15,7 @@ key_matrix_t keyMatrix = {
{PORTB, GPIOB, kCLOCK_PortB, 11},
{PORTA, GPIOA, kCLOCK_PortA, 6},
{PORTA, GPIOA, kCLOCK_PortA, 8},
#ifdef DEBUG_OVER_SPI
{PORTA, GPIOA, kCLOCK_PortA, 8},
#else
{PORTB, GPIOB, kCLOCK_PortB, 0},
#endif
{PORTB, GPIOB, kCLOCK_PortB, 6},
{PORTA, GPIOA, kCLOCK_PortA, 3},
{PORTA, GPIOA, kCLOCK_PortA, 12}
@@ -28,11 +24,7 @@ key_matrix_t keyMatrix = {
{PORTB, GPIOB, kCLOCK_PortB, 7},
{PORTB, GPIOB, kCLOCK_PortB, 10},
{PORTA, GPIOA, kCLOCK_PortA, 5},
#ifdef DEBUG_OVER_SPI
{PORTA, GPIOA, kCLOCK_PortA, 5},
#else
{PORTA, GPIOA, kCLOCK_PortA, 7},
#endif
{PORTA, GPIOA, kCLOCK_PortA, 4}
}
};

View File

@@ -3,6 +3,8 @@
// 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_ID ModuleId_LeftKeyboardHalf
#define MODULE_KEY_COUNT (KEYBOARD_MATRIX_ROWS_NUM * KEYBOARD_MATRIX_COLS_NUM)

View File

@@ -42,7 +42,7 @@ void SlaveRxHandler(void)
case SlaveCommand_SetTestLed:
TxMessage.length = 0;
bool isLedOn = RxMessage.data[1];
TEST_LED_SET(isLedOn);
TestLed_Set(isLedOn);
break;
case SlaveCommand_SetLedPwmBrightness:
TxMessage.length = 0;

View File

@@ -1,10 +1,10 @@
#include "test_led.h"
#include "fsl_port.h"
extern void InitTestLed(void)
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});
TEST_LED_ON();
TestLed_On();
}

View File

@@ -15,13 +15,28 @@
#define TEST_LED_CLOCK kCLOCK_PortB
#define TEST_LED_PIN 13
#define TEST_LED_ON() GPIO_SetPinsOutput(TEST_LED_GPIO, 1U << TEST_LED_PIN)
#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))
#define TEST_LED_TOGGLE() GPIO_TogglePinsOutput(TEST_LED_GPIO, 1U << TEST_LED_PIN)
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 InitTestLed(void);
void TestLed_Init(void);
#endif

76
right/Makefile Normal file
View File

@@ -0,0 +1,76 @@
# 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_right
# Defines the part type that this project uses.
PART = MK22FN512VLH12
# Defines the linker script to use for the application.
LDSCRIPT = src/link/MK22FN512xxx12_flash.ld
# Size of the heap and stack.
HEAP_SIZE = 0x2000
STACK_SIZE = 0x0400
# Set the compiler CPU and FPU options.
CPU = -mcpu=cortex-m4
FPU = -mfpu=fpv4-sp-d16 -mfloat-abi=hard
# Command for flashing the right half of the keyboard.
FLASH_CMD = node ../lib/agent/packages/usb/update-device-firmware.js $(PROJECT_OBJ:.axf=.hex)
# Path to the JLink script used for the right half.
JLINK_SCRIPT = ../scripts/flash-right.jlink
# Preprocessor directives.
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.
BL_APP_VECTOR_TABLE_ADDRESS ?= 0xc000
# Source files.
SOURCE = $(wildcard src/*.c) \
$(wildcard src/*/*.c) \
$(wildcard src/*/*/*.c) \
../lib/bootloader/src/bootloader/src/wormhole.c \
$(wildcard ../lib/KSDK_2.0_MK22FN512xxx12/middleware/usb_1.0.0/device/*.c) \
$(wildcard ../lib/KSDK_2.0_MK22FN512xxx12/middleware/usb_1.0.0/osa/*.c) \
../lib/KSDK_2.0_MK22FN512xxx12/devices/MK22F51212/system_MK22F51212.c \
../lib/KSDK_2.0_MK22FN512xxx12/devices/MK22F51212/gcc/startup_MK22F51212.S \
../lib/KSDK_2.0_MK22FN512xxx12/devices/MK22F51212/drivers/fsl_adc16.c \
../lib/KSDK_2.0_MK22FN512xxx12/devices/MK22F51212/drivers/fsl_clock.c \
../lib/KSDK_2.0_MK22FN512xxx12/devices/MK22F51212/drivers/fsl_ftm.c \
../lib/KSDK_2.0_MK22FN512xxx12/devices/MK22F51212/drivers/fsl_gpio.c \
../lib/KSDK_2.0_MK22FN512xxx12/devices/MK22F51212/drivers/fsl_i2c.c \
../lib/KSDK_2.0_MK22FN512xxx12/devices/MK22F51212/drivers/fsl_pit.c \
../lib/KSDK_2.0_MK22FN512xxx12/devices/MK22F51212/drivers/fsl_smc.c \
$(wildcard ../shared/*.c)
# Header files.
IPATH = src \
src/ksdk_usb \
src/buspal \
src/buspal/bm_usb \
../lib/bootloader/src \
../lib/KSDK_2.0_MK22FN512xxx12/middleware/usb_1.0.0/device \
../lib/KSDK_2.0_MK22FN512xxx12/middleware/usb_1.0.0/include \
../lib/KSDK_2.0_MK22FN512xxx12/middleware/usb_1.0.0/osa \
../lib/KSDK_2.0_MK22FN512xxx12/CMSIS/Include \
../lib/KSDK_2.0_MK22FN512xxx12/devices/MK22F51212 \
../lib/KSDK_2.0_MK22FN512xxx12/devices/MK22F51212/drivers \
../shared
# Include main Makefile.
include ../scripts/Makedefs.mk

View File

@@ -5,16 +5,16 @@
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1939339834.1692217331" moduleId="org.eclipse.cdt.core.settings" name="uhk60-right_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"/>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
</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.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="${cross_rm} -rf" description="" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1939339834.1692217331" name="uhk60-right_release" parent="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release">
<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.1692217331" name="uhk60-right_release" parent="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release">
<folderInfo id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1939339834.1692217331." name="/" resourcePath="">
<toolChain id="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.release.453692058" name="Cross ARM GCC" superClass="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.release">
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.8609064" name="Optimization Level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level" value="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.most" valueType="enumerated"/>
@@ -57,7 +57,7 @@
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.toerrors.1518272175" 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.addtools.createlisting.104956045" 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.1135747399" isAbstract="false" osList="all" superClass="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform"/>
<builder buildPath="${workspace_loc:/k64f}/release" id="ilg.gnuarmeclipse.managedbuild.cross.builder.789002772" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" stopOnErr="false" superClass="ilg.gnuarmeclipse.managedbuild.cross.builder"/>
<builder buildPath="${workspace_loc:/uhk-right}/../" id="ilg.gnuarmeclipse.managedbuild.cross.builder.789002772" 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.2026990925" name="Cross ARM GNU Assembler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler">
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor.494477502" 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.1465555477" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.include.paths"/>
@@ -145,16 +145,16 @@
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1939339834.1692217331.1297236062" moduleId="org.eclipse.cdt.core.settings" name="uhk60-right_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"/>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
</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.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="${cross_rm} -rf" description="" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1939339834.1692217331.1297236062" name="uhk60-right_debug" parent="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release">
<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.1692217331.1297236062" name="uhk60-right_debug" parent="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release">
<folderInfo id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1939339834.1692217331.1297236062." name="/" resourcePath="">
<toolChain id="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.release.622643167" name="Cross ARM GCC" superClass="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.release">
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.274883814" name="Optimization Level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level" value="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.none" valueType="enumerated"/>
@@ -197,7 +197,7 @@
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.toerrors.2098763517" 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.addtools.createlisting.836473542" 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.1768350063" isAbstract="false" osList="all" superClass="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform"/>
<builder buildPath="${workspace_loc:/k64f}/release" id="ilg.gnuarmeclipse.managedbuild.cross.builder.1931309296" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" stopOnErr="false" superClass="ilg.gnuarmeclipse.managedbuild.cross.builder"/>
<builder buildPath="${workspace_loc:/uhk-right}/../" id="ilg.gnuarmeclipse.managedbuild.cross.builder.1931309296" 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.894450" name="Cross ARM GNU Assembler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler">
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor.555709175" 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.1619685061" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.include.paths"/>
@@ -288,16 +288,16 @@
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1939339834.1692217331.1297236062.2081695142" moduleId="org.eclipse.cdt.core.settings" name="uhk60-right_debug_standalone">
<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"/>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
</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.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="${cross_rm} -rf" description="Debug version of uhk60-right without the bootloader" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1939339834.1692217331.1297236062.2081695142" name="uhk60-right_debug_standalone" parent="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release">
<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="Debug version of uhk60-right without the bootloader" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1939339834.1692217331.1297236062.2081695142" name="uhk60-right_debug_standalone" parent="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release">
<folderInfo id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1939339834.1692217331.1297236062.2081695142." name="/" resourcePath="">
<toolChain id="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.release.788475280" name="Cross ARM GCC" superClass="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.release">
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.402546001" name="Optimization Level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level" value="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.none" valueType="enumerated"/>
@@ -340,7 +340,7 @@
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.toerrors.2124713168" 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.addtools.createlisting.1228214828" 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.1911575583" isAbstract="false" osList="all" superClass="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform"/>
<builder buildPath="${workspace_loc:/k64f}/release" id="ilg.gnuarmeclipse.managedbuild.cross.builder.1942759303" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" stopOnErr="false" superClass="ilg.gnuarmeclipse.managedbuild.cross.builder"/>
<builder buildPath="${workspace_loc:/uhk-right}/../" id="ilg.gnuarmeclipse.managedbuild.cross.builder.1942759303" incrementalBuildTarget="all DEBUG=1 BL_APP_VECTOR_TABLE_ADDRESS=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.1355758441" name="Cross ARM GNU Assembler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler">
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor.511724221" 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.1130167410" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.include.paths"/>
@@ -447,14 +447,97 @@
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="uhk60-right_debug_standalone">
<configuration configurationName="uhk60-right_debug">
<resource resourceType="PROJECT" workspacePath="/uhk-right"/>
</configuration>
<configuration configurationName="uhk60-right_release">
<resource resourceType="PROJECT" workspacePath="/uhk-right"/>
</configuration>
<configuration configurationName="uhk60-right_debug">
<configuration configurationName="uhk60-right_debug_standalone">
<resource resourceType="PROJECT" workspacePath="/uhk-right"/>
</configuration>
</storageModule>
<storageModule moduleId="com.crt.config">
<projectStorage>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;TargetConfig&gt;
&lt;Properties property_3="NXP" property_4="MK22FN512xxx12" property_count="5" version="100200"/&gt;
&lt;infoList vendor="NXP"&gt;&lt;info chip="MK22FN512xxx12" name="MK22FN512xxx12"&gt;&lt;chip&gt;&lt;name&gt;MK22FN512xxx12&lt;/name&gt;
&lt;family&gt;K2x&lt;/family&gt;
&lt;vendor&gt;NXP&lt;/vendor&gt;
&lt;memory can_program="true" id="Flash" is_ro="true" size="0" type="Flash"/&gt;
&lt;memory id="RAM" size="0" type="RAM"/&gt;
&lt;memoryInstance derived_from="Flash" driver="FTFA_2K.cfx" id="PROGRAM_FLASH" location="0x00000000" size="0x00080000"/&gt;
&lt;memoryInstance derived_from="RAM" id="SRAM_UPPER" location="0x20000000" size="0x00010000"/&gt;
&lt;memoryInstance derived_from="RAM" id="SRAM_LOWER" location="0x1fff0000" size="0x00010000"/&gt;
&lt;peripheralInstance derived_from="FTFA-FlashConfig" determined="infoFile" id="FTFA-FlashConfig" location="0x400"/&gt;
&lt;peripheralInstance derived_from="DMA" determined="infoFile" id="DMA" location="0x40008000"/&gt;
&lt;peripheralInstance derived_from="FB" determined="infoFile" id="FB" location="0x4000C000"/&gt;
&lt;peripheralInstance derived_from="FMC" determined="infoFile" id="FMC" location="0x4001F000"/&gt;
&lt;peripheralInstance derived_from="FTFA" determined="infoFile" id="FTFA" location="0x40020000"/&gt;
&lt;peripheralInstance derived_from="DMAMUX" determined="infoFile" id="DMAMUX" location="0x40021000"/&gt;
&lt;peripheralInstance derived_from="FTM0" determined="infoFile" id="FTM0" location="0x40038000"/&gt;
&lt;peripheralInstance derived_from="FTM1" determined="infoFile" id="FTM1" location="0x40039000"/&gt;
&lt;peripheralInstance derived_from="FTM2" determined="infoFile" id="FTM2" location="0x4003A000"/&gt;
&lt;peripheralInstance derived_from="FTM3" determined="infoFile" id="FTM3" location="0x40026000"/&gt;
&lt;peripheralInstance derived_from="ADC0" determined="infoFile" id="ADC0" location="0x4003B000"/&gt;
&lt;peripheralInstance derived_from="ADC1" determined="infoFile" id="ADC1" location="0x40027000"/&gt;
&lt;peripheralInstance derived_from="DAC0" determined="infoFile" id="DAC0" location="0x4003F000"/&gt;
&lt;peripheralInstance derived_from="DAC1" determined="infoFile" id="DAC1" location="0x40028000"/&gt;
&lt;peripheralInstance derived_from="RNG" determined="infoFile" id="RNG" location="0x40029000"/&gt;
&lt;peripheralInstance derived_from="LPUART0" determined="infoFile" id="LPUART0" location="0x4002A000"/&gt;
&lt;peripheralInstance derived_from="SPI0" determined="infoFile" id="SPI0" location="0x4002C000"/&gt;
&lt;peripheralInstance derived_from="SPI1" determined="infoFile" id="SPI1" location="0x4002D000"/&gt;
&lt;peripheralInstance derived_from="I2S0" determined="infoFile" id="I2S0" location="0x4002F000"/&gt;
&lt;peripheralInstance derived_from="CRC" determined="infoFile" id="CRC" location="0x40032000"/&gt;
&lt;peripheralInstance derived_from="PDB0" determined="infoFile" id="PDB0" location="0x40036000"/&gt;
&lt;peripheralInstance derived_from="PIT" determined="infoFile" id="PIT" location="0x40037000"/&gt;
&lt;peripheralInstance derived_from="RTC" determined="infoFile" id="RTC" location="0x4003D000"/&gt;
&lt;peripheralInstance derived_from="RFVBAT" determined="infoFile" id="RFVBAT" location="0x4003E000"/&gt;
&lt;peripheralInstance derived_from="LPTMR0" determined="infoFile" id="LPTMR0" location="0x40040000"/&gt;
&lt;peripheralInstance derived_from="RFSYS" determined="infoFile" id="RFSYS" location="0x40041000"/&gt;
&lt;peripheralInstance derived_from="SIM" determined="infoFile" id="SIM" location="0x40047000"/&gt;
&lt;peripheralInstance derived_from="PORTA" determined="infoFile" id="PORTA" location="0x40049000"/&gt;
&lt;peripheralInstance derived_from="PORTB" determined="infoFile" id="PORTB" location="0x4004A000"/&gt;
&lt;peripheralInstance derived_from="PORTC" determined="infoFile" id="PORTC" location="0x4004B000"/&gt;
&lt;peripheralInstance derived_from="PORTD" determined="infoFile" id="PORTD" location="0x4004C000"/&gt;
&lt;peripheralInstance derived_from="PORTE" determined="infoFile" id="PORTE" location="0x4004D000"/&gt;
&lt;peripheralInstance derived_from="WDOG" determined="infoFile" id="WDOG" location="0x40052000"/&gt;
&lt;peripheralInstance derived_from="EWM" determined="infoFile" id="EWM" location="0x40061000"/&gt;
&lt;peripheralInstance derived_from="MCG" determined="infoFile" id="MCG" location="0x40064000"/&gt;
&lt;peripheralInstance derived_from="OSC" determined="infoFile" id="OSC" location="0x40065000"/&gt;
&lt;peripheralInstance derived_from="I2C0" determined="infoFile" id="I2C0" location="0x40066000"/&gt;
&lt;peripheralInstance derived_from="I2C1" determined="infoFile" id="I2C1" location="0x40067000"/&gt;
&lt;peripheralInstance derived_from="UART0" determined="infoFile" id="UART0" location="0x4006A000"/&gt;
&lt;peripheralInstance derived_from="UART1" determined="infoFile" id="UART1" location="0x4006B000"/&gt;
&lt;peripheralInstance derived_from="UART2" determined="infoFile" id="UART2" location="0x4006C000"/&gt;
&lt;peripheralInstance derived_from="USB0" determined="infoFile" id="USB0" location="0x40072000"/&gt;
&lt;peripheralInstance derived_from="CMP0" determined="infoFile" id="CMP0" location="0x40073000"/&gt;
&lt;peripheralInstance derived_from="CMP1" determined="infoFile" id="CMP1" location="0x40073008"/&gt;
&lt;peripheralInstance derived_from="VREF" determined="infoFile" id="VREF" location="0x40074000"/&gt;
&lt;peripheralInstance derived_from="LLWU" determined="infoFile" id="LLWU" location="0x4007C000"/&gt;
&lt;peripheralInstance derived_from="PMC" determined="infoFile" id="PMC" location="0x4007D000"/&gt;
&lt;peripheralInstance derived_from="SMC" determined="infoFile" id="SMC" location="0x4007E000"/&gt;
&lt;peripheralInstance derived_from="RCM" determined="infoFile" id="RCM" location="0x4007F000"/&gt;
&lt;peripheralInstance derived_from="GPIOA" determined="infoFile" id="GPIOA" location="0x400FF000"/&gt;
&lt;peripheralInstance derived_from="GPIOB" determined="infoFile" id="GPIOB" location="0x400FF040"/&gt;
&lt;peripheralInstance derived_from="GPIOC" determined="infoFile" id="GPIOC" location="0x400FF080"/&gt;
&lt;peripheralInstance derived_from="GPIOD" determined="infoFile" id="GPIOD" location="0x400FF0C0"/&gt;
&lt;peripheralInstance derived_from="GPIOE" determined="infoFile" id="GPIOE" location="0x400FF100"/&gt;
&lt;peripheralInstance derived_from="SystemControl" determined="infoFile" id="SystemControl" location="0xE000E000"/&gt;
&lt;peripheralInstance derived_from="SysTick" determined="infoFile" id="SysTick" location="0xE000E010"/&gt;
&lt;peripheralInstance derived_from="NVIC" determined="infoFile" id="NVIC" location="0xE000E100"/&gt;
&lt;peripheralInstance derived_from="MCM" determined="infoFile" id="MCM" location="0xE0080000"/&gt;
&lt;/chip&gt;
&lt;processor&gt;&lt;name gcc_name="cortex-m4"&gt;Cortex-M4&lt;/name&gt;
&lt;family&gt;Cortex-M&lt;/family&gt;
&lt;/processor&gt;
&lt;link href="MK22F51212_internal_peripheral.xml" show="embed" type="simple"/&gt;
&lt;/info&gt;
&lt;/infoList&gt;
&lt;/TargetConfig&gt;</projectStorage>
</storageModule>
<storageModule moduleId="com.nxp.mcuxpresso.core.datamodels">
<sdkName>SDK_2.x_MK22FN512xxx12</sdkName>
<sdkVersion>2.2.0</sdkVersion>
</storageModule>
</cproject>

View File

@@ -30,6 +30,16 @@
<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>bootloader-shared</name>
<type>2</type>

View File

@@ -204,21 +204,27 @@ SECTIONS
text_end = ORIGIN(m_text) + LENGTH(m_text);
ASSERT(__DATA_END <= text_end, "region m_text overflowed with text and data")
USB_RAM_GAP = DEFINED(__usb_ram_size__) ? __usb_ram_size__ : 0x800;
/* Uninitialized data section */
.bss :
.bss : ALIGN(4)
{
/* This is used by the startup in order to initialize the .bss section */
. = ALIGN(4);
__START_BSS = .;
__bss_start__ = .;
*(.bss)
*(.bss*)
. = ALIGN(512);
USB_RAM_START = .;
. += USB_RAM_GAP;
*(COMMON)
. = ALIGN(4);
} > m_data
.m_usb_bdt (NOLOAD) :
{
. = ALIGN(512);
*(m_usb_bdt)
} > m_data
.m_usb_global (NOLOAD) :
{
*(m_usb_global)
__bss_end__ = .;
__END_BSS = .;
} > m_data
@@ -247,17 +253,6 @@ SECTIONS
. += STACK_SIZE;
} > m_data_2
m_usb_bdt USB_RAM_START (NOLOAD) :
{
*(m_usb_bdt)
USB_RAM_BDT_END = .;
}
m_usb_global USB_RAM_BDT_END (NOLOAD) :
{
*(m_usb_global)
}
/* Initializes stack on the end of block */
__StackTop = ORIGIN(m_data_2) + LENGTH(m_data_2);
__StackLimit = __StackTop - STACK_SIZE;

View File

@@ -1,49 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.cdt.launch.applicationLaunchType">
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB" value="true"/>
<listAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB_LIST"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="gdb"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_ON_FORK" value="false"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.GDB_INIT" value=".gdbinit"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.NON_STOP" value="false"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.REVERSE" value="false"/>
<listAttribute key="org.eclipse.cdt.dsf.gdb.SOLIB_PATH"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.TRACEPOINT_MODE" value="TP_NORMAL_ONLY"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.internal.ui.launching.LocalApplicationCDebuggerTab.DEFAULTS_SET" value="true"/>
<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_ID" value="gdb"/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="run"/>
<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_ARGUMENTS" value="uhk60-right_debug/uhk-right.hex"/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="../../lib/agent/packages/usb/update-device-firmware.js"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="uhk-right"/>
<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.1692217331.1297236062"/>
<booleanAttribute key="org.eclipse.cdt.launch.use_terminal" value="true"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/uhk-right"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;memoryBlockExpressionList context=&quot;reserved-for-future-use&quot;/&gt;&#10;"/>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.DefaultEvent" value="true"/>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.HideUnresolvedSymbols" value="true"/>
<stringAttribute key="org.eclipse.linuxtools.internal.perf.attr.Kernel.Location" value=""/>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.Kernel.SourceLineNumbers" value="false"/>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.ModuleSymbols" value="false"/>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.MultipleEvents" value="false"/>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.Multiplex" value="false"/>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.Record.Realtime" value="false"/>
<intAttribute key="org.eclipse.linuxtools.internal.perf.attr.Record.Realtime.Priority" value="1"/>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.Record.Verbose" value="false"/>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.ShowSourceDisassembly" value="false"/>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.ShowStat" value="false"/>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.SourceLineNumbers" value="true"/>
<intAttribute key="org.eclipse.linuxtools.internal.perf.attr.StatRunCount" value="1"/>
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType">
<stringAttribute key="bad_container_name" value="/uhk-l"/>
<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-right}/../"/>
</launchConfiguration>

View File

@@ -1,49 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.cdt.launch.applicationLaunchType">
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB" value="true"/>
<listAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB_LIST"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="gdb"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_ON_FORK" value="false"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.GDB_INIT" value=".gdbinit"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.NON_STOP" value="false"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.REVERSE" value="false"/>
<listAttribute key="org.eclipse.cdt.dsf.gdb.SOLIB_PATH"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.TRACEPOINT_MODE" value="TP_NORMAL_ONLY"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.internal.ui.launching.LocalApplicationCDebuggerTab.DEFAULTS_SET" value="true"/>
<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_ID" value="gdb"/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="run"/>
<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_ARGUMENTS" value="uhk60-right_release/uhk-right.hex"/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="../../lib/agent/packages/usb/update-device-firmware.js"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="uhk-right"/>
<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.1692217331"/>
<booleanAttribute key="org.eclipse.cdt.launch.use_terminal" value="true"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/uhk-right"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;memoryBlockExpressionList context=&quot;reserved-for-future-use&quot;/&gt;&#10;"/>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.DefaultEvent" value="true"/>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.HideUnresolvedSymbols" value="true"/>
<stringAttribute key="org.eclipse.linuxtools.internal.perf.attr.Kernel.Location" value=""/>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.Kernel.SourceLineNumbers" value="false"/>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.ModuleSymbols" value="false"/>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.MultipleEvents" value="false"/>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.Multiplex" value="false"/>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.Record.Realtime" value="false"/>
<intAttribute key="org.eclipse.linuxtools.internal.perf.attr.Record.Realtime.Priority" value="1"/>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.Record.Verbose" value="false"/>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.ShowSourceDisassembly" value="false"/>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.ShowStat" value="false"/>
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.SourceLineNumbers" value="true"/>
<intAttribute key="org.eclipse.linuxtools.internal.perf.attr.StatRunCount" value="1"/>
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType">
<stringAttribute key="bad_container_name" value="/uhk-l"/>
<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-right}/../"/>
</launchConfiguration>

View File

@@ -593,9 +593,6 @@ static status_t handle_command_internal(uint8_t *packet, uint32_t packetLength)
else
{
#if FIXED_BUSPAL_BOOTLOADER
size_t offset;
int res;
status = kStatus_Success; /* set default */
res = WaitForStartByte(rxBuf, &offset);
if (res==1 && offset==1)

View File

@@ -110,7 +110,7 @@ status_t serial_packet_read(const peripheral_descriptor_t *self,
// Receive the framing data packet.
isPacketOk = true;
status_t status = read_data_packet(&framingPacket, g_serialContext.data, packetType);
status = read_data_packet(&framingPacket, g_serialContext.data, packetType);
if (status != kStatus_Success)
{
// No packet available.

View File

@@ -3,8 +3,4 @@
// Macros:
#define I2C_WATCHDOG
#define LED_DRIVERS_ENABLED
// #define LED_DRIVER_STRESS_TEST
#endif

View File

@@ -6,10 +6,13 @@ static uint8_t hardwareConfig[HARDWARE_CONFIG_SIZE];
static uint8_t ATTR_DATA2 stagingUserConfig[USER_CONFIG_SIZE];
static uint8_t validatedUserConfig[USER_CONFIG_SIZE];
uint16_t ValidatedUserConfigLength;
config_buffer_t HardwareConfigBuffer = { hardwareConfig };
config_buffer_t StagingUserConfigBuffer = { stagingUserConfig };
config_buffer_t ValidatedUserConfigBuffer = { validatedUserConfig };
hardware_config_t *HardwareConfig = (hardware_config_t*)hardwareConfig;
bool ParserRunDry;
bool IsConfigBufferIdValid(config_buffer_id_t configBufferId)

View File

@@ -6,6 +6,10 @@
#include "fsl_common.h"
#include "basic_types.h"
// Macros:
#define HARDWARE_CONFIG_SIGNATURE_LENGTH 3
// Typedefs:
typedef enum {
@@ -14,14 +18,29 @@
ConfigBufferId_ValidatedUserConfig,
} config_buffer_id_t;
typedef struct {
uint8_t signatureLength;
char signature[HARDWARE_CONFIG_SIGNATURE_LENGTH];
uint8_t majorVersion;
uint8_t minorVersion;
uint8_t patchVersion;
uint8_t brandId;
uint8_t deviceId;
uint32_t uniqueId;
bool isVendorModeOn;
bool isIso;
} hardware_config_t;
// Variables:
extern bool ParserRunDry;
extern uint16_t ValidatedUserConfigLength;
extern config_buffer_t HardwareConfigBuffer;
extern config_buffer_t StagingUserConfigBuffer;
extern config_buffer_t ValidatedUserConfigBuffer;
extern hardware_config_t *HardwareConfig;
// Functions:
// Functions:
bool IsConfigBufferIdValid(config_buffer_id_t configBufferId);
config_buffer_t* ConfigBufferIdToConfigBuffer(config_buffer_id_t configBufferId);

View File

@@ -51,7 +51,6 @@ parser_error_t ParseConfig(config_buffer_t *buffer)
const char *deviceName = ReadString(buffer, &len);
uint16_t doubleTapSwitchLayerTimeout = ReadUInt16(buffer);
(void)userConfigLength;
(void)dataModelMajorVersion;
(void)dataModelMinorVersion;
(void)dataModelPatchVersion;
@@ -141,13 +140,14 @@ parser_error_t ParseConfig(config_buffer_t *buffer)
// Update LED brightnesses and reinitialize LED drivers
ValidatedUserConfigLength = userConfigLength;
IconsAndLayerTextsBrightness = iconsAndLayerTextsBrightness;
AlphanumericSegmentsBrightness = alphanumericSegmentsBrightness;
KeyBacklightBrightness = keyBacklightBrightness;
#ifdef LED_DRIVERS_ENABLED
Slaves[SlaveId_LeftLedDriver].isConnected = false;
Slaves[SlaveId_RightLedDriver].isConnected = false;
#endif
LedSlaveDriver_UpdateLeds();
// Update mouse key speeds
MouseMoveState.initialSpeed = mouseMoveInitialSpeed;

View File

@@ -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)
{
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->switchLayer.layer = layer;
@@ -75,7 +75,7 @@ static parser_error_t parsePlayMacroAction(key_action_t *keyAction, config_buffe
if (macroIndex >= tempMacroCount) {
return ParserError_InvalidSerializedPlayMacroAction;
}
keyAction->type = KeyActionType_SwitchKeymap;
keyAction->type = KeyActionType_PlayMacro;
keyAction->playMacro.macroId = macroIndex;
return ParserError_Success;
}
@@ -196,4 +196,3 @@ parser_error_t ParseKeymap(config_buffer_t *buffer, uint8_t keymapIdx, uint8_t k
}
return ParserError_Success;
}

View File

@@ -48,10 +48,12 @@
SerializedMouseAction_ScrollRight,
SerializedMouseAction_Accelerate,
SerializedMouseAction_Decelerate,
SerializedMouseAction_Last = SerializedMouseAction_Decelerate,
SerializedMouseAction_Button_4,
SerializedMouseAction_Button_5,
SerializedMouseAction_Button_6,
SerializedMouseAction_Button_7,
SerializedMouseAction_Button_8,
SerializedMouseAction_Last = SerializedMouseAction_Button_8,
} serialized_mouse_action_t;
// Functions:

View File

@@ -7,13 +7,15 @@ parser_error_t parseKeyMacroAction(config_buffer_t *buffer, macro_action_t *macr
uint8_t keyMacroType = macroActionType - SerializedMacroActionType_KeyMacroAction;
uint8_t action = keyMacroType & 0b11;
uint8_t type;
uint8_t scancode;
uint16_t scancode = 0;
uint8_t modifierMask;
keyMacroType >>= 2;
type = keyMacroType & 0b11;
keyMacroType >>= 2;
scancode = keyMacroType & 0b10 ? ReadUInt8(buffer) : 0;
if (keyMacroType & 0b10) {
scancode = type == SerializedKeystrokeType_LongMedia ? ReadUInt16(buffer) : ReadUInt8(buffer);
}
modifierMask = keyMacroType & 0b01 ? ReadUInt8(buffer) : 0;
macroAction->type = MacroActionType_Key;
macroAction->key.action = action;
@@ -58,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)
{
int16_t delay = ReadInt16(buffer);
uint16_t delay = ReadUInt16(buffer);
macroAction->type = MacroActionType_Delay;
macroAction->delay.delay = delay;

View File

@@ -94,14 +94,14 @@ void EEPROM_Init(void)
I2C_MasterTransferCreateHandle(I2C_EEPROM_BUS_BASEADDR, &i2cHandle, i2cCallback, NULL);
}
status_t EEPROM_LaunchTransfer(eeprom_operation_t operation, config_buffer_id_t config_buffer_id, void (*successCallback))
status_t EEPROM_LaunchTransfer(eeprom_operation_t operation, config_buffer_id_t configBufferId, void (*successCallback))
{
if (IsEepromBusy) {
return kStatus_I2C_Busy;
}
CurrentEepromOperation = operation;
CurrentConfigBufferId = config_buffer_id;
CurrentConfigBufferId = configBufferId;
SuccessCallback = successCallback;
bool isHardwareConfig = CurrentConfigBufferId == ConfigBufferId_HardwareConfig;
@@ -117,7 +117,8 @@ status_t EEPROM_LaunchTransfer(eeprom_operation_t operation, config_buffer_id_t
case EepromOperation_Write:
sourceBuffer = ConfigBufferIdToConfigBuffer(CurrentConfigBufferId)->buffer;
sourceOffset = 0;
sourceLength = isHardwareConfig ? HARDWARE_CONFIG_SIZE : USER_CONFIG_SIZE;
uint16_t userConfigSize = ValidatedUserConfigLength && configBufferId == ConfigBufferId_ValidatedUserConfig ? ValidatedUserConfigLength : USER_CONFIG_SIZE;
sourceLength = isHardwareConfig ? HARDWARE_CONFIG_SIZE : userConfigSize;
LastEepromTransferStatus = writePage();
break;
}

View File

@@ -35,10 +35,12 @@
#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_SDA_GPIO GPIOC
#define I2C_EEPROM_BUS_SDA_PORT PORTC
#define I2C_EEPROM_BUS_SDA_CLOCK kCLOCK_PortC
#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_CLOCK kCLOCK_PortC
#define I2C_EEPROM_BUS_SCL_PIN 10

View File

@@ -6,6 +6,7 @@
#include "i2c.h"
#include "i2c_watchdog.h"
#include "init_peripherals.h"
#include "peripherals/test_led.h"
uint32_t I2cWatchdog_WatchCounter;
uint32_t I2cWatchdog_RecoveryCounter;
@@ -26,6 +27,7 @@ void PIT_I2C_WATCHDOG_HANDLER(void)
prevWatchdogCounter = I2C_Watchdog;
PIT_ClearStatusFlags(PIT, PIT_I2C_WATCHDOG_CHANNEL, PIT_TFLG_TIF_MASK);
TestLed_Toggle();
}
void InitI2cWatchdog(void)

View File

@@ -12,7 +12,6 @@
#include "init_peripherals.h"
#include "eeprom.h"
#include "timer.h"
#include "key_debouncer.h"
#include "usb_api.h"
#include "slave_scheduler.h"
#include "bootloader/wormhole.h"
@@ -21,6 +20,38 @@ bool IsBusPalOn;
volatile uint32_t I2cMainBusRequestedBaudRateBps = I2C_MAIN_BUS_NORMAL_BAUD_RATE;
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) {
IsBusPalOn = Wormhole.magicNumber == WORMHOLE_MAGIC_NUMBER && Wormhole.enumerationMode == EnumerationMode_BusPal;
if (IsBusPalOn) {
@@ -32,12 +63,10 @@ static void initBusPalState(void) {
static void initInterruptPriorities(void)
{
NVIC_SetPriority(PIT_I2C_WATCHDOG_IRQ_ID, 1);
NVIC_SetPriority(PIT_TIMER_IRQ_ID, 2);
NVIC_SetPriority(PIT_KEY_SCANNER_IRQ_ID, 3);
NVIC_SetPriority(PIT_KEY_DEBOUNCER_IRQ_ID, 3);
NVIC_SetPriority(I2C_MAIN_BUS_IRQ_ID, 3);
NVIC_SetPriority(I2C_EEPROM_BUS_IRQ_ID, 3);
NVIC_SetPriority(USB_IRQ_ID, 3);
NVIC_SetPriority(I2C_EEPROM_BUS_IRQ_ID, 0);
NVIC_SetPriority(PIT_TIMER_IRQ_ID, 3);
NVIC_SetPriority(I2C_MAIN_BUS_IRQ_ID, 4);
NVIC_SetPriority(USB_IRQ_ID, 4);
}
static void delay(void)
@@ -45,91 +74,73 @@ static void delay(void)
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(I2C_MAIN_BUS_SCL_PORT, I2C_MAIN_BUS_SCL_PIN, kPORT_MuxAsGpio);
GPIO_PinInit(I2C_MAIN_BUS_SCL_GPIO, I2C_MAIN_BUS_SCL_PIN, &(gpio_pin_config_t){kGPIO_DigitalOutput, 1});
PORT_SetPinMux(i2cBus->sdaPort, i2cBus->sdaPin, kPORT_MuxAsGpio);
PORT_SetPinMux(i2cBus->sclPort, i2cBus->sclPin, kPORT_MuxAsGpio);
GPIO_PinInit(i2cBus->sclGpio, i2cBus->sclPin, &(gpio_pin_config_t){kGPIO_DigitalOutput, 1});
bool isOn = true;
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});
bool isSdaHigh = GPIO_ReadPinInput(I2C_MAIN_BUS_SDA_GPIO, I2C_MAIN_BUS_SDA_PIN);
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_DigitalInput});
bool isSdaHigh = GPIO_ReadPinInput(i2cBus->sdaGpio, i2cBus->sdaPin);
GPIO_PinInit(i2cBus->sdaGpio, i2cBus->sdaPin, &(gpio_pin_config_t){kGPIO_DigitalOutput, 1});
if (isSdaHigh) {
return;
}
GPIO_WritePinOutput(I2C_MAIN_BUS_SCL_GPIO, I2C_MAIN_BUS_SCL_PIN, isOn);
GPIO_WritePinOutput(i2cBus->sclGpio, i2cBus->sclPin, isOn);
delay();
isOn = !isOn;
}
GPIO_WritePinOutput(I2C_MAIN_BUS_SDA_GPIO, I2C_MAIN_BUS_SDA_PIN, 0);
GPIO_WritePinOutput(i2cBus->sdaGpio, i2cBus->sdaPin, 0);
delay();
GPIO_WritePinOutput(I2C_MAIN_BUS_SCL_GPIO, I2C_MAIN_BUS_SCL_PIN, 1);
GPIO_WritePinOutput(i2cBus->sclGpio, i2cBus->sclPin, 1);
delay();
GPIO_WritePinOutput(I2C_MAIN_BUS_SDA_GPIO, I2C_MAIN_BUS_SDA_PIN, 1);
GPIO_WritePinOutput(i2cBus->sdaGpio, i2cBus->sdaPin, 1);
delay();
}
static void initI2cMainBus(void)
static void initI2cBus(i2c_bus_t *i2cBus)
{
CLOCK_EnableClock(I2C_MAIN_BUS_SDA_CLOCK);
CLOCK_EnableClock(I2C_MAIN_BUS_SCL_CLOCK);
CLOCK_EnableClock(i2cBus->sdaClock);
CLOCK_EnableClock(i2cBus->sclClock);
recoverI2c();
recoverI2cBus(i2cBus);
port_pin_config_t pinConfig = {
.pullSelect = kPORT_PullUp,
.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(I2C_MAIN_BUS_SCL_PORT, I2C_MAIN_BUS_SCL_PIN, &pinConfig);
PORT_SetPinConfig(i2cBus->sdaPort, i2cBus->sdaPin, &pinConfig);
PORT_SetPinConfig(i2cBus->sclPort, i2cBus->sclPin, &pinConfig);
i2c_master_config_t masterConfig;
I2C_MasterGetDefaultConfig(&masterConfig);
masterConfig.baudRate_Bps = I2cMainBusRequestedBaudRateBps;
uint32_t sourceClock = CLOCK_GetFreq(I2C_MAIN_BUS_CLK_SRC);
I2C_MasterInit(I2C_MAIN_BUS_BASEADDR, &masterConfig, sourceClock);
I2cMainBusActualBaudRateBps = I2C_ActualBaudRate;
masterConfig.baudRate_Bps = i2cBus == &i2cMainBus ? I2cMainBusRequestedBaudRateBps : I2C_EEPROM_BUS_BAUD_RATE;
uint32_t sourceClock = CLOCK_GetFreq(i2cBus->clockSrc);
I2C_MasterInit(i2cBus->baseAddr, &masterConfig, sourceClock);
if (i2cBus == &i2cMainBus) {
I2cMainBusActualBaudRateBps = I2C_ActualBaudRate;
}
}
void ReinitI2cMainBus(void)
{
I2C_MasterDeinit(I2C_MAIN_BUS_BASEADDR);
initI2cMainBus();
initI2cBus(&i2cMainBus);
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)
{
initI2cMainBus();
initI2cEepromBus();
initI2cBus(&i2cMainBus);
initI2cBus(&i2cEepromBus);
}
void InitPeripherals(void)
@@ -142,11 +153,8 @@ void InitPeripherals(void)
InitMergeSensor();
ADC_Init();
initI2c();
InitTestLed();
TestLed_Init();
LedPwm_Init();
#ifdef I2C_WATCHDOG
InitI2cWatchdog();
#endif
InitKeyDebouncer();
EEPROM_Init();
}

View File

@@ -1,10 +1,28 @@
#ifndef __INIT_PERIPHERALS_H__
#define __INIT_PERIPHERALS_H__
// Includes
// Includes:
#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:
extern bool IsBusPalOn;

View File

@@ -19,7 +19,6 @@
KeyActionType_SwitchLayer,
KeyActionType_SwitchKeymap,
KeyActionType_PlayMacro,
KeyActionType_Test,
} key_action_type_t;
typedef enum {
@@ -29,9 +28,9 @@
} keystroke_type_t;
typedef enum {
SwitchLayerMode_Hold,
SwitchLayerMode_HoldAndDoubleTapToggle,
SwitchLayerMode_Toggle,
SwitchLayerMode_Hold,
} switch_layer_mode_t;
typedef enum {

View File

@@ -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);
}

View File

@@ -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 60
// Functions:
void InitKeyDebouncer(void);
#endif

View File

@@ -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);
}

View File

@@ -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

View File

@@ -10,10 +10,10 @@
// Typedefs:
typedef struct {
bool previous;
bool current;
bool suppressed;
uint8_t debounceCounter;
uint8_t timestamp;
bool previous : 1;
bool current : 1;
bool debouncing : 1;
} key_state_t;
// Variables:

View File

@@ -23,7 +23,7 @@ void SwitchKeymapById(uint8_t index)
CurrentKeymapIndex = index;
ValidatedUserConfigBuffer.offset = AllKeymaps[index].offset;
ParseKeymap(&ValidatedUserConfigBuffer, index, AllKeymapsCount, AllMacrosCount);
LedDisplay_SetCurrentKeymapText();
LedDisplay_UpdateText();
}
bool SwitchKeymapByAbbreviation(uint8_t length, char *abbrev)
@@ -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_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
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_LEFT_CONTROL }},
{ .type = KeyActionType_Keystroke, .keystroke = { .scancode = HID_KEYBOARD_SC_LEFT_GUI }},

View File

@@ -5,12 +5,12 @@
#include "keymap.h"
static bool heldLayers[LAYER_COUNT];
static switch_layer_mode_t pressedLayers[LAYER_COUNT];
static bool toggledLayers[LAYER_COUNT];
void updateLayerStates(void)
{
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 keyId=0; keyId<MAX_KEY_COUNT_PER_MODULE; keyId++) {
@@ -20,9 +20,8 @@ void updateLayerStates(void)
if (action.type == KeyActionType_SwitchLayer) {
if (action.switchLayer.mode != SwitchLayerMode_Toggle) {
heldLayers[action.switchLayer.layer] = true;
}
if (action.switchLayer.mode != SwitchLayerMode_Hold && !keyState->previous && keyState->current) {
pressedLayers[action.switchLayer.layer] = action.switchLayer.mode;
} else if (!keyState->previous) {
toggledLayers[action.switchLayer.layer] = true;
}
}
}
@@ -40,11 +39,11 @@ layer_id_t GetActiveLayer()
// Handle toggled layers
for (layer_id_t layerId=LayerId_Mod; layerId<=LayerId_Mouse; layerId++) {
if (pressedLayers[layerId]) {
if (toggledLayers[layerId]) {
if (ToggledLayer == layerId) {
ToggledLayer = LayerId_Base;
break;
} else if (ToggledLayer == LayerId_Base && pressedLayers[layerId] == SwitchLayerMode_Toggle) {
} else if (ToggledLayer == LayerId_Base && toggledLayers[layerId] == SwitchLayerMode_Toggle) {
ToggledLayer = layerId;
break;
}
@@ -71,3 +70,14 @@ layer_id_t GetActiveLayer()
return heldLayer;
}
bool IsLayerHeld(void)
{
for (layer_id_t layerId = LayerId_Mod; layerId <= LayerId_Mouse; layerId++) {
if (heldLayers[layerId]) {
return true;
}
}
return false;
}

View File

@@ -25,6 +25,7 @@
// Functions:
layer_id_t GetActiveLayer();
layer_id_t GetActiveLayer(void);
bool IsLayerHeld(void);
#endif

View File

@@ -5,8 +5,10 @@
uint8_t IconsAndLayerTextsBrightness = 0xff;
uint8_t AlphanumericSegmentsBrightness = 0xff;
bool ledIconStates[LedDisplayIcon_Last];
char LedDisplay_DebugString[] = " ";
static const uint16_t capitalLetterToSegmentSet[] = {
static const uint16_t capitalLetterToSegmentMap[] = {
0b0000000011110111,
0b0001001010001111,
0b0000000000111001,
@@ -35,7 +37,7 @@ static const uint16_t capitalLetterToSegmentSet[] = {
0b0000110000001001,
};
static const uint16_t digitToSegmentSet[] = {
static const uint16_t digitToSegmentMap[] = {
0b0000110000111111,
0b0000010000000110,
0b0000100010001011,
@@ -48,13 +50,13 @@ static const uint16_t digitToSegmentSet[] = {
0b0000000011101111,
};
static uint16_t characterToSegmentSet(char character)
static uint16_t characterToSegmentMap(char character)
{
switch (character) {
case 'A' ... 'Z':
return capitalLetterToSegmentSet[character - 'A'];
return capitalLetterToSegmentMap[character - 'A'];
case '0' ... '9':
return digitToSegmentSet[character - '0'];
return digitToSegmentMap[character - '0'];
}
return 0;
}
@@ -65,11 +67,11 @@ void LedDisplay_SetText(uint8_t length, const char* text)
switch (length) {
case 3:
allSegmentSets = (uint64_t)characterToSegmentSet(text[2]) << 28;
allSegmentSets = (uint64_t)characterToSegmentMap(text[2]) << 28;
case 2:
allSegmentSets |= characterToSegmentSet(text[1]) << 14;
allSegmentSets |= characterToSegmentMap(text[1]) << 14;
case 1:
allSegmentSets |= characterToSegmentSet(text[0]);
allSegmentSets |= characterToSegmentMap(text[0]);
}
LedDriverValues[LedDriverId_Left][11] = allSegmentSets & 0b00000001 ? AlphanumericSegmentsBrightness : 0;
@@ -84,12 +86,6 @@ void LedDisplay_SetText(uint8_t length, const char* text)
}
}
void LedDisplay_SetCurrentKeymapText(void)
{
keymap_reference_t *currentKeymap = AllKeymaps + CurrentKeymapIndex;
LedDisplay_SetText(currentKeymap->abbreviationLen, currentKeymap->abbreviation);
}
void LedDisplay_SetLayer(layer_id_t layerId)
{
for (uint8_t i = 13; i <= 45; i += 16) {
@@ -108,5 +104,29 @@ bool LedDisplay_GetIcon(led_display_icon_t icon)
void LedDisplay_SetIcon(led_display_icon_t icon, bool isEnabled)
{
LedDriverValues[LedDriverId_Left][8 + icon] = isEnabled ? IconsAndLayerTextsBrightness : 0;
ledIconStates[icon] = isEnabled;
LedDriverValues[LedDriverId_Left][icon + 8] = isEnabled ? IconsAndLayerTextsBrightness : 0;
}
void LedDisplay_UpdateIcons(void)
{
for (led_display_icon_t i=0; i<=LedDisplayIcon_Last; i++) {
LedDisplay_SetIcon(i, ledIconStates[i]);
}
}
void LedDisplay_UpdateText(void)
{
#if LED_DISPLAY_DEBUG_MODE == 0
keymap_reference_t *currentKeymap = AllKeymaps + CurrentKeymapIndex;
LedDisplay_SetText(currentKeymap->abbreviationLen, currentKeymap->abbreviation);
#else
LedDisplay_SetText(strlen(LedDisplay_DebugString), LedDisplay_DebugString);
#endif
}
void LedDisplay_UpdateAll(void)
{
LedDisplay_UpdateIcons();
LedDisplay_UpdateText();
}

View File

@@ -7,26 +7,33 @@
#include <stdbool.h>
#include "layer.h"
// Macros:
#define LED_DISPLAY_DEBUG_MODE 0
// Typedefs:
typedef enum {
LedDisplayIcon_CapsLock,
LedDisplayIcon_Agent,
LedDisplayIcon_Adaptive,
LedDisplayIcon_Last = LedDisplayIcon_Adaptive,
} led_display_icon_t;
// Variables:
extern uint8_t IconsAndLayerTextsBrightness;
extern uint8_t AlphanumericSegmentsBrightness;
extern char LedDisplay_DebugString[];
// Functions:
void LedDisplay_SetText(uint8_t length, const char* text);
void LedDisplay_SetCurrentKeymapText(void);
void LedDisplay_SetLayer(layer_id_t layerId);
void LedDisplay_SetIcon(led_display_icon_t icon, bool isEnabled);
bool LedDisplay_GetIcon(led_display_icon_t icon);
void LedDisplay_SetIcon(led_display_icon_t icon, bool isEnabled);
void LedDisplay_UpdateIcons(void);
void LedDisplay_UpdateText(void);
void LedDisplay_UpdateAll(void);
#endif

View File

@@ -0,0 +1,277 @@
/*
** ###################################################################
** Processors: MK22FN512CAP12
** MK22FN512VDC12
** MK22FN512VLH12
** MK22FN512VLL12
** MK22FN512VMP12
**
** Compiler: GNU C Compiler
** Reference manual: K22P121M120SF7RM, Rev. 1, March 24, 2014
** Version: rev. 2.8, 2015-02-19
** Build: b151217
**
** Abstract:
** Linker file for the GNU C Compiler
**
** Copyright (c) 2015 Freescale Semiconductor, Inc.
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without modification,
** are permitted provided that the following conditions are met:
**
** o Redistributions of source code must retain the above copyright notice, this list
** of conditions and the following disclaimer.
**
** o Redistributions in binary form must reproduce the above copyright notice, this
** list of conditions and the following disclaimer in the documentation and/or
** other materials provided with the distribution.
**
** o Neither the name of Freescale Semiconductor, Inc. nor the names of its
** contributors may be used to endorse or promote products derived from this
** software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
** ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**
** http: www.freescale.com
** mail: support@freescale.com
**
** ###################################################################
*/
/* Entry Point */
ENTRY(Reset_Handler)
HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x2000;
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0400;
M_VECTOR_RAM_SIZE = DEFINED(__ram_vector_table__) ? 0x0400 : 0x0;
/* This should match the value in bootloader_config.h if KBOOT is used */
BL_APP_VECTOR_TABLE_ADDRESS = DEFINED(__bl_app_vector_table_address__) ? __bl_app_vector_table_address__ : 0;
/* Specify the memory areas */
MEMORY
{
m_interrupts (RX) : ORIGIN = 0x0 + BL_APP_VECTOR_TABLE_ADDRESS, LENGTH = 0x00000400
m_text (RX) : ORIGIN = 0x00000400 + BL_APP_VECTOR_TABLE_ADDRESS, LENGTH = 512K - 0x400 - BL_APP_VECTOR_TABLE_ADDRESS
m_data (RW) : ORIGIN = 0x1FFF0000, LENGTH = 0x00010000
m_data_2 (RW) : ORIGIN = 0x20000000, LENGTH = 0x0000FF00
m_noinit (RW) : ORIGIN = 0x2000FF00, LENGTH = 0x000000FF
}
/* Define output sections */
SECTIONS
{
/* The startup code goes first into internal flash */
.interrupts :
{
__VECTOR_TABLE = .;
. = ALIGN(4);
KEEP(*(.isr_vector)) /* Startup code */
. = ALIGN(4);
} > m_interrupts
/* The program code and other data goes into internal flash */
.text :
{
. = ALIGN(4);
*(.text) /* .text sections (code) */
*(.text*) /* .text* sections (code) */
*(.rodata) /* .rodata sections (constants, strings, etc.) */
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
*(.glue_7) /* glue arm to thumb code */
*(.glue_7t) /* glue thumb to arm code */
*(.eh_frame)
KEEP (*(.init))
KEEP (*(.fini))
. = ALIGN(4);
} > m_text
.ARM.extab :
{
*(.ARM.extab* .gnu.linkonce.armextab.*)
} > m_text
.ARM :
{
__exidx_start = .;
*(.ARM.exidx*)
__exidx_end = .;
} > m_text
.ctors :
{
__CTOR_LIST__ = .;
/* gcc uses crtbegin.o to find the start of
the constructors, so we make sure it is
first. Because this is a wildcard, it
doesn't matter if the user does not
actually link against crtbegin.o; the
linker won't look for a file to match a
wildcard. The wildcard also means that it
doesn't matter which directory crtbegin.o
is in. */
KEEP (*crtbegin.o(.ctors))
KEEP (*crtbegin?.o(.ctors))
/* We don't want to include the .ctor section from
from the crtend.o file until after the sorted ctors.
The .ctor section from the crtend file contains the
end of ctors marker and it must be last */
KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
__CTOR_END__ = .;
} > m_text
.dtors :
{
__DTOR_LIST__ = .;
KEEP (*crtbegin.o(.dtors))
KEEP (*crtbegin?.o(.dtors))
KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
__DTOR_END__ = .;
} > m_text
.preinit_array :
{
PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP (*(.preinit_array*))
PROVIDE_HIDDEN (__preinit_array_end = .);
} > m_text
.init_array :
{
PROVIDE_HIDDEN (__init_array_start = .);
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array*))
PROVIDE_HIDDEN (__init_array_end = .);
} > m_text
.fini_array :
{
PROVIDE_HIDDEN (__fini_array_start = .);
KEEP (*(SORT(.fini_array.*)))
KEEP (*(.fini_array*))
PROVIDE_HIDDEN (__fini_array_end = .);
} > m_text
__etext = .; /* define a global symbol at end of code */
__DATA_ROM = .; /* Symbol is used by startup for data initialization */
.interrupts_ram :
{
. = ALIGN(4);
__VECTOR_RAM__ = .;
__interrupts_ram_start__ = .; /* Create a global symbol at data start */
*(.m_interrupts_ram) /* This is a user defined section */
. += M_VECTOR_RAM_SIZE;
. = ALIGN(4);
__interrupts_ram_end__ = .; /* Define a global symbol at data end */
} > m_data
__VECTOR_RAM = DEFINED(__ram_vector_table__) ? __VECTOR_RAM__ : ORIGIN(m_interrupts);
__RAM_VECTOR_TABLE_SIZE_BYTES = DEFINED(__ram_vector_table__) ? (__interrupts_ram_end__ - __interrupts_ram_start__) : 0x0;
.data : AT(__DATA_ROM)
{
. = ALIGN(4);
__DATA_RAM = .;
__data_start__ = .; /* create a global symbol at data start */
*(.data) /* .data sections */
*(.data*) /* .data* sections */
KEEP(*(.jcr*))
. = ALIGN(4);
__data_end__ = .; /* define a global symbol at data end */
} > m_data
__DATA_END = __DATA_ROM + (__data_end__ - __data_start__);
text_end = ORIGIN(m_text) + LENGTH(m_text);
ASSERT(__DATA_END <= text_end, "region m_text overflowed with text and data")
/* Uninitialized data section */
.bss : ALIGN(4)
{
/* This is used by the startup in order to initialize the .bss section */
__START_BSS = .;
__bss_start__ = .;
*(.bss)
*(.bss*)
*(COMMON)
. = ALIGN(4);
} > m_data
.m_usb_bdt (NOLOAD) :
{
. = ALIGN(512);
*(m_usb_bdt)
} > m_data
.m_usb_global (NOLOAD) :
{
*(m_usb_global)
__bss_end__ = .;
__END_BSS = .;
} > m_data
.m_data_2 :
{
. = ALIGN(4);
*(.m_data_2) /* This is an User defined section */
. = ALIGN(4);
} > m_data_2
.heap :
{
. = ALIGN(8);
__end__ = .;
PROVIDE(end = .);
_pvHeapStart = .; /* Add for _sbrk */
__HeapBase = .;
. += HEAP_SIZE;
__HeapLimit = .;
__heap_limit = .; /* Add for _sbrk */
} > m_data_2
.stack :
{
. = ALIGN(8);
. += STACK_SIZE;
} > m_data_2
/* Initializes stack on the end of block */
__StackTop = ORIGIN(m_data_2) + LENGTH(m_data_2);
__StackLimit = __StackTop - STACK_SIZE;
PROVIDE(__stack = __StackTop);
.ARM.attributes 0 : { *(.ARM.attributes) }
ASSERT(__StackLimit >= __HeapLimit, "region m_data_2 overflowed with stack and heap")
.noinit (NOLOAD):
{
. = ALIGN(4);
_noinit = .;
*(.noinit .noinit.*)
. = ALIGN(4) ;
_end_noinit = .;
} > m_noinit
/* Mandatory to be word aligned, _sbrk assumes this */
PROVIDE ( end = _end_noinit ); /* was _ebss */
PROVIDE ( _end = _end_noinit );
PROVIDE ( __end = _end_noinit );
PROVIDE ( __end__ = _end_noinit );
}

View File

@@ -1,6 +1,7 @@
#include "macros.h"
#include "config_parser/parse_macro.h"
#include "config_parser/config_globals.h"
#include "timer.h"
macro_reference_t AllMacros[MAX_MACRO_NUM];
uint8_t AllMacrosCount;
@@ -18,69 +19,102 @@ uint8_t characterToScancode(char character)
{
switch (character) {
case 'A' ... 'Z':
return 0;
case 'a' ... 'z':
return 0;
return HID_KEYBOARD_SC_A - 1 + (character & 0x1F);
case '1' ... '9':
return 0;
return HID_KEYBOARD_SC_1_AND_EXCLAMATION - 1 + (character & 0x0F);
case ')':
case '0':
return 0;
return HID_KEYBOARD_SC_0_AND_CLOSING_PARENTHESIS;
case '!':
return 0;
return HID_KEYBOARD_SC_1_AND_EXCLAMATION;
case '@':
return 0;
return HID_KEYBOARD_SC_2_AND_AT;
case '#':
return 0;
return HID_KEYBOARD_SC_3_AND_HASHMARK;
case '$':
return 0;
return HID_KEYBOARD_SC_4_AND_DOLLAR;
case '%':
return 0;
return HID_KEYBOARD_SC_5_AND_PERCENTAGE;
case '^':
return 0;
return HID_KEYBOARD_SC_6_AND_CARET;
case '&':
return 0;
return HID_KEYBOARD_SC_7_AND_AMPERSAND;
case '*':
return 0;
return HID_KEYBOARD_SC_8_AND_ASTERISK;
case '(':
return 0;
return HID_KEYBOARD_SC_9_AND_OPENING_PARENTHESIS;
case '`':
case '~':
return 0;
return HID_KEYBOARD_SC_GRAVE_ACCENT_AND_TILDE;
case '[':
case '{':
return 0;
return HID_KEYBOARD_SC_OPENING_BRACKET_AND_OPENING_BRACE;
case ']':
case '}':
return 0;
return HID_KEYBOARD_SC_CLOSING_BRACKET_AND_CLOSING_BRACE;
case ';':
case ':':
return 0;
return HID_KEYBOARD_SC_SEMICOLON_AND_COLON;
case '\'':
case '\"':
return 0;
return HID_KEYBOARD_SC_APOSTROPHE_AND_QUOTE;
case '+':
case '=':
return 0;
return HID_KEYBOARD_SC_EQUAL_AND_PLUS;
case '\\':
case '|':
return 0;
return HID_KEYBOARD_SC_BACKSLASH_AND_PIPE;
case '.':
case '>':
return 0;
return HID_KEYBOARD_SC_DOT_AND_GREATER_THAN_SIGN;
case ',':
case '<':
return 0;
return HID_KEYBOARD_SC_COMMA_AND_LESS_THAN_SIGN;
case '/':
case '\?':
return 0;
return HID_KEYBOARD_SC_SLASH_AND_QUESTION_MARK;
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;
}
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)
{
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;
switch (currentMacroAction.key.action) {
case MacroSubAction_Press:
case MacroSubAction_Tap:
if (!pressStarted) {
pressStarted = true;
addModifiers(currentMacroAction.key.modifierMask);
switch (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;
}
addScancode(currentMacroAction.key.scancode, currentMacroAction.key.type);
return true;
}
pressStarted = false;
deleteModifiers(currentMacroAction.key.modifierMask);
switch (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;
}
deleteScancode(currentMacroAction.key.scancode, currentMacroAction.key.type);
break;
case MacroSubAction_Release:
deleteModifiers(currentMacroAction.key.modifierMask);
switch (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;
}
deleteScancode(currentMacroAction.key.scancode, currentMacroAction.key.type);
break;
case MacroSubAction_Hold:
case MacroSubAction_Press:
addModifiers(currentMacroAction.key.modifierMask);
switch (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;
}
addScancode(currentMacroAction.key.scancode, currentMacroAction.key.type);
break;
}
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)
{
switch (currentMacroAction.type) {
case MacroActionType_Delay:
return false;
return processDelayAction();
case MacroActionType_Key:
return processKeyMacroAction();
return processKeyAction();
case MacroActionType_MouseButton:
return false;
return processMouseButtonAction();
case MacroActionType_MoveMouse:
return false;
return processMoveMouseAction();
case MacroActionType_ScrollMouse:
return false;
return processScrollMouseAction();
case MacroActionType_Text:
return false;
return processTextAction();
}
return false;
}
void Macros_StartMacro(uint8_t index)
{
if(AllMacros[index].macroActionsCount == 0) {
return;
}
MacroPlaying = true;
currentMacroIndex = index;
currentMacroActionIndex = 0;

View File

@@ -20,8 +20,8 @@
} macro_reference_t;
typedef enum {
MacroSubAction_Tap,
MacroSubAction_Press,
MacroSubAction_Hold,
MacroSubAction_Release,
} macro_sub_action_t;
@@ -39,7 +39,7 @@
struct {
macro_sub_action_t action;
keystroke_type_t type;
uint8_t scancode;
uint16_t scancode;
uint8_t modifierMask;
} ATTR_PACKED key;
struct {
@@ -55,7 +55,7 @@
int16_t y;
} ATTR_PACKED scrollMouse;
struct {
int16_t delay;
uint16_t delay;
} ATTR_PACKED delay;
struct {
const char *text;

View File

@@ -6,9 +6,10 @@
#include "bus_pal_hardware.h"
#include "command.h"
#include "eeprom.h"
#include "key_scanner.h"
#include "right_key_matrix.h"
#include "usb_commands/usb_command_apply_config.h"
#include "peripherals/reset_button.h"
#include "config_parser/config_globals.h"
#include "usb_report_updater.h"
static bool IsEepromInitialized = false;
@@ -21,17 +22,21 @@ static void userConfigurationReadFinished(void)
static void hardwareConfigurationReadFinished(void)
{
if (IsFactoryResetModeEnabled) {
HardwareConfig->signatureLength = HARDWARE_CONFIG_SIGNATURE_LENGTH;
strncpy(HardwareConfig->signature, "FTY", HARDWARE_CONFIG_SIGNATURE_LENGTH);
}
EEPROM_LaunchTransfer(EepromOperation_Read, ConfigBufferId_StagingUserConfig, userConfigurationReadFinished);
}
void main(void)
int main(void)
{
InitClock();
InitPeripherals();
if (!RESET_BUTTON_IS_PRESSED) {
EEPROM_LaunchTransfer(EepromOperation_Read, ConfigBufferId_HardwareConfig, hardwareConfigurationReadFinished);
}
IsFactoryResetModeEnabled = RESET_BUTTON_IS_PRESSED;
EEPROM_LaunchTransfer(EepromOperation_Read, ConfigBufferId_HardwareConfig, hardwareConfigurationReadFinished);
if (IsBusPalOn) {
init_hardware();
@@ -39,8 +44,6 @@ void main(void)
} else {
InitSlaveScheduler();
KeyMatrix_Init(&RightKeyMatrix);
InitKeyScanner();
UpdateUsbReports();
InitUsb();
while (1) {
@@ -48,6 +51,8 @@ void main(void)
UsbCommand_ApplyConfig();
IsConfigInitialized = true;
}
KeyMatrix_ScanRow(&RightKeyMatrix);
++MatrixScanCounter;
UpdateUsbReports();
__WFI();
}

View File

@@ -17,12 +17,4 @@
#define PIT_TIMER_IRQ_ID PIT1_IRQn
#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

View File

@@ -2,6 +2,8 @@
#include "fsl_port.h"
#include "bootloader/wormhole.h"
bool IsFactoryResetModeEnabled = false;
void RESET_BUTTON_IRQ_HANDLER(void)
{
Wormhole.magicNumber = WORMHOLE_MAGIC_NUMBER;

View File

@@ -16,6 +16,10 @@
#define RESET_BUTTON_IS_PRESSED !GPIO_ReadPinInput(RESET_BUTTON_GPIO, RESET_BUTTON_PIN)
// Variables:
extern bool IsFactoryResetModeEnabled;
// Functions:
void InitResetButton(void);

View File

@@ -1,10 +1,31 @@
#include "test_led.h"
#include "fsl_port.h"
#include "timer.h"
void InitTestLed(void)
void TestLed_Init(void)
{
CLOCK_EnableClock(TEST_LED_CLOCK);
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});
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);
}

View File

@@ -15,13 +15,29 @@
#define TEST_LED_CLOCK kCLOCK_PortD
#define TEST_LED_GPIO_PIN 7U
#define TEST_LED_ON() GPIO_SetPinsOutput(TEST_LED_GPIO, 1U << TEST_LED_GPIO_PIN)
#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))
#define TEST_LED_TOGGLE() GPIO_TogglePinsOutput(TEST_LED_GPIO, 1U << TEST_LED_GPIO_PIN)
static inline void TestLed_On(void)
{
GPIO_SetPinsOutput(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:
void InitTestLed(void);
void TestLed_Init(void);
void TestLed_Blink(uint8_t times);
#endif

View File

@@ -1,5 +1,7 @@
#include "right_key_matrix.h"
uint32_t MatrixScanCounter;
key_matrix_t RightKeyMatrix = {
.colNum = RIGHT_KEY_MATRIX_COLS_NUM,
.rowNum = RIGHT_KEY_MATRIX_ROWS_NUM,

View File

@@ -14,5 +14,6 @@
// Variables:
extern key_matrix_t RightKeyMatrix;
extern uint32_t MatrixScanCounter;
#endif

View File

@@ -62,6 +62,22 @@ static uint8_t setShutdownModeNormalBuffer[] = {LED_DRIVER_REGISTER_SHUTDOWN, SH
static uint8_t setFrame1Buffer[] = {LED_DRIVER_REGISTER_FRAME, LED_DRIVER_FRAME_1};
static uint8_t updatePwmRegistersBuffer[PWM_REGISTER_BUFFER_LENGTH];
void LedSlaveDriver_DisableLeds(void)
{
for (uint8_t ledDriverId=0; ledDriverId<=LedDriverId_Last; ledDriverId++) {
memset(LedDriverValues[ledDriverId], 0, LED_DRIVER_LED_COUNT);
}
}
void LedSlaveDriver_UpdateLeds(void)
{
for (uint8_t ledDriverId=0; ledDriverId<=LedDriverId_Last; ledDriverId++) {
memset(LedDriverValues[ledDriverId], KeyBacklightBrightness, LED_DRIVER_LED_COUNT);
}
LedDisplay_UpdateAll();
}
void LedSlaveDriver_Init(uint8_t ledDriverId)
{
if (ledDriverId == ISO_KEY_LED_DRIVER_ID && IS_ISO) {
@@ -74,10 +90,7 @@ void LedSlaveDriver_Init(uint8_t ledDriverId)
memset(LedDriverValues[ledDriverId], KeyBacklightBrightness, LED_DRIVER_LED_COUNT);
if (ledDriverId == LedDriverId_Left) {
LedDisplay_SetIcon(LedDisplayIcon_CapsLock, false);
LedDisplay_SetIcon(LedDisplayIcon_Agent, false);
LedDisplay_SetIcon(LedDisplayIcon_Adaptive, false);
LedDisplay_SetCurrentKeymapText();
LedDisplay_UpdateAll();
}
}
@@ -118,10 +131,8 @@ status_t LedSlaveDriver_Update(uint8_t ledDriverId)
*ledIndex += chunkSize;
if (*ledIndex >= LED_DRIVER_LED_COUNT) {
*ledIndex = 0;
#ifndef LED_DRIVER_STRESS_TEST
memcpy(currentLedDriverState->targetLedValues, ledValues, LED_DRIVER_LED_COUNT);
*ledDriverPhase = LedDriverPhase_UpdateChangedLedValues;
#endif
}
break;
case LedDriverPhase_UpdateChangedLedValues: {

View File

@@ -23,6 +23,7 @@
typedef enum {
LedDriverId_Right,
LedDriverId_Left,
LedDriverId_Last = LedDriverId_Left,
} led_driver_id_t;
typedef enum {
@@ -49,6 +50,8 @@
// Functions:
void LedSlaveDriver_DisableLeds(void);
void LedSlaveDriver_UpdateLeds(void);
void LedSlaveDriver_Init(uint8_t ledDriverId);
status_t LedSlaveDriver_Update(uint8_t ledDriverId);

View File

@@ -9,6 +9,17 @@
#include "key_states.h"
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 i2c_message_t txMessage;
@@ -17,13 +28,13 @@ static uhk_module_i2c_addresses_t moduleIdsToI2cAddresses[] = {
.firmwareI2cAddress = I2C_ADDRESS_LEFT_KEYBOARD_HALF_FIRMWARE,
.bootloaderI2cAddress = I2C_ADDRESS_LEFT_KEYBOARD_HALF_BOOTLOADER
},
{ // UhkModuleDriverId_LeftAddon
.firmwareI2cAddress = I2C_ADDRESS_LEFT_ADDON_FIRMWARE,
.bootloaderI2cAddress = I2C_ADDRESS_LEFT_ADDON_BOOTLOADER
{ // UhkModuleDriverId_LeftModule
.firmwareI2cAddress = I2C_ADDRESS_LEFT_MODULE_FIRMWARE,
.bootloaderI2cAddress = I2C_ADDRESS_LEFT_MODULE_BOOTLOADER
},
{ // UhkModuleDriverId_RightAddon
.firmwareI2cAddress = I2C_ADDRESS_RIGHT_ADDON_FIRMWARE,
.bootloaderI2cAddress = I2C_ADDRESS_RIGHT_ADDON_BOOTLOADER
{ // UhkModuleDriverId_RightModule
.firmwareI2cAddress = I2C_ADDRESS_RIGHT_MODULE_FIRMWARE,
.bootloaderI2cAddress = I2C_ADDRESS_RIGHT_MODULE_BOOTLOADER
},
};
@@ -55,6 +66,9 @@ void UhkModuleSlaveDriver_Init(uint8_t uhkModuleDriverId)
uhk_module_i2c_addresses_t *uhkModuleI2cAddresses = moduleIdsToI2cAddresses + uhkModuleDriverId;
uhkModuleState->firmwareI2cAddress = uhkModuleI2cAddresses->firmwareI2cAddress;
uhkModuleState->bootloaderI2cAddress = uhkModuleI2cAddresses->bootloaderI2cAddress;
uhkModuleState->pointerDelta.x = 0;
uhkModuleState->pointerDelta.y = 0;
}
status_t UhkModuleSlaveDriver_Update(uint8_t uhkModuleDriverId)
@@ -221,11 +235,17 @@ status_t UhkModuleSlaveDriver_Update(uint8_t uhkModuleDriverId)
break;
case UhkModulePhase_ProcessKeystates:
if (CRC16_IsMessageValid(rxMessage)) {
uint8_t slotId = uhkModuleDriverId + 1;
uint8_t slotId = UhkModuleSlaveDriver_DriverIdToSlotId(uhkModuleDriverId);
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];
}
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;
*uhkModulePhase = UhkModulePhase_SetTestLed;
@@ -265,10 +285,8 @@ status_t UhkModuleSlaveDriver_Update(uint8_t uhkModuleDriverId)
void UhkModuleSlaveDriver_Disconnect(uint8_t uhkModuleDriverId)
{
#ifdef LED_DRIVERS_ENABLED
if (uhkModuleDriverId == SlaveId_LeftKeyboardHalf) {
Slaves[SlaveId_LeftLedDriver].isConnected = false;
}
UhkModuleStates[uhkModuleDriverId].moduleId = 0;
#endif
}

View File

@@ -6,20 +6,19 @@
#include "fsl_common.h"
#include "crc16.h"
#include "versions.h"
#include "usb_interfaces/usb_interface_mouse.h"
// Macros:
#define UHK_MODULE_MAX_COUNT 3
#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:
typedef enum {
UhkModuleDriverId_LeftKeyboardHalf,
UhkModuleDriverId_LeftAddon,
UhkModuleDriverId_RightAddon,
UhkModuleDriverId_LeftModule,
UhkModuleDriverId_RightModule,
} uhk_module_id_t;
typedef enum {
@@ -83,6 +82,7 @@
uint8_t bootloaderI2cAddress;
uint8_t keyCount;
uint8_t pointerCount;
pointer_delta_t pointerDelta;
} uhk_module_state_t;
typedef struct {
@@ -96,6 +96,9 @@
// Functions:
uint8_t UhkModuleSlaveDriver_SlotIdToDriverId(uint8_t slotId);
uint8_t UhkModuleSlaveDriver_DriverIdToSlotId(uint8_t uhkModuleDriverId);
void UhkModuleSlaveDriver_Init(uint8_t uhkModuleDriverId);
status_t UhkModuleSlaveDriver_Update(uint8_t uhkModuleDriverId);
void UhkModuleSlaveDriver_Disconnect(uint8_t uhkModuleDriverId);

View File

@@ -24,14 +24,13 @@ uhk_slave_t Slaves[] = {
{
.init = UhkModuleSlaveDriver_Init,
.update = UhkModuleSlaveDriver_Update,
.perDriverId = UhkModuleDriverId_LeftAddon,
.perDriverId = UhkModuleDriverId_LeftModule,
},
{
.init = UhkModuleSlaveDriver_Init,
.update = UhkModuleSlaveDriver_Update,
.perDriverId = UhkModuleDriverId_RightAddon,
.perDriverId = UhkModuleDriverId_RightModule,
},
#ifdef LED_DRIVERS_ENABLED
{
.init = LedSlaveDriver_Init,
.update = LedSlaveDriver_Update,
@@ -42,7 +41,6 @@ uhk_slave_t Slaves[] = {
.update = LedSlaveDriver_Update,
.perDriverId = LedDriverId_Left,
},
#endif
{
.init = KbootSlaveDriver_Init,
.update = KbootSlaveDriver_Update,

Some files were not shown because too many files have changed in this diff Show More