From 121299da29849563a0dcf16eac91efff3818a15e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Sat, 19 Aug 2017 18:07:34 +0200 Subject: [PATCH] Explicitly reinitialize previousSlaveId, currentSlaveId, Slaves[].isConnected in InitSlaveScheduler() but don't call Slaves[].init() because it'll be called by bridgeProtocolCallback() upon initialization. --- right/src/slave_scheduler.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/right/src/slave_scheduler.c b/right/src/slave_scheduler.c index 0083037..26f5751 100644 --- a/right/src/slave_scheduler.c +++ b/right/src/slave_scheduler.c @@ -7,8 +7,8 @@ #include "i2c.h" #include "i2c_addresses.h" -uint8_t previousSlaveId = 0; -uint8_t currentSlaveId = 0; +uint8_t previousSlaveId; +uint8_t currentSlaveId; uint32_t BridgeCounter; uhk_slave_t Slaves[] = { @@ -48,16 +48,15 @@ static void bridgeProtocolCallback(I2C_Type *base, i2c_master_handle_t *handle, } while (!isTransferScheduled); } -static void initSlaveDrivers() -{ - for (uint8_t i=0; i