|
|
@ -208,7 +208,18 @@ int32_t OpticalModule::adjust_detector_gain() { |
|
|
|
} |
|
|
|
|
|
|
|
int32_t OpticalModule::module_xxx_reg(int32_t param_id, bool read, int32_t& val) { |
|
|
|
if (param_id == kreg_opt_module_do_action0 && !read) { |
|
|
|
return do_action(val); |
|
|
|
} |
|
|
|
|
|
|
|
switch (param_id) { |
|
|
|
PROCESS_REG(kreg_opt_module_do_action0, ACTION_NONE, REG_SET(module_do_action0)); |
|
|
|
PROCESS_REG(kreg_opt_module_action_param1, ACTION_NONE, REG_SET(module_action_param1)); |
|
|
|
PROCESS_REG(kreg_opt_module_action_param2, ACTION_NONE, REG_SET(module_action_param2)); |
|
|
|
PROCESS_REG(kreg_opt_module_action_param3, ACTION_NONE, REG_SET(module_action_param3)); |
|
|
|
PROCESS_REG(kreg_opt_module_action_ack1, REG_GET(module_action_ack1), ACTION_NONE); |
|
|
|
PROCESS_REG(kreg_opt_module_action_ack2, REG_GET(module_action_ack2), ACTION_NONE); |
|
|
|
|
|
|
|
PROCESS_REG(kreg_boditech_optical_module_raw_sector_size, raw_get_sector_size(&val), ACTION_NONE); |
|
|
|
PROCESS_REG(kreg_boditech_optical_module_raw_sector_num, raw_get_sector_num(&val), ACTION_NONE); |
|
|
|
PROCESS_REG(kreg_boditech_optical_scan_type, REG_GET(m_reg.scan_type), REG_SET(m_reg.scan_type)); |
|
|
@ -242,14 +253,14 @@ int32_t OpticalModule::do_action(int32_t action) { |
|
|
|
} else if (action == ACTION_CLOSE_LASER) { |
|
|
|
return a8000_optical_close_laser(m_reg.scan_type); |
|
|
|
} else if (action == ACTION_READ_SCAN_ADC) { |
|
|
|
// int32_t ret = a8000_optical_read_scanner_adc_val(m_reg.scan_type, &m_com_reg.module_action_ack1);
|
|
|
|
// return ret;
|
|
|
|
int32_t ret = a8000_optical_read_scanner_adc_val(m_reg.scan_type, &module_action_ack1); |
|
|
|
return ret; |
|
|
|
return err::kparam_out_of_range; |
|
|
|
} else if (action == ACTION_READ_LASTER_ADC) { |
|
|
|
// return a8000_optical_read_laster_adc_val(m_reg.scan_type, &m_com_reg.module_action_ack1);
|
|
|
|
return a8000_optical_read_laster_adc_val(m_reg.scan_type, &module_action_ack1); |
|
|
|
return err::kparam_out_of_range; |
|
|
|
} else if (action == ACTION_READ_ONE_POINT) { |
|
|
|
// return a8000_optical_scan_current_point_amp_adc_val(m_reg.scan_type, m_com_reg.module_action_param1, m_com_reg.module_action_param2, &m_com_reg.module_action_ack1, &m_com_reg.module_action_ack2);
|
|
|
|
return a8000_optical_scan_current_point_amp_adc_val(m_reg.scan_type, module_action_param1, module_action_param2, &module_action_ack1, &module_action_ack2); |
|
|
|
return err::kparam_out_of_range; |
|
|
|
} else if (action == ACTION_SET_LASTER_GAIN) { |
|
|
|
return a8000_optical_set_laster_gain(m_reg.scan_type, m_reg.laster_gain); |
|
|
@ -282,8 +293,8 @@ int32_t OpticalModule::a8000_optical_start_capture() { |
|
|
|
} |
|
|
|
return 0; |
|
|
|
} |
|
|
|
// virtual int32_t a8000_optical_start_capture();
|
|
|
|
// virtual int32_t a8000_optical_read_raw(int32_t index, uint8_t* data, int32_t* len);
|
|
|
|
// virtual int32_t a8000_optical_start_capture();
|
|
|
|
// virtual int32_t a8000_optical_read_raw(int32_t index, uint8_t* data, int32_t* len);
|
|
|
|
|
|
|
|
int32_t OpticalModule::start_t_optical_scan() { |
|
|
|
m_thread.stop(); |
|
|
|