X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/c5038f1bf44aea75f1ae1ed035cb7d523ccfdacb..7aecda6fda5bcced68d72b0cf73d00174aa5c7cd:/Demos/Host/LowLevel/StillImageHost/StillImageHost.c diff --git a/Demos/Host/LowLevel/StillImageHost/StillImageHost.c b/Demos/Host/LowLevel/StillImageHost/StillImageHost.c index 6c56d5f3e..c4aadb1bb 100644 --- a/Demos/Host/LowLevel/StillImageHost/StillImageHost.c +++ b/Demos/Host/LowLevel/StillImageHost/StillImageHost.c @@ -37,7 +37,7 @@ #include "StillImageHost.h" /** Main program entry point. This routine configures the hardware required by the application, then - * starts the scheduler to run the application tasks. + * enters a loop to run the application tasks in sequence. */ int main(void) { @@ -102,8 +102,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode) { USB_ShutDown(); - puts_P(PSTR(ESC_FG_RED "Host Mode Error\r\n")); - printf_P(PSTR(" -- Error Code %d\r\n" ESC_FG_WHITE), ErrorCode); + printf_P(PSTR(ESC_FG_RED "Host Mode Error\r\n" + " -- Error Code %d\r\n" ESC_FG_WHITE), ErrorCode); LEDs_SetAllLEDs(LEDMASK_USB_ERROR); for(;;); @@ -114,10 +114,10 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode) */ void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode) { - puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n")); - printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode); - printf_P(PSTR(" -- Sub Error Code %d\r\n"), SubErrorCode); - printf_P(PSTR(" -- In State %d\r\n" ESC_FG_WHITE), USB_HostState); + printf_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n" + " -- Error Code %d\r\n" + " -- Sub Error Code %d\r\n" + " -- In State %d\r\n" ESC_FG_WHITE), ErrorCode, SubErrorCode, USB_HostState); LEDs_SetAllLEDs(LEDMASK_USB_ERROR); } @@ -155,8 +155,8 @@ void StillImage_Task(void) /* Set the device configuration to the first configuration (rarely do devices use multiple configurations) */ if ((ErrorCode = USB_Host_SetDeviceConfiguration(1)) != HOST_SENDCONTROL_Successful) { - puts_P(PSTR(ESC_FG_RED "Control Error (Set Configuration).\r\n")); - printf_P(PSTR(" -- Error Code: %d\r\n" ESC_FG_WHITE), ErrorCode); + printf_P(PSTR(ESC_FG_RED "Control Error (Set Configuration).\r\n" + " -- Error Code: %d\r\n" ESC_FG_WHITE), ErrorCode); /* Indicate error via status LEDs */ LEDs_SetAllLEDs(LEDMASK_USB_ERROR); @@ -189,7 +189,7 @@ void StillImage_Task(void) SImage_SendBlockHeader(); /* Receive the response data block */ - if ((ErrorCode = SImage_RecieveBlockHeader()) != PIPE_RWSTREAM_NoError) + if ((ErrorCode = SImage_ReceiveBlockHeader()) != PIPE_RWSTREAM_NoError) { ShowCommandError(ErrorCode, false); @@ -242,7 +242,7 @@ void StillImage_Task(void) printf_P(PSTR(" Device Version: %s\r\n"), DeviceVersion); /* Receive the final response block from the device */ - if ((ErrorCode = SImage_RecieveBlockHeader()) != PIPE_RWSTREAM_NoError) + if ((ErrorCode = SImage_ReceiveBlockHeader()) != PIPE_RWSTREAM_NoError) { ShowCommandError(ErrorCode, false); @@ -274,7 +274,7 @@ void StillImage_Task(void) SImage_SendBlockHeader(); /* Receive the response block from the device */ - if ((ErrorCode = SImage_RecieveBlockHeader()) != PIPE_RWSTREAM_NoError) + if ((ErrorCode = SImage_ReceiveBlockHeader()) != PIPE_RWSTREAM_NoError) { ShowCommandError(ErrorCode, false); @@ -306,7 +306,7 @@ void StillImage_Task(void) SImage_SendBlockHeader(); /* Receive the response block from the device */ - if ((ErrorCode = SImage_RecieveBlockHeader()) != PIPE_RWSTREAM_NoError) + if ((ErrorCode = SImage_ReceiveBlockHeader()) != PIPE_RWSTREAM_NoError) { ShowCommandError(ErrorCode, false); @@ -367,8 +367,8 @@ void ShowCommandError(uint8_t ErrorCode, bool ResponseCodeError) { char* FailureType = ((ResponseCodeError) ? PSTR("Response Code != OK") : PSTR("Transaction Fail")); - printf_P(PSTR(ESC_FG_RED "Command Error (%S).\r\n"), FailureType); - printf_P(PSTR(" -- Error Code %d\r\n" ESC_FG_WHITE), ErrorCode); + printf_P(PSTR(ESC_FG_RED "Command Error (%S).\r\n" + " -- Error Code %d\r\n" ESC_FG_WHITE), FailureType, ErrorCode); /* Indicate error via status LEDs */ LEDs_SetAllLEDs(LEDMASK_USB_ERROR);