Lines Matching refs:index

79 static void update_min_measured(uint16_t obj_inst_id, int index)  in update_min_measured()  argument
81 min_measured_value[index] = sensor_value[index]; in update_min_measured()
85 static void update_max_measured(uint16_t obj_inst_id, int index) in update_max_measured() argument
87 max_measured_value[index] = sensor_value[index]; in update_max_measured()
134 int index, i = 0, j = 0; in pressure_sensor_create() local
137 for (index = 0; index < MAX_INSTANCE_COUNT; index++) { in pressure_sensor_create()
138 if (inst[index].obj && inst[index].obj_inst_id == obj_inst_id) { in pressure_sensor_create()
146 for (index = 0; index < MAX_INSTANCE_COUNT; index++) { in pressure_sensor_create()
147 if (!inst[index].obj) { in pressure_sensor_create()
152 if (index >= MAX_INSTANCE_COUNT) { in pressure_sensor_create()
159 sensor_value[index] = 0; in pressure_sensor_create()
160 units[index][0] = '\0'; in pressure_sensor_create()
161 min_measured_value[index] = INT32_MAX; in pressure_sensor_create()
162 max_measured_value[index] = -INT32_MAX; in pressure_sensor_create()
163 min_range_value[index] = 0; in pressure_sensor_create()
164 max_range_value[index] = 0; in pressure_sensor_create()
166 (void)memset(res[index], 0, in pressure_sensor_create()
167 sizeof(res[index][0]) * ARRAY_SIZE(res[index])); in pressure_sensor_create()
168 init_res_instance(res_inst[index], ARRAY_SIZE(res_inst[index])); in pressure_sensor_create()
171 INIT_OBJ_RES(SENSOR_VALUE_RID, res[index], i, res_inst[index], j, 1, in pressure_sensor_create()
172 false, true, &sensor_value[index], sizeof(*sensor_value), in pressure_sensor_create()
174 INIT_OBJ_RES_DATA_LEN(SENSOR_UNITS_RID, res[index], i, res_inst[index], j, in pressure_sensor_create()
175 units[index], UNIT_STR_MAX_SIZE, 0); in pressure_sensor_create()
176 INIT_OBJ_RES_DATA(MIN_MEASURED_VALUE_RID, res[index], i, in pressure_sensor_create()
177 res_inst[index], j, &min_measured_value[index], in pressure_sensor_create()
179 INIT_OBJ_RES_DATA(MAX_MEASURED_VALUE_RID, res[index], i, in pressure_sensor_create()
180 res_inst[index], j, &max_measured_value[index], in pressure_sensor_create()
182 INIT_OBJ_RES_DATA(MIN_RANGE_VALUE_RID, res[index], i, res_inst[index], in pressure_sensor_create()
183 j, &min_range_value[index], sizeof(*min_range_value)); in pressure_sensor_create()
184 INIT_OBJ_RES_DATA(MAX_RANGE_VALUE_RID, res[index], i, res_inst[index], in pressure_sensor_create()
185 j, &max_range_value[index], sizeof(*max_range_value)); in pressure_sensor_create()
186 INIT_OBJ_RES_EXECUTE(RESET_MIN_MAX_MEASURED_VALUES_RID, res[index], i, in pressure_sensor_create()
188 INIT_OBJ_RES_OPTDATA(CURRENT_CALIBRATION_RID, res[index], i, in pressure_sensor_create()
189 res_inst[index], j); in pressure_sensor_create()
190 INIT_OBJ_RES_OPTDATA(APPLICATION_TYPE_RID, res[index], i, in pressure_sensor_create()
191 res_inst[index], j); in pressure_sensor_create()
193 INIT_OBJ_RES_OPTDATA(TIMESTAMP_RID, res[index], i, res_inst[index], j); in pressure_sensor_create()
194 INIT_OBJ_RES_OPTDATA(FRACTIONAL_TIMESTAMP_RID, res[index], i, in pressure_sensor_create()
195 res_inst[index], j); in pressure_sensor_create()
196 INIT_OBJ_RES_OPTDATA(MEASUREMENT_QUALITY_INDICATOR_RID, res[index], in pressure_sensor_create()
197 i, res_inst[index], j); in pressure_sensor_create()
198 INIT_OBJ_RES_OPTDATA(MEASUREMENT_QUALITY_LEVEL_RID, res[index], i, in pressure_sensor_create()
199 res_inst[index], j); in pressure_sensor_create()
202 inst[index].resources = res[index]; in pressure_sensor_create()
203 inst[index].resource_count = i; in pressure_sensor_create()
206 return &inst[index]; in pressure_sensor_create()