Commit Graph

126 Commits

Author SHA1 Message Date
László Monda
6edf4113a4 Make the slave check message integrity and only process if it's valid. 2017-10-01 22:05:20 +02:00
László Monda
1b1111e9da Rename I2C_BUFFER_MAX_LENGTH to I2C_MESSAGE_MAX_TOTAL_LENGTH. 2017-10-01 21:55:37 +02:00
László Monda
4ade25d739 Add I2C_MESSAGE_HEADER_LENGTH and use it in i2cSlaveCallback() instead of magic numbers. 2017-10-01 21:42:55 +02:00
László Monda
0ba979a658 Refactor i2cSlaveCallback(). 2017-10-01 21:38:02 +02:00
László Monda
894103a944 Disable the watchdog of the left half because for some reason it makes I2C recovery less reliable. 2017-09-30 20:54:27 +02:00
László Monda
cec8bbfe01 Clone InitI2c() as InitI2cV2() and use it in the LPTMR interrupt handler to avoid the hard fault. 2017-09-30 17:06:17 +02:00
László Monda
3e5767e141 Use KEYBOARD_MATRIX_ROWS_NUM and KEYBOARD_MATRIX_COLS_NUM to compute MODULE_KEY_COUNT. 2017-09-30 01:11:12 +02:00
László Monda
ea71253d6a Remove KEY_STATE_SIZE in favor of the more general BOOL_BYTES_TO_BITS_COUNT() macro. 2017-09-30 00:57:10 +02:00
László Monda
abc1923897 Rename LEFT_KEYBOARD_HALF_KEY_COUNT to MODULE_KEY_COUNT. 2017-09-30 00:47:15 +02:00
László Monda
04047eb128 Make modules send their features (key count and whether they have pointer input) to the master upon enumeration. 2017-09-30 00:08:28 +02:00
László Monda
508ef870ae Rename I2C_Watchdog*Counter to I2cWatchdog_*Counter. 2017-09-29 00:44:22 +02:00
László Monda
9309c1e954 UpperCamelCase rxMessage and txMessage because they're extern variables. 2017-09-28 03:38:44 +02:00
László Monda
d578b7aba8 Remove unused variable DisableKeyMatrixScanState. 2017-09-28 03:24:40 +02:00
László Monda
751810ec4c Explicitly add void to the argument list of zero argument functions. 2017-09-28 03:03:11 +02:00
László Monda
ecf1ad2468 Don't use the extern keyword for functions because it's redundant. 2017-09-28 02:37:55 +02:00
László Monda
145443c65c Fix the computation of KEY_STATE_SIZE and the byte count to memset in BoolBytesToBits() 2017-09-26 20:18:26 +02:00
László Monda
3b3e40af83 Pass i2c_message_t messages not only from the left half to the right, but vice versa. 2017-09-26 04:12:05 +02:00
László Monda
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. 2017-09-25 03:03:14 +02:00
László Monda
ac138d2da6 Rename SlaveCommand_GetKeyStates to SlaveCommand_RequestKeyStates 2017-09-22 02:47:05 +02:00
László Monda
2227508130 Use __WFI() instead of asm("wfi") for better readability. 2017-09-22 02:19:16 +02:00
László Monda
962705a017 Remove DisableKeyMatrixScanState 2017-09-22 02:13:53 +02:00
László Monda
92647b36a9 Move DEFINE_BOOTLOADER_CONFIG_AREA(I2C_ADDRESS_LEFT_KEYBOARD_HALF_BOOTLOADER) from bootloader_config.c to main.c and delete bootloader_config.c 2017-09-22 02:02:23 +02:00
László Monda
dbada9dd5d Extract DEFINE_BOOTLOADER_CONFIG_AREA() 2017-09-22 02:00:00 +02:00
László Monda
50207a288d Add CLOCK_FLAG_HIGH_SPEED_MODE and negate .clockDivider value according to the spec, so that the actual value is easier to read. 2017-09-22 01:52:44 +02:00
László Monda
444e9d58d0 Rename ENABLE_PERIPHERAL_* macros to EnabledBootloaderPeripherial_* enums. 2017-09-22 01:31:03 +02:00
László Monda
4e665b5701 Rename JumpToKboot() to JumpToBootloader() 2017-09-22 01:25:20 +02:00
László Monda
ccc93f48cc Extract BOOTLOADER_TIMEOUT_MS and set it to 100 ms. 2017-09-22 01:22:03 +02:00
László Monda
228bebcd59 Rename kboot.[ch] to bootloader.[ch] to improve clarity. 2017-09-22 01:20:00 +02:00
László Monda
5dd3b8e0be Handle SlaveCommand_JumpToBootloader 2017-09-22 01:17:58 +02:00
László Monda
cc3208a947 Add BOOTLOADER_TAG 2017-09-22 01:17:41 +02:00
László Monda
e7362a057c Rename bootloader.c to bootloader_config.c 2017-09-22 01:14:14 +02:00
László Monda
97ee339827 Don't reference bootloader.h anymore because it has been removed. 2017-09-22 01:13:07 +02:00
László Monda
11d9e85cb7 Move kboot related code to shared/kboot.[ch] because it'll be reused by the firmwares of the add-ons. 2017-09-22 01:10:29 +02:00
László Monda
36be965db9 Use I2C_ADDRESS_LEFT_KEYBOARD_HALF_BOOTLOADER and remove redundant comments. 2017-09-22 00:56:48 +02:00
László Monda
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. 2017-09-21 23:40:49 +02:00
László Monda
4d5214fdc9 Add I2C addresses for add-ons and touchpad modules. 2017-09-20 02:21:39 +02:00
László Monda
f36c3f24e8 Reduce left bootloader timeout from 3000 to 300 ms. 2017-08-20 16:25:53 +02:00
László Monda
8e50712f75 Remove deleted slave protocol command clauses. 2017-08-19 18:29:26 +02:00
László Monda
c1c00f2b3a Replace tabs with spaces. 2017-07-20 00:32:37 +02:00
Erich Styger
ccc02fe795 fixed BusPal Bootloader (https://github.com/UltimateHackingKeyboard/firmware/issues/44) 2017-07-19 17:28:13 +02:00
Erich Styger
3f70b08c9f producing binary file for bootloader 2017-07-19 16:54:02 +02:00
Erich Styger
7c89020ccf disabled SWO (not used) in debug configuration 2017-07-19 16:51:33 +02:00
Eric Tang
9a5e146866 Rename InitPeripherials to InitPeripherals 2017-07-12 20:06:11 -07:00
Erich Styger
c4e0be95a6 ignoring Eclipse generated files 2017-06-24 18:42:30 +02:00
Erich Styger
72904dfca1 fixed project refresh policy setting for all build configurations 2017-06-24 18:38:03 +02:00
Erich Styger
4a3b031c8b updated project settings: enabled parallel build and fixed refresh policy 2017-06-19 17:16:23 +02:00
László Monda
237ef3c34a Rename action.h to key_action.h 2017-06-15 19:27:44 +02:00
László Monda
6e23df41bf Set .peripheralDetectionTimeoutMs to 300 ms. 2017-06-01 03:04:43 +02:00
László Monda
1e290ebc34 Verify the integrity of key state update messages using CRC16-CCITT. 2017-05-31 03:26:50 +02:00
László Monda
57319489d2 Make the left half send only as many bytes of key state information as required. 2017-05-31 02:24:55 +02:00