Use puts_P() and printf_P() instead of the normal variants where possible in the...
[pub/USBasp.git] / Demos / Host / ClassDriver / PrinterHost / PrinterHost.c
index d2baad6..df71f4c 100644 (file)
@@ -77,7 +77,7 @@ int main(void)
                                if (USB_Host_GetDeviceConfigDescriptor(1, &ConfigDescriptorSize, ConfigDescriptorData,\r
                                                                       sizeof(ConfigDescriptorData)) != HOST_GETCONFIG_Successful)\r
                                {\r
-                                       printf("Error Retrieving Configuration Descriptor.\r\n");\r
+                                       puts_P(PSTR("Error Retrieving Configuration Descriptor.\r\n"));\r
                                        LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
                                        USB_HostState = HOST_STATE_WaitForDeviceRemoval;\r
                                        break;\r
@@ -86,7 +86,7 @@ int main(void)
                                if (PRNT_Host_ConfigurePipes(&Printer_PRNT_Interface,\r
                                                             ConfigDescriptorSize, ConfigDescriptorData) != PRNT_ENUMERROR_NoError)\r
                                {\r
-                                       printf("Attached Device Not a Valid Printer Class Device.\r\n");\r
+                                       puts_P(PSTR("Attached Device Not a Valid Printer Class Device.\r\n"));\r
                                        LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
                                        USB_HostState = HOST_STATE_WaitForDeviceRemoval;\r
                                        break;\r
@@ -94,7 +94,7 @@ int main(void)
                                \r
                                if (USB_Host_SetDeviceConfiguration(1) != HOST_SENDCONTROL_Successful)\r
                                {\r
-                                       printf("Error Setting Device Configuration.\r\n");\r
+                                       puts_P(PSTR("Error Setting Device Configuration.\r\n"));\r
                                        LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
                                        USB_HostState = HOST_STATE_WaitForDeviceRemoval;\r
                                        break;\r
@@ -102,32 +102,32 @@ int main(void)
                                \r
                                if (PRNT_Host_SetBidirectionalMode(&Printer_PRNT_Interface) != HOST_SENDCONTROL_Successful)\r
                                {\r
-                                       printf("Error Setting Bidirectional Mode.\r\n");\r
+                                       puts_P(PSTR("Error Setting Bidirectional Mode.\r\n"));\r
                                        LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
                                        USB_HostState = HOST_STATE_WaitForDeviceRemoval;\r
                                        break;\r
                                }\r
                                \r
-                               printf("Printer Device Enumerated.\r\n");\r
+                               puts_P(PSTR("Printer Device Enumerated.\r\n"));\r
                                LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
                                USB_HostState = HOST_STATE_Configured;\r
                                break;\r
                        case HOST_STATE_Configured:\r
                                LEDs_SetAllLEDs(LEDMASK_USB_BUSY);\r
                                \r
-                               printf("Retrieving Device ID...\r\n");\r
+                               puts_P(PSTR("Retrieving Device ID...\r\n"));\r
                                \r
                                char DeviceIDString[300];\r
                                if (PRNT_Host_GetDeviceID(&Printer_PRNT_Interface, DeviceIDString,\r
                                                          sizeof(DeviceIDString)) != HOST_SENDCONTROL_Successful)\r
                                {\r
-                                       printf("Error Getting Device ID.\r\n");\r
+                                       puts_P(PSTR("Error Getting Device ID.\r\n"));\r
                                        LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
                                        USB_HostState = HOST_STATE_WaitForDeviceRemoval;\r
                                        break;\r
                                }\r
                                \r
-                               printf("Device ID: %s.\r\n", DeviceIDString);\r
+                               printf_P(PSTR("Device ID: %s.\r\n"), DeviceIDString);\r
                                \r
                                char  TestPageData[]    = "\033%-12345X\033E" "LUFA PCL Test Page" "\033E\033%-12345X";\r
                                uint16_t TestPageLength = strlen(TestPageData);\r
@@ -136,7 +136,7 @@ int main(void)
 \r
                                if (PRNT_Host_SendData(&Printer_PRNT_Interface, &TestPageData, TestPageLength) != PIPE_RWSTREAM_NoError)\r
                                {\r
-                                       printf("Error Sending Page Data.\r\n");\r
+                                       puts_P(PSTR("Error Sending Page Data.\r\n"));\r
                                        LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
                                        USB_HostState = HOST_STATE_WaitForDeviceRemoval;\r
                                        break;\r