Better documentation for kprintf/stdio
This commit is contained in:
parent
ee6c75d905
commit
e30cc4c3d0
1 changed files with 12 additions and 12 deletions
|
@ -1,22 +1,22 @@
|
|||
#include <uart.h>
|
||||
#include <mini-printf.h>
|
||||
#include <stddef.h>
|
||||
#include <uart.h>
|
||||
|
||||
int stdout_puts(char *s, int len, void *unused) {
|
||||
/** Helper routine to put characters into our uart device */
|
||||
static int stdout_puts(char *s, int len, void *unused) {
|
||||
(void)unused;
|
||||
// Example: UART write loop
|
||||
for (int i = 0; i < len; i++) {
|
||||
uart_putc(s[i]); // <-- your low-level "put char" routine
|
||||
}
|
||||
for (int i = 0; i < len; i++) uart_putc(s[i]);
|
||||
return len;
|
||||
}
|
||||
|
||||
/*
|
||||
* %% - print '%'
|
||||
* %c - character
|
||||
* %s - string
|
||||
* %d, %u - decimal integer
|
||||
* %x, %X - hex integer
|
||||
/**
|
||||
* Printf-like functionality for the kernel.
|
||||
*
|
||||
* %% - print '%',
|
||||
* %c - character,
|
||||
* %s - string,
|
||||
* %d, %u - decimal integer,
|
||||
* %x, %X - hex integer,
|
||||
*/
|
||||
int kprintf(const char *restrict fmt, ...) {
|
||||
va_list ap;
|
||||
|
|
Loading…
Add table
Reference in a new issue