Commit Graph

51 Commits

Author SHA1 Message Date
László Monda
85b1a65ea7 Implement KbootCommand_Ping and set set left BOOTLOADER_TIMEOUT_MS back to 100 ms. 2017-10-23 21:33:08 +02:00
László Monda
92ee3b5606 Add KBOOT I2C slave driver, its related USB command, and make the firmware updater script of the left half successfully reset the left half after firmware update. 2017-10-22 02:17:43 +02:00
László Monda
90bad68287 No need to explicitly initialize slaves before starting up the scheduler as the scheduler takes care of them. 2017-10-02 00:03:51 +02:00
László Monda
f921753b63 Call slaveSchedulerCallback() instead of the update callback of the first slave to trigger the slave protocol scheduler. Given that the callback is involved from the start this should result in a more reliable startup state. 2017-10-01 23:54:46 +02:00
László Monda
42e17ca1bf Rename masterCallback to slaveSchedulerCallback. 2017-10-01 03:15:25 +02:00
László Monda
37cf632f2a Reindent Slaves[] because its lines have gotten overly long. 2017-10-01 02:53:42 +02:00
László Monda
3079d527b1 Add uhk_slave_t.disconnect() callback so that upon disconnecting the left keyboard half, the left LED driver IC can be marked as disconnected too, so it'll be reinitialized upon reconnect. This usually didn't happen because LED states are cached so the LED drivers are rarely spoken to. 2017-10-01 02:47:29 +02:00
László Monda
320923b41c Properly update uhk_slave_t.isConnected by introducing isFirstIteration. 2017-10-01 01:39:12 +02:00
László Monda
1889f78b98 Make previousSlaveId and currentSlaveId static. 2017-09-29 00:52:43 +02:00
László Monda
827ad7e08e Rename BridgeCounter to I2cSchedulerCounter and move it to the top of masterCallback. 2017-09-29 00:50:56 +02:00
László Monda
69f3c86185 Rename UhkModuleId_* to UhkModuleDriverId_*. 2017-09-28 23:26:58 +02:00
László Monda
96eeb97a04 Remove commented out code. The scheduler checks previousStatus and acts accordingly, so things should work out fine. 2017-09-28 23:03:40 +02:00
László Monda
5eb82c262a Fix the scheduler by making it maintain previousSlaveId correctly. 2017-09-28 21:44:51 +02:00
László Monda
8136acf63c Add the left add-on and right add-on to the list of slaves to be scheduled. 2017-09-28 21:15:01 +02:00
László Monda
8d57968575 Also commit slave_scheduler.c regarding the kStatus_Uhk_NoOp -> kStatus_Uhk_NoTransfer rename that I forgot to commit. 2017-09-28 03:35:28 +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
5769f66994 Introduce currentSlave when initializing the slaves. 2017-09-27 00:27:14 +02:00
László Monda
8f830f7d9f Make sure that all slaves are initialized upon startup. 2017-09-27 00:22:28 +02:00
László Monda
ef9d9ee9a7 Add kStatus_Uhk_NoOp and make the scheduler handle it. 2017-09-22 14:32:43 +02:00
László Monda
6190c4d67b Rename slaveCallback to masterCallback. 2017-08-20 17:30:55 +02:00
László Monda
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. 2017-08-20 03:36:08 +02:00
László Monda
73239cd4f1 Rename bridgeProtocolCallback to slaveCallback. 2017-08-19 18:12:42 +02:00
László Monda
121299da29 Explicitly reinitialize previousSlaveId, currentSlaveId, Slaves[].isConnected in InitSlaveScheduler() but don't call Slaves[].init() because it'll be called by bridgeProtocolCallback() upon initialization. 2017-08-19 18:07:34 +02:00
László Monda
946d3c1451 Add kStatus_Uhk_IdleSlave and ditch the global IsI2cTransferScheduled. Make slave drivers return status_t and utilize that value instead. 2017-08-19 17:47:56 +02:00
László Monda
430c02f0ed Remove test actions and related code. 2017-08-19 13:32:02 +02:00
László Monda
d22cb079b4 Rename Slave .initializer to .init and .updater to .update 2017-08-19 13:00:17 +02:00
László Monda
58f36cf6c3 Add I2C_WatchdogOuterCounter, I2C_WatchdogInnerCounter, BridgeCounter and expose them via USB getDebugInfo() 2017-08-19 12:12:49 +02:00
László Monda
7a45fd7e6c Add uhk_module_id_t. Use UhkModuleId_LeftKeyboardHalf in the Slaves array. Set UHK_MODULE_MAX_COUNT to 3. 2017-08-09 00:02:44 +02:00
László Monda
c53f3a1c3f Use LedDriverId_* enum values for the Slaves array. 2017-08-08 23:58:24 +02:00
László Monda
f817a5cbb9 Kickstart the slave scheduler with the value of currentSlaveId 2017-08-06 17:53:53 +02:00
László Monda
01baa31241 Rename slave_driver_led_driver.[ch] to is31fl3731_driver.[ch] 2017-08-06 16:09:33 +02:00
László Monda
fef35bf68e Rename slave_driver_uhk_module.[ch] to uhk_module_driver.[ch] 2017-08-06 16:06:40 +02:00
László Monda
7092e1acf9 Update the isConnected status of the correct slaves. 2017-08-03 01:22:45 +02:00
László Monda
f8883e416d Rename slaves to Slaves now that it's extern. 2017-06-01 11:01:49 +02:00
László Monda
0f51700ea9 Keep the slave scheduler going even if a slave driver failed to trigger an I2C callback. 2017-06-01 03:03:20 +02:00
László Monda
420097dddc Keep uhk_slave_t.isConnected updated. 2017-06-01 02:31:04 +02:00
László Monda
7be20e34c2 Reinitialize slaves after reconnecting them. 2017-06-01 01:32:57 +02:00
László Monda
909c6196b2 Add slave driver initializers to the slaves array. 2017-06-01 01:21:04 +02:00
László Monda
abd894e906 Rename bridgeSlave to slave 2017-05-05 02:35:01 +02:00
László Monda
387652faaa Rename uhk_slave_t.moduleId to uhk_slave_t.perDriverId 2017-05-05 02:32:45 +02:00
László Monda
588596662a Rename currentBridgeSlaveId to currentSlaveId 2017-05-05 02:28:34 +02:00
László Monda
32e1b8e17f Rename slave_handler_t to slave_updater_t and uhk_slave_t.slaveHandler to uhk_slave_t.updater 2017-05-05 02:26:48 +02:00
László Monda
bbf937ff07 Fix indentation. 2017-05-05 02:25:06 +02:00
László Monda
58f295638b Rename InitUhkModules() to UhkModuleSlaveDriver_Init() and UhkSlaveUhkModuleHandler() to UhkModuleSlaveDriver_Update() 2017-05-05 02:21:59 +02:00
László Monda
3853adc02c Rename InitLedSlaveDriver() to LedSlaveDriver_Init() and UhkSlaveLedDriverHandler() to LedSlaveDriver_Update() 2017-05-05 02:18:39 +02:00
László Monda
107a771a4c Add slave_driver_initializer_t, slaveDriverInitializers, and initialize slaves in a more organized fashion. 2017-05-05 02:06:13 +02:00
László Monda
5371a3c17f Rename bridgeSlaves to slaves. 2017-05-05 01:25:57 +02:00
László Monda
a13a458683 Rename BridgeSlave*Handler() to UhkSlave*Handler() 2017-05-05 01:16:12 +02:00
László Monda
f9a9ebb1d9 Rename InitBridgeProtocolScheduler() to InitSlaveScheduler() 2017-05-05 01:13:36 +02:00
László Monda
b21cd8b493 Make the slave scheduler always jump to the next slave by disallowing slave drivers to lock the scheduler. 2017-05-05 01:08:39 +02:00