Eric Tang
0155447c6a
Rename InitTestLed to TestLed_Init
2018-06-26 18:37:49 -07: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
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
b97841fdae
Delete I2C_WATCHDOG and always enable the watchdog.
2018-04-28 15:04:56 +02:00
Kristian Sloth Lauszus
e12e219b4e
Various fixes and improvements ( #96 )
...
* Global variables shared between an interrupt and the main code should be volatile
See: https://www.embedded.com/electronics-blogs/beginner-s-corner/4023801/Introduction-to-the-Volatile-Keyword
* There is no reason to change the active report if it has not changed
* Declare local functions and variables static
This both helps the compiler and the programmer
2018-03-11 19:19:15 +01:00
László Monda
f5716bdadc
Rename some private functions in init_peripherals.c from upper to lower camel case.
2018-01-14 20:30:46 +01:00
László Monda
b76b3c0e4f
Slow down main bus I2C baud rate to 30kHz when BusPal is on to make firmware transfer more robust.
2018-01-14 20:27:17 +01:00
László Monda
c854e98d84
Implement DevicePropertyId_I2cMainBusBaudRate
2018-01-14 18:10:04 +01:00
László Monda
4d83bc2e75
Add I2cMainBusBaudRateBps
2018-01-13 03:29:01 +01:00
László Monda
cf7b05ab72
Make InitI2cMainBus() private.
2018-01-13 03:21:12 +01:00
László Monda
055f1945d0
Include slave_scheduler.h from init_peripherals.c instead of i2c_watchdog.c which I forgot to do in the previous commit.
2018-01-13 03:19:24 +01:00
László Monda
fa4a3abf84
Extract ReinitI2cMainBus()
2018-01-13 03:14:42 +01:00
László Monda
96c7ccd758
Remove some dead code from PIT_I2C_WATCHDOG_HANDLER
2018-01-13 03:03:42 +01:00
László Monda
712b87182a
Double timer interval that wasn't right for an unknown reason. Adjust mouse kinetic values accordingly. Reprioritize interrupts to make mouse pointer movement as smooth as possible.
2017-11-28 18:52:39 +01:00
László Monda
46126e1e78
Tweak kinetic mouse values further. Temporarily maximize / minimize the acceleratedSpeed / deceleratedSpeed values for testing purposes.
2017-11-28 17:25:46 +01:00
László Monda
a0afdcf476
Implement key debouncer.
2017-11-14 22:54:53 +01:00
László Monda
332f2a69fa
Set up the timer properly and introduce CurrentTime.
2017-11-12 17:33:23 +01:00
László Monda
a91f945591
Add timer.[ch]
2017-11-12 04:48:06 +01:00
László Monda
00dfd96d55
Instead of scanning the keyboard matrix from the main loop and utilizing busy loops, try to use a PIT interrupt handler to do the same thing, scanning one row per interrupt call without busy loops.
...
For some reason, this makes the movement of the mouse pointer very slow and makes it jump from time to time, so I ended up adding INTERRUPT_KEY_SCANNER and disabling the timer interrupt.
Also double bufferred the mouse report just like the others. Unfortunately this does not affect this issue.
2017-11-02 01:11:41 +01:00
László Monda
efb0f982d2
Only try to recover I2C if SDA is low.
2017-10-04 01:22:22 +02:00
László Monda
2027940b4c
Use the correct I2C_MAIN_BUS_{SDA,SCL}{PORT,PIN} macros at the right spots.
2017-10-04 01:04:56 +02:00
László Monda
e5595bc757
Extract I2C recovery code to recoverI2c()
2017-10-03 23:59:27 +02:00
László Monda
72812724ef
Now do send a STOP condition at the end of the I2C recovery which might make it more robust.
2017-10-03 23:37:16 +02:00
László Monda
1daf43b751
Set SDA as GPIO upon trying to recovering I2C, not just SDL.
2017-10-03 23:23:26 +02:00
László Monda
2804d3e447
Don't cycle SDA just before initialzing I2C. Merely pull it high to generate a STOP condition.
2017-10-03 22:05:42 +02:00
László Monda
ff1d5dffaa
Cycle through the I2C clock by using 20 cycles instead of 16. Should be a bit more reliable, although I can't see a definite improvement.
2017-10-03 21:56:08 +02:00
László Monda
5de396bb68
Don't mess around with SDA and SCL before cycling through the clock because it seems redundant.
2017-10-03 21:37:35 +02:00
László Monda
7af8042c93
Fine tune delay to match the I2C peripheral driven at 100kHz.
2017-10-03 21:06:04 +02:00
László Monda
51a9acbb68
Extract delay() from InitI2cMainBus()
2017-10-03 20:54:05 +02:00
László Monda
f1a8d9a330
Toggle SCL from a loop.
2017-10-03 20:49:54 +02:00
László Monda
b5f1bcc4d6
Split InitI2c() as InitI2cMainBus() and initI2cEepromBus() and invoke InitI2cMainBus() from PIT_I2C_WATCHDOG_HANDLER()
2017-10-03 20:43:26 +02:00
László Monda
b49cb30070
Try to resurrect I2C not only in the watchdog but upon initialization. This may be useful when only the right half reboots after a firmware upgrade.
2017-09-30 22:17:44 +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
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.
2017-09-18 04:05:41 +02:00
László Monda
992fea28ad
Split LED_DRIVER_STRESS_TEST as I2C_WATCHDOG and LED_DRIVER_FORCE_UPDATE
2017-08-19 12:31:49 +02:00
László Monda
0751d4075a
Uncomment microseconds_init() for the time being because it interferes with the PIT channel of the watchdog.
2017-08-19 12:07:20 +02:00
László Monda
529219ee99
Init microseconds PIT counter. Can see ticks, but cannot convert them down to microseconds and milliseconds yet.
2017-08-10 23:45:36 +02:00
László Monda
68e2dab576
Add config.h and move LED_DRIVER_STRESS_TEST and FIXED_BUSPAL_BOOTLOADER to it.
2017-08-06 17:28:32 +02:00
László Monda
7b1f9dc2b7
Remove unused variables.
2017-08-03 00:54:41 +02:00
László Monda
546ca5d0b2
Implement much more efficient LED driver updater algorithm that only talks to the LED driver ICs when necessary. Add LED_DRIVER_STRESS_TEST macro.
2017-07-31 17:30:33 +02:00
László Monda
8ed4a6ba09
Separate the configuration to hardware configuration and user configuration. Implement async I2C EEPROM handling. Remove USB functions that dealt with EEPROM and individual LEDs because they were dependent on sync I2C functions.
2017-07-22 23:49:47 +02:00
László Monda
64668e953f
Remove commented out line.
2017-07-15 18:36:16 +02:00
László Monda
5d39c725f9
Make the serialized buffer fixed-size.
2017-07-15 11:18:22 +02:00
Eric Tang
9a5e146866
Rename InitPeripherials to InitPeripherals
2017-07-12 20:06:11 -07:00
Eric Tang
595ced9902
Treat the LED driver as a peripheral with a driver
2017-07-12 20:03:50 -07:00
László Monda
40498a15b9
Fix typo by renaming init_peripherials.[ch] to init_peripherals.[ch]
2017-05-23 03:19:24 +02:00