Lines Matching refs:avail
179 int index, avail = -1, i = 0, j = 0; in buzzer_create() local
190 if (avail < 0 && !inst[index].obj) { in buzzer_create()
191 avail = index; in buzzer_create()
195 if (avail < 0) { in buzzer_create()
202 (void)memset(&buzzer_data[avail], 0, sizeof(buzzer_data[avail])); in buzzer_create()
203 k_work_init_delayable(&buzzer_data[avail].buzzer_work, buzzer_work_cb); in buzzer_create()
204 buzzer_data[avail].level = 50; /* 50% */ in buzzer_create()
205 buzzer_data[avail].delay_duration = 1; /* 1 seconds */ in buzzer_create()
206 buzzer_data[avail].obj_inst_id = obj_inst_id; in buzzer_create()
208 (void)memset(res[avail], 0, in buzzer_create()
209 sizeof(res[avail][0]) * ARRAY_SIZE(res[avail])); in buzzer_create()
210 init_res_instance(res_inst[avail], ARRAY_SIZE(res_inst[avail])); in buzzer_create()
213 INIT_OBJ_RES(ON_OFF_RID, res[avail], i, res_inst[avail], j, 1, false, in buzzer_create()
214 true, &buzzer_data[avail].onoff, in buzzer_create()
215 sizeof(buzzer_data[avail].onoff), in buzzer_create()
217 INIT_OBJ_RES_DATA(LEVEL_RID, res[avail], i, res_inst[avail], j, in buzzer_create()
218 &buzzer_data[avail].level, in buzzer_create()
219 sizeof(buzzer_data[avail].level)); in buzzer_create()
220 INIT_OBJ_RES_DATA(DELAY_DURATION_RID, res[avail], i, res_inst[avail], j, in buzzer_create()
221 &buzzer_data[avail].delay_duration, in buzzer_create()
222 sizeof(buzzer_data[avail].delay_duration)); in buzzer_create()
223 INIT_OBJ_RES_DATA(MINIMUM_OFF_TIME_RID, res[avail], i, res_inst[avail], in buzzer_create()
224 j, &buzzer_data[avail].min_off_time, in buzzer_create()
225 sizeof(buzzer_data[avail].min_off_time)); in buzzer_create()
226 INIT_OBJ_RES_OPTDATA(APPLICATION_TYPE_RID, res[avail], i, in buzzer_create()
227 res_inst[avail], j); in buzzer_create()
228 INIT_OBJ_RES_DATA(DIGITAL_INPUT_STATE_RID, res[avail], i, in buzzer_create()
229 res_inst[avail], j, &buzzer_data[avail].active, in buzzer_create()
230 sizeof(buzzer_data[avail].active)); in buzzer_create()
232 INIT_OBJ_RES_OPTDATA(TIMESTAMP_RID, res[avail], i, res_inst[avail], j); in buzzer_create()
233 INIT_OBJ_RES_OPTDATA(FRACTIONAL_TIMESTAMP_RID, res[avail], i, in buzzer_create()
234 res_inst[avail], j); in buzzer_create()
238 inst[avail].resources = res[avail]; in buzzer_create()
239 inst[avail].resource_count = i; in buzzer_create()
243 return &inst[avail]; in buzzer_create()