From de8886488ce5504c17147ae84cf9e1810e509ac3 Mon Sep 17 00:00:00 2001 From: YunHorn Technology Date: Wed, 29 May 2024 12:45:30 +0800 Subject: [PATCH] refine sensor detection logic --- STM32CubeIDE/Release/STS_RR_R125.bin | Bin 86584 -> 86584 bytes STM32CubeIDE/Release/STS_RR_R125.hex | 522 +++++++++++++-------------- TOF/App/X-WL55_WLE5_53L0X.h | 4 +- TOF/App/app_tof_vl53l0x_range.c | 22 +- 4 files changed, 273 insertions(+), 275 deletions(-) diff --git a/STM32CubeIDE/Release/STS_RR_R125.bin b/STM32CubeIDE/Release/STS_RR_R125.bin index 649ba291af5d5dee797d28bdf0e74a62308e761e..fac7594848249e070129a006dfbb897a1ce4036a 100644 GIT binary patch delta 2648 zcmYjSeNa@_6~E{0u6>)ZvbehgTio~vAdrQ?3JGMQ0p(+X#R3fuI>7;^n-N5(ki;2i z%?PQP)Z`E9+_YDlI7udU+DIYdlP)Wgm0DXFA7#g`p5aW z=lsssz4zVMeO%LhTyruf3##PYtZ=~@l_y9`{*I-e$9+SF8se6-00gYvOoeUfZW z)DubN7_3)0B5NY|s5&F;^>!oL^tAMZK@-$!Ph8S*tx6=)EEXN1o7=1~Lie^+YV>GN zq~5mI!xRly;E1THw-e8Z{L){44N71c29AVcx3sstT+2%i!DcJwZfnDQF|&9R0DgE{d->b^t8{ z9YmZsMZ^Zwd5-=$B4*JyPaOaw9X)l)yi%CYR)R53ly4##X}?^jcyXRaKF>k)f@6D7 zr&~`)!a-VlnrgXy4@T5bO_x2a8CTp=gS7255s%0_yRwC_6%z+KH-XqJce=ts!_hVL za(A*OKAcEC3T}hRw-!&N(9oDYt5zB6m;84;#B+rvxRW8C?r=wId=f{txYNN$-ENnT zN8ZZ=k;fgR@1BW+h|qAXqN==f6Oii)U%xG_d9@wOq_x z&QyJImzLXkv+>k>(W=<5Q0O;+Pd4?dR7reHr2#C&w}y|t2jK^i`1YN}bt1N!h14kL ze*1$OVyMM?UKz4X9`$Cbo|GqQ0@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0!ead9oOcitr{ms z021+P>6m{%;z|N`{JM?>5|MiXImj0RDaaFo@yJVpn~~QC)651d-kmP3V{hHc+`bi( z9peRA>Lp$Sbp@;AxECCBUMBb=p{`MNZPIZs+OeKNu}!1^WYT?;UQ;Fl2mlB;LX6rH z@n%xnR5bcard~$=m#IqR%Tr$>zw+Hp*}EPJ*z`KcfC6`11S|qBE$iV93VkHR zqDYQ}auh9*uo=Y(G@1&q5P!LaqzJFMW^WBYivl*FBHR;^a0_6FU5UbgAvPTa4baT? zZh&gB7~`5*?*@1WoUG6YDd=c2t~u~3cSH?w4AOQhNKTZ+?AS&~Ltx)V$Uy-na6q$r zrwR58Q5?tvIPeV8uiclTApmQ3UNB_uHN$IQ;`qPfJ2->8bOs;KkgqTnyn^cEwl%++ z&-^5$2znkj!q-SncZG}_gFPIIgAWADY7d7oCw{fXYSUr-pICww;??lg_uS9+Sm8q$ zXH5xUVn0lPJk)n4KzzvL1wXTG!JYB5eIfDQ7M$D92DV_7pVcQq7K)D(AsYN{Pa>X_ zZX|)o*OC0pm5ko&Y$6$VY}{@BF5?lY-c(oCUAEkk;qjqf;4Rd3IB*r{_S%+ z?(D0o&Q7GmQBj35iw!R7R2BOUun8NqTOLm$l#+O(Qz$iJ8tv2g6|=srkjDPG6_S9k z>8+5ZI2cDevAddr = FinalAddress; /* Check all is OK with the new I2C address and initialize the sensor */ status = VL53L0X_RdWord(pDev, VL53L0X_REG_IDENTIFICATION_MODEL_ID, &Id); - if (status !=0) - { - APP_LOG(TS_OFF, VLEVEL_H, "#i VL53L0X_RdWord fail\r\n"); - break; - } + // if (status !=0) + //{ + // APP_LOG(TS_OFF, VLEVEL_H, "#i VL53L0X_RdWord fail\r\n"); + //break; + //} status = VL53L0X_DataInit(pDev); if( status == 0 ){ pDev->Present = 1; //APP_LOG(TS_OFF, VLEVEL_H, "#%u VL53L0X_SetDeviceAddress to 0x%02x\r\n",i, pDev->I2cDevAddr); - - + nDevPresent++; + nDevMask |= 1 << i; + pDev->Present = 1; + APP_LOG(TS_OFF, VLEVEL_H, "VL53L0X %d Present and initiated to final 0x%2x, Position Mask=0x%02x\r\n", pDev->Id, pDev->I2cDevAddr, nDevMask); } else{ APP_LOG(TS_OFF, VLEVEL_H, "VL53L0X_DataInit %d fail\r\n", Id); break; } - nDevPresent++; - nDevMask |= 1 << i; - pDev->Present = 1; - APP_LOG(TS_OFF, VLEVEL_H, "VL53L0X %d Present and initiated to final 0x%2x, Position Mask=0x%02x\r\n", pDev->Id, pDev->I2cDevAddr, nDevMask); } else { APP_LOG(TS_OFF, VLEVEL_H, "# unknown ID %x\r\n", Id);