diff --git a/backend/genesys.cc b/backend/genesys.cc index a49bdbf89..ba334c359 100644 --- a/backend/genesys.cc +++ b/backend/genesys.cc @@ -4678,7 +4678,7 @@ probe_genesys_devices (void) of Genesys_Calibration_Cache as is. */ static const char* CALIBRATION_IDENT = "sane_genesys"; -static const int CALIBRATION_VERSION = 9; +static const int CALIBRATION_VERSION = 10; bool read_calibration(std::istream& str, Genesys_Device::Calibration& calibration, const std::string& path) diff --git a/backend/genesys_sensor.h b/backend/genesys_sensor.h index ce7ce6f22..d1e41e02b 100644 --- a/backend/genesys_sensor.h +++ b/backend/genesys_sensor.h @@ -98,30 +98,30 @@ struct Genesys_Frontend // id of the frontend description uint8_t fe_id = 0; - // all registers of the frontend - GenesysRegisterSettingSet regs; + // all registers of the frontend. Note that the registers can hold 9-bit values + RegisterSettingSet regs; // extra control registers - std::array reg2 = {}; + std::array reg2 = {}; GenesysFrontendLayout layout; - void set_offset(unsigned which, uint8_t value) + void set_offset(unsigned which, std::uint16_t value) { regs.set_value(layout.offset_addr[which], value); } - void set_gain(unsigned which, uint8_t value) + void set_gain(unsigned which, std::uint16_t value) { regs.set_value(layout.gain_addr[which], value); } - uint8_t get_offset(unsigned which) const + std::uint16_t get_offset(unsigned which) const { return regs.get_value(layout.offset_addr[which]); } - uint8_t get_gain(unsigned which) const + std::uint16_t get_gain(unsigned which) const { return regs.get_value(layout.gain_addr[which]); }