Archived
1
0

Removing unnecessary ifdefs

This commit is contained in:
Jacob Alexander 2014-07-19 09:31:04 -07:00
parent 8eba0ae354
commit 643c7e934a
2 changed files with 9 additions and 23 deletions

View File

@ -116,10 +116,7 @@ inline void Output_send(void)
// Sets the device into firmware reload mode // Sets the device into firmware reload mode
inline void Output_firmwareReload() inline void Output_firmwareReload()
{ {
#if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_)
#elif defined(_mk20dx128_) || defined(_mk20dx128vlf5_) || defined(_mk20dx256_)
uart_device_reload(); uart_device_reload();
#endif
} }
@ -133,10 +130,8 @@ inline unsigned int Output_availablechar()
// USB Get Character from input buffer // USB Get Character from input buffer
inline int Output_getchar() inline int Output_getchar()
{ {
#if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_) // XXX Make sure to check output_availablechar() first! Information is lost with the cast (error codes) (AVR)
#elif defined(_mk20dx128_) || defined(_mk20dx128vlf5_) || defined(_mk20dx256_) return (int)uart_serial_getchar();
return uart_serial_getchar();
#endif
} }
@ -151,6 +146,7 @@ inline int Output_putchar( char c )
inline int Output_putstr( char* str ) inline int Output_putstr( char* str )
{ {
#if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_) // AVR #if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_) // AVR
uint16_t count = 0;
#elif defined(_mk20dx128_) || defined(_mk20dx128vlf5_) || defined(_mk20dx256_) // ARM #elif defined(_mk20dx128_) || defined(_mk20dx128vlf5_) || defined(_mk20dx256_) // ARM
uint32_t count = 0; uint32_t count = 0;
#endif #endif
@ -165,10 +161,7 @@ inline int Output_putstr( char* str )
// Soft Chip Reset // Soft Chip Reset
inline void Output_softReset() inline void Output_softReset()
{ {
#if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_) usb_device_software_reset();
#elif defined(_mk20dx128_) || defined(_mk20dx128vlf5_) || defined(_mk20dx256_)
SOFTWARE_RESET();
#endif
} }

View File

@ -142,10 +142,7 @@ inline void Output_send(void)
// Sets the device into firmware reload mode // Sets the device into firmware reload mode
inline void Output_firmwareReload() inline void Output_firmwareReload()
{ {
#if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_)
#elif defined(_mk20dx128_) || defined(_mk20dx128vlf5_) || defined(_mk20dx256_)
uart_device_reload(); uart_device_reload();
#endif
} }
@ -159,20 +156,18 @@ inline unsigned int Output_availablechar()
// USB Get Character from input buffer // USB Get Character from input buffer
inline int Output_getchar() inline int Output_getchar()
{ {
#if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_) // XXX Make sure to check output_availablechar() first! Information is lost with the cast (error codes) (AVR)
#elif defined(_mk20dx128_) || defined(_mk20dx128vlf5_) || defined(_mk20dx256_)
if ( usb_serial_available() > 0 ) if ( usb_serial_available() > 0 )
{ {
return usb_serial_getchar(); return (int)usb_serial_getchar();
} }
if ( uart_serial_available() > 0 ) if ( uart_serial_available() > 0 )
{ {
return uart_serial_getchar(); return (int)uart_serial_getchar();
} }
return -1; return -1;
#endif
} }
@ -191,6 +186,7 @@ inline int Output_putchar( char c )
inline int Output_putstr( char* str ) inline int Output_putstr( char* str )
{ {
#if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_) // AVR #if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_) // AVR
uint16_t count = 0;
#elif defined(_mk20dx128_) || defined(_mk20dx128vlf5_) || defined(_mk20dx256_) // ARM #elif defined(_mk20dx128_) || defined(_mk20dx128vlf5_) || defined(_mk20dx256_) // ARM
uint32_t count = 0; uint32_t count = 0;
#endif #endif
@ -209,10 +205,7 @@ inline int Output_putstr( char* str )
// Soft Chip Reset // Soft Chip Reset
inline void Output_softReset() inline void Output_softReset()
{ {
#if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_) usb_device_software_reset();
#elif defined(_mk20dx128_) || defined(_mk20dx128vlf5_) || defined(_mk20dx256_)
SOFTWARE_RESET();
#endif
} }