fnDebugDec()

void fnDebugDec(signed long slNumberToConvert, unsigned char ucStyle);

slNumberToConvert is a signed long value to be sent as an ASCII decimal string over the present debug output.
The conversion style is defined by ucStyle, which can be a mixture of following flags:


Examples

fnDebugDec(-125000, (DISPLAY_NEGATIVE));
fnDebugDec(125000, (LEADING_SPACE | WITH_CR_LF));



Resulting string sent to the debug output = "-125000 125000\r\n"

Example of formating time output

extern void fnPrintUpTime(void)
{
    unsigned long ulUpTimeSecs = (uTaskerSystemTick / SEC);
    unsigned long ulUpTime     = ulUpTimeSecs /60/60/24;                 // the up time in days

    fnDebugDec(ulUpTime, 0);
    fnDebugMsg("Days");
    ulUpTimeSecs -= (ulUpTime * 60*60*24);                               // minus the days
    ulUpTime = (ulUpTimeSecs / (60*60));                                 // the UP time in hours
    fnBufferDec(ulUpTime, LEADING_SPACE);
    fnDebugMsg(":");
    ulUpTimeSecs -= (ulUpTime * 60*60);                                  // minus the hours
    ulUpTime = (ulUpTimeSecs / (60));                                    // the UP time in minutes
    fnDebugDec(ulUpTime, LEADING_ZERO);
    fnDebugMsg(":");
    ulUpTimeSecs -= (ulUpTime * 60);                                     // minus the minutes
    fnDebugDec(ulUpTimeSecs, (LEADING_ZERO | WITH_CR_LF));
}

Related functions

fnBufferDec();
fnDebugHex();
fnHexStrHex();
fnDecStrHex();




Please use the µTasker forum to ask specific questions.