Updating AVR abstraction to be compatible with ARM, nearly ready for ARM files

- Very small updates to files, mostly modifying to remove name duplications
This commit is contained in:
Jacob Alexander 2013-01-26 22:30:36 -05:00
parent a31f0e064a
commit 6da1558b78
29 changed files with 64 additions and 36 deletions

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2011 by Jacob Alexander
/* Copyright (C) 2011-2013 by Jacob Alexander
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@ -34,8 +34,17 @@
// USB HID String Output
void usb_debug_putstr( char* s )
{
#if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_) // AVR
while ( *s != '\0' )
usb_debug_putchar( *s++ );
#elif defined(_mk20dx128_) // ARM
// Count characters until NULL character, then send the amount counted
uint32_t count = 0;
while ( s[count] != '\0' )
count++;
usb_serial_write( s, count );
#endif
}
// Multiple string Output
@ -64,6 +73,7 @@ void usb_debug_putstrs( char* first, ... )
// Print a constant string
void _print(const char *s)
{
#if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_) // AVR
char c;
// Acquire the character from flash, and print it, as long as it's not NULL
@ -74,6 +84,9 @@ void _print(const char *s)
usb_debug_putchar('\r');
usb_debug_putchar(c);
}
#elif defined(_mk20dx128_) // ARM
usb_debug_putstr( (char*)s );
#endif
}