Traumflug / Teacup_Firmware

Firmware for RepRap and other 3D printers
http://forums.reprap.org/read.php?147
GNU General Public License v2.0
312 stars 199 forks source link

sersendf_P %x formatting broken #18

Closed bgamari closed 12 years ago

bgamari commented 13 years ago

The %x formatting specifier is broken, producing unexpected output. This appears to be caused by an attempt to write the string "0x" to before formatting the hexadecimal integer,

    case 'x':
        serial_writestr_P(str_ox);
        if (j == 4)
            serwrite_hex32(va_arg(args, uint32_t));
            ...

Commenting the first serial_writestr_P() line causes things to behave as they should.

Traumflug commented 12 years ago

Instead of removing the 0x string I fixed it: https://github.com/triffid/Teacup_Firmware/commit/f6d3ebf2edbf18733a8c39ff1450e0d4b4f1a531

If it still doesn't work for you, please reopen the issue.