Adding McHCK flash reload function and some cleanup.

- Requires special string to be compared with the bootloader and VBAT register file
This commit is contained in:
Jacob Alexander 2014-07-19 09:21:35 -07:00
parent 1fd777815b
commit 8eba0ae354
8 changed files with 31 additions and 28 deletions

View file

@ -139,11 +139,7 @@ inline void Output_send(void)
// Sets the device into firmware reload mode
inline void Output_firmwareReload()
{
#if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_)
usb_debug_reload();
#elif defined(_mk20dx128_) || defined(_mk20dx128vlf5_) || defined(_mk20dx256_)
usb_device_reload();
#endif
}
@ -157,12 +153,8 @@ inline unsigned int Output_availablechar()
// USB Get Character from input buffer
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)
// XXX Make sure to check output_availablechar() first! Information is lost with the cast (error codes) (AVR)
return (int)usb_serial_getchar();
#elif defined(_mk20dx128_) || defined(_mk20dx128vlf5_) || defined(_mk20dx256_)
return usb_serial_getchar();
#endif
}
@ -192,11 +184,7 @@ inline int Output_putstr( char* str )
// Soft Chip Reset
inline void Output_softReset()
{
#if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_)
usb_debug_software_reset();
#elif defined(_mk20dx128_) || defined(_mk20dx128vlf5_) || defined(_mk20dx256_)
SOFTWARE_RESET();
#endif
usb_device_software_reset();
}