void fs_apcallback(UINT32 event_type, UINT32 param) { UINT32 dev_type = MNT_DEV_TYPE(param); UINT32 dev_id = MNT_DEV_ID(param); UINT32 mount_status = MNT_STATUS(param); DM_DEBUG("%s(): (%d, %d), (%d, %d)\n",__FUNCTION__, dev_type, dev_id, event_type, mount_status); switch (event_type) { case MP_FS_MOUNT: if ((mount_status == MNT_MOUNT_OK) || (mount_status == MNT_FAILED)) { dm_update(dev_type, dev_id); } if (mount_status == MNT_MOUNT_OK) { DM_DEBUG("send ap mount msg (%d, %d)\n", dev_type, dev_id); ap_send_msg(CTRL_MSG_SUBTYPE_STATUS_USBMOUNT, DM_MSG_CODE(dev_type, dev_id), FALSE); } break; case MP_FS_UNMOUNT: // if ((mount_status == UNMNT_UNMOUNT_OK) || (mount_status == UNMNT_UNMOUNT)) if (mount_status == UNMNT_UNMOUNT_OK) { dm_update(dev_type, dev_id); DM_DEBUG("send ap unmount msg (%d, %d)\n", dev_type, dev_id); ap_send_msg(CTRL_MSG_SUBTYPE_STATUS_USBUNMOUNT, DM_MSG_CODE(dev_type, dev_id), FALSE); } break; default: break; } }
static e_int32 filter_data(laser_sick_t* ls, scan_data_t * pdata_in) { int didx = 0, tick_idx; scan_data_t * pdata_buf, *pdata; e_assert(ls&&ls->state, E_ERROR_INVALID_HANDLER); if (!(pdata_buf = add_slip_tick(ls, pdata_in))) return E_OK; // DMSG((STDOUT,"ls->slip_idx == %d/%d pdata->h_angle=%f \n", ls->slip_idx+1, ls->width, pdata->h_angle )); if (ls->active_sectors.left) { for (tick_idx = 0, pdata = pdata_buf; tick_idx < ls->interlace_v; tick_idx++, pdata++) { one_slip(ls, tick_idx, pdata, pdata->sector_data_offsets[didx], pdata->num_measurements[didx], 0); } dm_update(ls->writer, ls->slip_idx, 0); didx++; } if (ls->active_sectors.right) { for (tick_idx = 0, pdata = pdata_buf; tick_idx < ls->interlace_v; tick_idx++, pdata++) { one_slip(ls, tick_idx, pdata, pdata->sector_data_offsets[didx], pdata->num_measurements[didx], 1); } dm_update(ls->writer, ls->slip_idx, 1); didx++; } ls->slip_idx++; if (ls->slip_idx >= ls->width) { ls->state = STATE_DONE; DMSG( (STDOUT,"ls_filter_data get enough data,last angle h = %f\n",pdata_buf->h_angle)); } return E_OK; }