Mercurial > louis > kiibohd-controller
changeset 178:555d70c6764d
Removing unnecessary ifdefs
author | Jacob Alexander <haata@kiibohd.com> |
---|---|
date | Sat, 19 Jul 2014 09:31:04 -0700 |
parents | 3420e018ffbc |
children | e5cf79b516e4 |
files | Output/uartOut/output_com.c Output/usbMuxUart/output_com.c |
diffstat | 2 files changed, 9 insertions(+), 23 deletions(-) [+] |
line wrap: on
line diff
--- a/Output/uartOut/output_com.c Sat Jul 19 09:21:35 2014 -0700 +++ b/Output/uartOut/output_com.c Sat Jul 19 09:31:04 2014 -0700 @@ -116,10 +116,7 @@ // Sets the device into firmware reload mode inline void Output_firmwareReload() { -#if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_) -#elif defined(_mk20dx128_) || defined(_mk20dx128vlf5_) || defined(_mk20dx256_) uart_device_reload(); -#endif } @@ -133,10 +130,8 @@ // USB Get Character from input buffer inline int Output_getchar() { -#if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_) -#elif defined(_mk20dx128_) || defined(_mk20dx128vlf5_) || defined(_mk20dx256_) - return uart_serial_getchar(); -#endif + // XXX Make sure to check output_availablechar() first! Information is lost with the cast (error codes) (AVR) + return (int)uart_serial_getchar(); } @@ -151,6 +146,7 @@ inline int Output_putstr( char* str ) { #if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_) // AVR + uint16_t count = 0; #elif defined(_mk20dx128_) || defined(_mk20dx128vlf5_) || defined(_mk20dx256_) // ARM uint32_t count = 0; #endif @@ -165,10 +161,7 @@ // Soft Chip Reset inline void Output_softReset() { -#if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_) -#elif defined(_mk20dx128_) || defined(_mk20dx128vlf5_) || defined(_mk20dx256_) - SOFTWARE_RESET(); -#endif + usb_device_software_reset(); }
--- a/Output/usbMuxUart/output_com.c Sat Jul 19 09:21:35 2014 -0700 +++ b/Output/usbMuxUart/output_com.c Sat Jul 19 09:31:04 2014 -0700 @@ -142,10 +142,7 @@ // Sets the device into firmware reload mode inline void Output_firmwareReload() { -#if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_) -#elif defined(_mk20dx128_) || defined(_mk20dx128vlf5_) || defined(_mk20dx256_) uart_device_reload(); -#endif } @@ -159,20 +156,18 @@ // USB Get Character from input buffer inline int Output_getchar() { -#if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_) -#elif defined(_mk20dx128_) || defined(_mk20dx128vlf5_) || defined(_mk20dx256_) + // XXX Make sure to check output_availablechar() first! Information is lost with the cast (error codes) (AVR) if ( usb_serial_available() > 0 ) { - return usb_serial_getchar(); + return (int)usb_serial_getchar(); } if ( uart_serial_available() > 0 ) { - return uart_serial_getchar(); + return (int)uart_serial_getchar(); } return -1; -#endif } @@ -191,6 +186,7 @@ inline int Output_putstr( char* str ) { #if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_) // AVR + uint16_t count = 0; #elif defined(_mk20dx128_) || defined(_mk20dx128vlf5_) || defined(_mk20dx256_) // ARM uint32_t count = 0; #endif @@ -209,10 +205,7 @@ // Soft Chip Reset inline void Output_softReset() { -#if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_) -#elif defined(_mk20dx128_) || defined(_mk20dx128vlf5_) || defined(_mk20dx256_) - SOFTWARE_RESET(); -#endif + usb_device_software_reset(); }