8b180d94b0
No need to zero prevWatchdogCounter because it's zero by default.
László Monda
2017-09-28 23:23:19 +02:00
96eeb97a04
Remove commented out code. The scheduler checks previousStatus and acts accordingly, so things should work out fine.
László Monda
2017-09-28 23:03:40 +02:00
55e0872967
Add new SlaveId_* values and an explanatory comment.
László Monda
2017-09-28 22:59:22 +02:00
c04c5de504
Improve comment.
László Monda
2017-09-28 22:53:24 +02:00
5eb82c262a
Fix the scheduler by making it maintain previousSlaveId correctly.
László Monda
2017-09-28 21:44:51 +02:00
6c2e806d6d
Fix coding style.
László Monda
2017-09-28 21:16:42 +02:00
8136acf63c
Add the left add-on and right add-on to the list of slaves to be scheduled.
László Monda
2017-09-28 21:15:01 +02:00
6ec5140eca
Add and initialize firmwareI2cAddress and bootloaderI2cAddress to uhk_module_state_t.
László Monda
2017-09-28 18:10:33 +02:00
f80a88c419
RX messages are per-module by nature, so instead of using a singleton, add rxMessage to uhk_module_state_t.
László Monda
2017-09-28 17:17:30 +02:00
3fda14df27
Update the coding style of dereference operators.
László Monda
2017-09-28 17:09:59 +02:00
ef2c4a1e7f
Add uhk_module_state_t containing module variables and phase. Merge uhkModuleTargetStates and uhkModulePhases to uhkModuleStates.
László Monda
2017-09-28 17:06:56 +02:00
de21cfc07e
Rename uhk_module_state_t to uhk_module_vars_t.
László Monda
2017-09-28 16:57:46 +02:00
9ecf04cf11
Update .travis.yml
Stephen
2017-09-28 06:38:34 -07:00
4666b24c69
Change UsbMouseReport back to extern that I screwed up in ecf1ad2468
László Monda
2017-09-28 14:13:24 +02:00
8b5b224bf3
Compute KEY_STATE_SIZE the right way.
László Monda
2017-09-28 04:05:44 +02:00
9309c1e954
UpperCamelCase rxMessage and txMessage because they're extern variables.
László Monda
2017-09-28 03:38:44 +02:00
8d57968575
Also commit slave_scheduler.c regarding the kStatus_Uhk_NoOp -> kStatus_Uhk_NoTransfer rename that I forgot to commit.
László Monda
2017-09-28 03:35:28 +02:00
9a42123648
Rename kStatus_Uhk_NoOp to kStatus_Uhk_NoTransfer.
László Monda
2017-09-28 03:30:32 +02:00
d578b7aba8
Remove unused variable DisableKeyMatrixScanState.
László Monda
2017-09-28 03:24:40 +02:00
e3faa5ade4
Remove extern modifier.
László Monda
2017-09-28 03:18:18 +02:00
d844264ad9
Update CONTRIBUTING.md
László Monda
2017-09-28 03:14:59 +02:00
751810ec4c
Explicitly add void to the argument list of zero argument functions.
László Monda
2017-09-28 03:03:11 +02:00
ecf1ad2468
Don't use the extern keyword for functions because it's redundant.
László Monda
2017-09-28 02:37:55 +02:00
41c2556386
Use the static keyword wherever it's valid inside of uhk_module_driver.c
László Monda
2017-09-28 02:26:56 +02:00
d43bbbbf51
Not being an extern function, lowerCamelCase uhkModuleTargetStates.
László Monda
2017-09-28 02:14:40 +02:00
9a4c49e9a6
Extract MAX_PWM_BRIGHTNESS.
László Monda
2017-09-28 01:35:04 +02:00
d4124d8331
Cache UHK module state variables and only tranfer them when changed.
László Monda
2017-09-28 01:30:27 +02:00
790a2e0a65
Improve OSX dependency management through brew bundle
Stephen Groat
2017-09-27 16:24:44 -07:00
5769f66994
Introduce currentSlave when initializing the slaves.
László Monda
2017-09-27 00:27:14 +02:00
8f830f7d9f
Make sure that all slaves are initialized upon startup.
László Monda
2017-09-27 00:22:28 +02:00
145443c65c
Fix the computation of KEY_STATE_SIZE and the byte count to memset in BoolBytesToBits()
László Monda
2017-09-26 20:18:26 +02:00
1839be81b6
Improve the description of slots.
László Monda
2017-09-26 20:08:57 +02:00
9dde9ee917
Replace SLOT_ID_* macros with SlotId_* enum values.
László Monda
2017-09-26 20:01:18 +02:00
065a19fdc8
Remove redundant SLOT_I2C_* macros from slot.h because they're present in i2c_addresses.h
László Monda
2017-09-26 19:40:53 +02:00
3bd943aa85
Extract rx() and tx().
László Monda
2017-09-26 19:19:44 +02:00
3b3e40af83
Pass i2c_message_t messages not only from the left half to the right, but vice versa.
László Monda
2017-09-26 04:12:05 +02:00
b88c6e4291
Add i2c_message_t and use it all across the codebase. This will allow handling variable-length I2C messages and validation with minimal effort. The test LED and brightness PWM update features got temporarily broken and will fix them soon.
László Monda
2017-09-25 03:03:14 +02:00
ef9d9ee9a7
Add kStatus_Uhk_NoOp and make the scheduler handle it.
László Monda
2017-09-22 14:32:43 +02:00
2aa74853b5
Add UhkModulePhase_ProcessKeystates and extract relevant code into its section.
László Monda
2017-09-22 03:13:53 +02:00
cc57daa674
Rename UhkModulePhase_SendTestLedCommand to UhkModulePhase_SetTestLed
László Monda
2017-09-22 02:59:12 +02:00
2e33a83e29
Rename UhkModulePhase_SendPwmBrightnessCommand to UhkModulePhase_SetLedPwmBrightness
László Monda
2017-09-22 02:55:00 +02:00
43c07dde21
Rename UhkModulePhase_SendKeystatesRequestCommand to UhkModulePhase_RequestKeyStates
László Monda
2017-09-22 02:51:01 +02:00
ac138d2da6
Rename SlaveCommand_GetKeyStates to SlaveCommand_RequestKeyStates
László Monda
2017-09-22 02:47:05 +02:00
2227508130
Use __WFI() instead of asm("wfi") for better readability.
László Monda
2017-09-22 02:19:16 +02:00
962705a017
Remove DisableKeyMatrixScanState
László Monda
2017-09-22 02:13:53 +02:00
92647b36a9
Move DEFINE_BOOTLOADER_CONFIG_AREA(I2C_ADDRESS_LEFT_KEYBOARD_HALF_BOOTLOADER) from bootloader_config.c to main.c and delete bootloader_config.c
László Monda
2017-09-22 02:02:23 +02:00
d210f46983
Update guard macro name.
László Monda
2017-09-22 02:00:40 +02:00
dbada9dd5d
Extract DEFINE_BOOTLOADER_CONFIG_AREA()
László Monda
2017-09-22 02:00:00 +02:00
50207a288d
Add CLOCK_FLAG_HIGH_SPEED_MODE and negate .clockDivider value according to the spec, so that the actual value is easier to read.
László Monda
2017-09-22 01:52:44 +02:00
444e9d58d0
Rename ENABLE_PERIPHERAL_* macros to EnabledBootloaderPeripherial_* enums.
László Monda
2017-09-22 01:31:03 +02:00
4e665b5701
Rename JumpToKboot() to JumpToBootloader()
László Monda
2017-09-22 01:25:20 +02:00
ccc93f48cc
Extract BOOTLOADER_TIMEOUT_MS and set it to 100 ms.
László Monda
2017-09-22 01:22:03 +02:00
228bebcd59
Rename kboot.[ch] to bootloader.[ch] to improve clarity.
László Monda
2017-09-22 01:20:00 +02:00
5dd3b8e0be
Handle SlaveCommand_JumpToBootloader
László Monda
2017-09-22 01:17:58 +02:00
cc3208a947
Add BOOTLOADER_TAG
László Monda
2017-09-22 01:17:41 +02:00
e7362a057c
Rename bootloader.c to bootloader_config.c
László Monda
2017-09-22 01:14:14 +02:00
97ee339827
Don't reference bootloader.h anymore because it has been removed.
László Monda
2017-09-22 01:13:07 +02:00
11d9e85cb7
Move kboot related code to shared/kboot.[ch] because it'll be reused by the firmwares of the add-ons.
László Monda
2017-09-22 01:10:29 +02:00
36be965db9
Use I2C_ADDRESS_LEFT_KEYBOARD_HALF_BOOTLOADER and remove redundant comments.
László Monda
2017-09-22 00:56:48 +02:00
8924c36cb3
Implement I2C watchdog for the left half. Disable the watchdog because it causes a hard fault. Don't update the test LED inside of SlaveCommand_SetTestLed due to testing purposes until the watchdog issue gets resolved.
László Monda
2017-09-21 23:40:49 +02:00
e7330f5d61
Extend the description of the I2C address allocation strategy.
László Monda
2017-09-20 13:24:39 +02:00
02ae123acc
Rename IS_IS31FL3731_I2C_ADDRESS macro to IS_I2C_ADDRESS_IS31FL3731
László Monda
2017-09-20 13:17:36 +02:00
2086138d9c
Use hex address for EEPROM.
László Monda
2017-09-20 13:16:07 +02:00
5c8138f123
Be more specific by using IC names instead of generic names like LED driver or touchpad.
László Monda
2017-09-20 13:13:57 +02:00
4d5214fdc9
Add I2C addresses for add-ons and touchpad modules.
László Monda
2017-09-20 02:21:39 +02:00
d7b3aee50e
Elaborate on the UHK I2C address allocation strategy. Use hex numbers instead of binary for I2C addresses.
László Monda
2017-09-19 16:52:58 +02:00
57e6a6c067
Link Adafrut I2C address list. Feature the EEPROM separately as it's not on the main bus, so its address won't clash with other addresses.
László Monda
2017-09-19 16:00:11 +02:00
e3d407e14d
Assign the I2C and USB interrupts a lower interrupt priority than the PIT interrupt. This should make the I2C watchdog always recover within the PIT interrupt.
László Monda
2017-09-18 04:05:41 +02:00
2f90e40c92
Set chip type, so that EmbSys Register View can show the content of MCU-specific registers in debug mode.
László Monda
2017-09-14 10:44:31 +02:00
aea07f8605
Merge branch 'master' of github.com:UltimateHackingKeyboard/firmware
László Monda
2017-09-14 09:58:36 +02:00
e6b5b3b3a5
Read the hardware configuration area and the user configuration area of the EEPROM into the RAM and try to apply it.
László Monda
2017-09-14 09:55:29 +02:00
399847510e
added configuration and launch configuration to debug the right half keyboard without the need for the bootloader
Erich Styger
2017-09-06 16:09:22 +02:00
6190c4d67b
Rename slaveCallback to masterCallback.
László Monda
2017-08-20 17:30:55 +02:00
caf630204d
Update watchdog function comment and timeout comment.
László Monda
2017-08-20 16:43:58 +02:00
894172bd50
Reduce I2C watchdog interval from 1000 ms to 100 ms.
László Monda
2017-08-20 16:32:02 +02:00
f36c3f24e8
Reduce left bootloader timeout from 3000 to 300 ms.
László Monda
2017-08-20 16:25:53 +02:00
cc1ba715bc
Regarding isTransferScheduled check for != kStatus_Uhk_IdleSlave which restores I2C fairly reliably upon disconnect instead of == kStatus_Success which for some reason doesn't.
László Monda
2017-08-20 03:36:08 +02:00
73239cd4f1
Rename bridgeProtocolCallback to slaveCallback.
László Monda
2017-08-19 18:12:42 +02:00
121299da29
Explicitly reinitialize previousSlaveId, currentSlaveId, Slaves[].isConnected in InitSlaveScheduler() but don't call Slaves[].init() because it'll be called by bridgeProtocolCallback() upon initialization.
László Monda
2017-08-19 18:07:34 +02:00
946d3c1451
Add kStatus_Uhk_IdleSlave and ditch the global IsI2cTransferScheduled. Make slave drivers return status_t and utilize that value instead.
László Monda
2017-08-19 17:47:56 +02:00
430c02f0ed
Remove test actions and related code.
László Monda
2017-08-19 13:32:02 +02:00
a954c63f62
Rename LedDriverPhase_Initialized to LedDriverPhase_UpdateChangedLedValues
László Monda
2017-08-19 13:07:21 +02:00
67a402ed59
Make I2cAsync{Read,Write} return with status_t
László Monda
2017-08-19 13:03:41 +02:00
d22cb079b4
Rename Slave .initializer to .init and .updater to .update
László Monda
2017-08-19 13:00:17 +02:00
992fea28ad
Split LED_DRIVER_STRESS_TEST as I2C_WATCHDOG and LED_DRIVER_FORCE_UPDATE
László Monda
2017-08-19 12:31:49 +02:00
58f36cf6c3
Add I2C_WatchdogOuterCounter, I2C_WatchdogInnerCounter, BridgeCounter and expose them via USB getDebugInfo()
László Monda
2017-08-19 12:12:49 +02:00
35102918b2
Only set IsI2cTransferScheduled to true if the previous I2C operation returned with kStatus_Success
László Monda
2017-08-19 12:09:08 +02:00
0751d4075a
Uncomment microseconds_init() for the time being because it interferes with the PIT channel of the watchdog.
László Monda
2017-08-19 12:07:20 +02:00
f7bc6a8f82
Don't memcpy source LED values to target values when LED_DRIVER_STRESS_TEST is set because it's redundant.
László Monda
2017-08-19 11:58:39 +02:00
024c2d5cff
Merge branch 'master' into macro-engine
László Monda
2017-08-11 10:05:32 +02:00
324f9cdadc
Zero all of the macro reports when starting to play a macro
Eric Tang
2017-08-10 23:58:24 -07:00
fa0200b5a9
Fix some guard clauses
Eric Tang
2017-08-10 22:10:08 -07:00
ce84ac3e14
Implement part of the macro engine
Eric Tang
2017-08-10 15:09:20 -07:00
529219ee99
Init microseconds PIT counter. Can see ticks, but cannot convert them down to microseconds and milliseconds yet.
László Monda
2017-08-10 23:45:36 +02:00
04e3532961
Remove unneeded comments.
László Monda
2017-08-10 19:09:57 +02:00
58f17ba344
Remove microseconds_sysclk.c because we'll use the PIT instead for maintaining time.
László Monda
2017-08-10 18:04:09 +02:00
f56290aa62
Branch based on LED_DRIVER_STRESS_TEST in is31fl3731_driver.c
László Monda
2017-08-10 15:42:02 +02:00