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 <mini-printf.h>
|
||||||
#include <stddef.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;
|
(void)unused;
|
||||||
// Example: UART write loop
|
for (int i = 0; i < len; i++) uart_putc(s[i]);
|
||||||
for (int i = 0; i < len; i++) {
|
|
||||||
uart_putc(s[i]); // <-- your low-level "put char" routine
|
|
||||||
}
|
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* %% - print '%'
|
* Printf-like functionality for the kernel.
|
||||||
* %c - character
|
*
|
||||||
* %s - string
|
* %% - print '%',
|
||||||
* %d, %u - decimal integer
|
* %c - character,
|
||||||
* %x, %X - hex integer
|
* %s - string,
|
||||||
|
* %d, %u - decimal integer,
|
||||||
|
* %x, %X - hex integer,
|
||||||
*/
|
*/
|
||||||
int kprintf(const char *restrict fmt, ...) {
|
int kprintf(const char *restrict fmt, ...) {
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
Loading…
Add table
Reference in a new issue