Fixed disk handling

This commit is contained in:
Lucia Ceionia
2023-01-04 19:36:29 -06:00
parent 9aa56cdce2
commit 43e902e83c
7 changed files with 29 additions and 7 deletions

13
print.c
View File

@@ -25,3 +25,16 @@ uintptr_t printStr(char *v, uint16_t *buff) {
*(char*)buff = *s;
return s - v;
}
uintptr_t printDec(uint32_t v, uint16_t *buff) {
char b[12];
char *s = &b[11];
if (!v) {
*(uint16_t*)&b[10] = '0'; // '0',0x00
s = &b[10];
} else {
*s = 0;
for (;v;v/=10) *--s = '0' + v%10;
}
return printStr(s, buff);
}