diff --git a/source/shoh/src/peripherals/Clock.cpp b/source/shoh/src/peripherals/Clock.cpp index 6366182..9a3e764 100644 --- a/source/shoh/src/peripherals/Clock.cpp +++ b/source/shoh/src/peripherals/Clock.cpp @@ -93,7 +93,7 @@ void Clock::updateClock() diff_overflows = (old_overflows <= this->_overflows) //Usually it is new amount of overflows - old. ? (this->_overflows - old_overflows) - //It is possible that overflows counter will overflow. + //It is possible that overflows counter will overflow. (Seems that it causes the timer to get insane count when it works.) : (0xffffffffffffffff - old_overflows + this->_overflows); //First case -> no overflow diff --git a/source/shoh/src/peripherals/I2C.cpp b/source/shoh/src/peripherals/I2C.cpp index 2104c06..5f9c753 100644 --- a/source/shoh/src/peripherals/I2C.cpp +++ b/source/shoh/src/peripherals/I2C.cpp @@ -103,7 +103,7 @@ I2C::transaction (uint8_t devAddr, uint8_t *txBuffPtr, uint16_t txSize, I2CM_XFER_T i2cmXferRec; // make sure that master is idle - while (Chip_I2CM_StateChanged(this->device) == 0); + //while (Chip_I2CM_StateChanged(this->device) == 0); /* Setup I2C transfer record */ i2cmXferRec.slaveAddr = devAddr; diff --git a/source/shoh/src/threads/master/Master.cpp b/source/shoh/src/threads/master/Master.cpp index f70014a..1a562d2 100644 --- a/source/shoh/src/threads/master/Master.cpp +++ b/source/shoh/src/threads/master/Master.cpp @@ -121,19 +121,19 @@ void thread_master(void* pvParams) { LOG_INFO("Master is creating tasks"); manager->tm->createTask(thread_manager, "manager", - configMINIMAL_STACK_SIZE * 14,tskIDLE_PRIORITY + 1UL, + configMINIMAL_STACK_SIZE * 13,tskIDLE_PRIORITY + 1UL, static_cast(manager)); manager->tm->createTask(thread_rotary, "rotary", - configMINIMAL_STACK_SIZE * 9,tskIDLE_PRIORITY + 1UL, + configMINIMAL_STACK_SIZE * 8,tskIDLE_PRIORITY + 1UL, static_cast(manager)); manager->tm->createTask(thread_user_interface, "user_interface", - configMINIMAL_STACK_SIZE * 9,tskIDLE_PRIORITY + 1UL, + configMINIMAL_STACK_SIZE * 8,tskIDLE_PRIORITY + 1UL, static_cast(manager)); manager->tm->createTask(thread_relay, "relay", - configMINIMAL_STACK_SIZE * 9,tskIDLE_PRIORITY + 1UL, + configMINIMAL_STACK_SIZE * 8,tskIDLE_PRIORITY + 1UL, static_cast(manager)); manager->tm->createTask(thread_temperature, "temperature", - configMINIMAL_STACK_SIZE * 9,tskIDLE_PRIORITY + 1UL, + configMINIMAL_STACK_SIZE * 8,tskIDLE_PRIORITY + 1UL, static_cast(manager)); LOG_INFO("Master created tasks"); m.taskFunction(); diff --git a/source/shoh/src/threads/temperature/SensorTempTC74.cpp b/source/shoh/src/threads/temperature/SensorTempTC74.cpp index 6425f39..1817a86 100644 --- a/source/shoh/src/threads/temperature/SensorTempTC74.cpp +++ b/source/shoh/src/threads/temperature/SensorTempTC74.cpp @@ -51,7 +51,7 @@ uint8_t SensorTempTC74::read() if (this->on_standby()) { this->remove_standby(); - vTaskDelay(1); + vTaskDelay(3000); } //if ready and up - read @@ -64,7 +64,7 @@ uint8_t SensorTempTC74::read() LOG_WARNING("Unable to read temperature sensor [%d] value.", this->_dev_addr); //set standy. - this->set_standby(); + //this->set_standby(); return data; } diff --git a/source/shoh/src/threads/temperature/Temperature.cpp b/source/shoh/src/threads/temperature/Temperature.cpp index f5fdd12..210f9d8 100644 --- a/source/shoh/src/threads/temperature/Temperature.cpp +++ b/source/shoh/src/threads/temperature/Temperature.cpp @@ -33,7 +33,7 @@ void Temperature::taskFunction() void thread_temperature(void* pvParams) { ThreadCommon::CommonManagers * manager = static_cast(pvParams); - I2C_config conf{0x4a, 55000}; + I2C_config conf{0x4a, 100000}; I2C i2c(conf); Temperature t(manager->qm, &i2c); t.taskFunction();