Added code to support getting interrupts from the PIC. Can now get some data from the keyboard, however, it's not quite working yet.

This commit is contained in:
2020-08-06 22:36:39 -05:00
parent db1a68188f
commit 49efafe173
15 changed files with 278 additions and 39 deletions
+35
View File
@@ -119,3 +119,38 @@ int strlen(char* string)
return len;
}
//Code reference:
//http://www.strudel.org.uk/itoa/
char* int_to_string(unsigned int value, int base)
{
static char buf[32] = {0};
//void* ptr = Malloc(32);
//if(ptr == 0)
//{
//puts("Malloc failed to allocate!\n");
//return "";
//}
//char buf = (char*) ptr;
if(value == 0)
{
buf[0] = '0';
//*buf++ = '0';
//return buf;
return &buf[0];
}
int i = 30;
for(; value && i; --i, value /= base)
{
//*buf++ = "0123456789ABCDEF"[value % base];
buf[i] = "0123456789ABCDEF"[value % base];
}
//Free(ptr);
//return buf;
return &buf[i+1];
}