@ -621,14 +622,19 @@ int ax5043_autoranging(ax5043_conf_t *conf) {
usleep(10);
usleep(10);
//val = 0;
//val = 0;
/* Wait until the autoranging is complete */
/* Wait until the autoranging is complete */
while((val&BIT(4))!=0){// changed to !=, since https://www.onsemi.com/pub/Collateral/AND9347-D.PDF says BIT(4) RNG START clears when autoranging done
inttimeout=0;
clock_tstart=clock();
while(((val&BIT(4))!=0)&&!timeout){// changed to !=, since https://www.onsemi.com/pub/Collateral/AND9347-D.PDF says BIT(4) RNG START clears when autoranging done