mirror of
https://github.com/openharmony/drivers_framework.git
synced 2026-07-20 19:27:49 -04:00
!627 fix: change the logic of the test case to be compatible with reference counting.
Merge pull request !627 from 王亚枫/i2c_test
This commit is contained in:
@@ -329,22 +329,23 @@ int32_t I2cTestPeformance(void)
|
||||
uint64_t endMs;
|
||||
uint64_t useTime; /*ms*/
|
||||
struct I2cTester *tester = NULL;
|
||||
DevHandle handle = NULL;
|
||||
|
||||
tester = I2cTesterGet();
|
||||
if (tester == NULL || tester->handle == NULL) {
|
||||
HDF_LOGE("%s:get tester fail", __func__);
|
||||
return HDF_ERR_INVALID_OBJECT;
|
||||
}
|
||||
tester->handle = NULL;
|
||||
|
||||
startMs = OsalGetSysTimeMs();
|
||||
tester->handle = I2cOpen(tester->config.busNum);
|
||||
handle = I2cOpen(tester->config.busNum);
|
||||
endMs = OsalGetSysTimeMs();
|
||||
|
||||
if (tester->handle != NULL) {
|
||||
if (handle != NULL) {
|
||||
useTime = endMs - startMs;
|
||||
HDF_LOGI("----->interface performance test:[start:%lld(ms) - end:%lld(ms) = %lld (ms)] < 1ms[%d]\r\n",
|
||||
startMs, endMs, useTime, useTime < 1 ? true : false );
|
||||
I2cClose(handle);
|
||||
return HDF_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user