Otpvondoiats opened a new pull request, #18180: URL: https://github.com/apache/nuttx/pull/18180
## Summary This patch refactors the sensor driver architecture by removing the redundant uncalibrated flag from the sensor lowerhalf layer structure and standardizing how uncalibrated sensor types are handled. struct sensor_accel → Calibrated accelerometer struct sensor_accel_uncal → Uncalibrated accelerometer struct sensor_gyro → Calibrated gyroscope struct sensor_gyro_uncal → Uncalibrated gyroscope struct sensor_mag → Calibrated magnetometer struct sensor_mag_uncal → Uncalibrated magnetometer ## Impact Users: API Consistency: Sensor type now definitively indicates calibration state No Behavioral Change: Existing applications continue to work as before Clearer Semantics: Type names explicitly indicate calibration status Drivers: Simplified Implementation: Driver developers no longer need to manage separate flag Type Safety: Compiler catches mismatches between sensor type and data structure Less Boilerplate: One less field to initialize and maintain ## Testing ~~~ ap> uorb_listener -n 10 sensor_accel_uncal Mointor objects num:1 object_name:sensor_accel_uncal, object_instance:0 [01/27 03:54:30] [ 0] [audio] CPU USAGE: busy=1 cpu_sleep=0 bus_sleep=0 subsys_sleep=99(pd) sensor_accel_uncal(now:1265382618600):timestamp:407659828155,x:-0.385466,y:-0.205901,z:9.967062,tempe2 sensor_accel_uncal(now:1265382658800):timestamp:407659868455,x:-0.248997,y:-0.107739,z:9.849746,tempe2 sensor_accel_uncal(now:1265382699100):timestamp:407659908855,x:-0.227449,y:-0.169988,z:9.823410,tempe2 sensor_accel_uncal(now:1265382739500):timestamp:407659949155,x:-0.332794,y:-0.210690,z:9.698911,tempe2 sensor_accel_uncal(now:1265382779800):timestamp:407659989455,x:-0.337582,y:-0.160412,z:9.911995,tempe2 sensor_accel_uncal(now:1265382820100):timestamp:407660029855,x:-0.287304,y:-0.090979,z:9.737218,tempe2 sensor_accel_uncal(now:1265382860300):timestamp:407660070155,x:-0.270545,y:-0.105345,z:9.856929,tempe2 sensor_accel_uncal(now:1265382900700):timestamp:407660110555,x:-0.347159,y:-0.086191,z:9.859323,tempe2sensor_accel_uncal(now:1265382941000):timestamp:407660150855,x:-0.330400,y:-0.189142,z:9.821015,tempe2 sensor_accel_uncal(now:1265382981500):timestamp:407660191255,x:-0.323217,y:-0.172383,z:9.782708,tempe2 Object name:sensor_accel_uncal0, recieved:10 Total number of received Message:10/10 ap> uorb_listener -n 10 sensor_accel Mointor objects num:1 object_name:sensor_accel, object_instance:0 sensor_accel(now:1265385846700):timestamp:407662693405,x:-0.107843,y:-0.166623,z:9.818255,temperature:26.994141 sensor_accel(now:1265385847000):timestamp:407662733755,x:-0.138968,y:-0.121133,z:9.861352,temperature:26.994141 sensor_accel(now:1265385848400):timestamp:407662774105,x:-0.203611,y:-0.128316,z:9.794313,temperature:26.994141 sensor_accel(now:1265385849800):timestamp:407662814455,x:-0.098266,y:-0.123527,z:9.899659,temperature:26.994141 sensor_accel(now:1265385851200):timestamp:407662854805,x:-0.177275,y:-0.128316,z:9.858957,temperature:26.994141 sensor_accel(now:1265385852600):timestamp:407662895155,x:-0.146151,y:-0.121133,z:10.124714,temperature:26.994141 sensor_accel(now:1265385854000):timestamp:407662935505,x:-0.141362,y:-0.159441,z:9.703334,temperature:26.994141 sensor_accel(now:1265385855400):timestamp:407662975855,x:-0.165304,y:-0.250420,z:9.892476,temperature:26.994141 sensor_accel(now:1265385856800):timestamp:407663016205,x:-0.215582,y:-0.185777,z:9.858957,temperature:26.994141 sensor_accel(now:1265385858200):timestamp:407663056555,x:-0.126997,y:-0.123527,z:9.866140,temperature:26.994141 Object name:sensor_accel0, recieved:10 Total number of received Message:10/10 ap> uorb_listener -n 10 sensor_mag_uncal Mointor objects num:1 object_name:sensor_mag_uncal, object_instance:0 sensor_mag_uncal(now:1265391627200):timestamp:407668721455,x:504.300018,y:-46.650002,z:-977.550049,temperature:-978.75000 sensor_mag_uncal(now:1265391629100):timestamp:407668741455,x:503.700012,y:-45.300003,z:-978.300049,temperature:-979.50000 sensor_mag_uncal(now:1265391631400):timestamp:407668761455,x:504.450012,y:-46.800003,z:-976.800049,temperature:-978.00000 sensor_mag_uncal(now:1265391633700):timestamp:407668781455,x:504.600006,y:-46.050003,z:-976.950012,temperature:-247.4700 sensor_mag_uncal(now:1265391635900):timestamp:407668801455,x:504.000031,y:-46.350002,z:-978.600037,temperature:-249.0000 sensor_mag_uncal(now:1265391639900):timestamp:407668821455,x:504.150024,y:-47.250000,z:-979.350037,temperature:-249.5100 sensor_mag_uncal(now:1265391663500):timestamp:407668841455,x:504.450012,y:-45.900002,z:-977.700012,temperature:-247.8600 sensor_mag_uncal(now:1265391665300):timestamp:407668861455,x:504.150024,y:-46.500000,z:-979.350037,temperature:-249.4500 sensor_mag_uncal(now:1265391682700):timestamp:407668881455,x:506.400024,y:-46.650002,z:-978.600037,temperature:-248.7000 sensor_mag_uncal(now:1265391704400):timestamp:407668901455,x:505.050018,y:-46.350002,z:-977.550049,temperature:-247.7700 Object name:sensor_mag_uncal0, recieved:10 Total number of received Message:10/10 ap> [01/27 03:54:53] [ 0] [cp] CPU USAGE: busy=1 cpu_sleep=0 bus_sleep=0 subsys_sleep=99(pd) ~~~ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
