andrivet / ADVi3pp

ADVi3++, an alternative and better firmware for Wanhao i3 Plus printers and clones. Fork of Marlin Firmware.
https://community.advi3pp.com
GNU General Public License v3.0
243 stars 118 forks source link

[FR] Add the LCD model in the About screen #63

Closed andrivet closed 6 years ago

andrivet commented 6 years ago

Since today, there at least two different models of the LCD screen for this printer, detect and report the model number (can help in case of a bug specific to a model).

SureshotM6 commented 6 years ago

R0 on my DMT48270M043_02WT contains 0x00. Unfortunately, it is very likely that is not valid since that overlaps with a different LCD model in the manual. Could you see what your _05W returns, as it is not listed in the manual either? I added this code at the end of get_lcd_firmware_version(), which I can submit a pull request for if you get something other than 0x00:

String PrinterImpl::get_lcd_firmware_version()
{
    ...

    frame = ReadRegisterDataRequest(Register::R0, 1);
    frame.send();

    if(!response.receive(frame))
    {
        Log::error() << F("Receiving Frame (R0)") << Log::endl();
        return lcd_version;
    }

    response >> version;
    lcd_version << " " << hex_byte(version.byte);

    return lcd_version;
}

The code definitely works, as I am able to read other registers such as R1 as the correct values.

andrivet commented 6 years ago

Already made the test. Returns also 0

andrivet commented 6 years ago

In fact, R0 does not give the model number. It is the "screen mode" and is probably always zero. These screens are not DGUS but Mini DGUS and there are some differences.