Lazuli
Functions
printf.h File Reference

Internal functions needed for printf(). More...

#include <stdint.h>
#include <Lazuli/common.h>

Go to the source code of this file.

Functions

uint8_t Printf_ConvertU16ToDecimal (uint16_t i, char buffer[])
 Convert an unsigned 16-bit integer to its ASCII decimal representation. More...
 

Detailed Description

Internal functions needed for printf().

This file defines internal functions used by printf().

Definition in file printf.h.

Function Documentation

◆ Printf_ConvertU16ToDecimal()

uint8_t Printf_ConvertU16ToDecimal ( uint16_t  i,
char  buffer[] 
)

Convert an unsigned 16-bit integer to its ASCII decimal representation.

Warning
The conversion is put in the buffer buffer in reverse order and without a final NUL character. The caller of this function then has to use the return value in order to use the characters in the buffer in the right order.

This function will always succeed.

Parameters
iThe 16-bit input value to convert.
bufferA valid pointer to an allocated string of minimum size 5 bytes.
Returns
The number of characters actually written to the buffer.