From 33856ce17ccc2a4c1041d456f6d9c86eed4b1105 Mon Sep 17 00:00:00 2001 From: Amir Hammad Date: Mon, 13 Jul 2015 14:52:21 +0200 Subject: Global logging: use \n for a new line instead \r\n in LOG_PRINTF Signed-off-by: Amir Hammad --- src/demo.c | 8 +++---- src/usart_helpers.c | 6 +++--- src/usbh_driver_gp_xbox.c | 8 +++---- src/usbh_driver_hid_mouse.c | 4 ++-- src/usbh_driver_hub.c | 52 ++++++++++++++++++++++----------------------- src/usbh_hubbed.c | 30 +++++++++++++------------- src/usbh_lld_stm32f4.c | 24 ++++++++++----------- 7 files changed, 66 insertions(+), 66 deletions(-) (limited to 'src') diff --git a/src/demo.c b/src/demo.c index d4368c9..ec37781 100644 --- a/src/demo.c +++ b/src/demo.c @@ -124,7 +124,7 @@ static void gp_xbox_update(uint8_t device_id, gp_xbox_packet_t packet) { (void)device_id; (void)packet; - LOG_PRINTF("update %d: %d %d \r\n", device_id, packet.axis_left_x, packet.buttons & GP_XBOX_BUTTON_A); + LOG_PRINTF("update %d: %d %d \n", device_id, packet.axis_left_x, packet.buttons & GP_XBOX_BUTTON_A); } @@ -152,7 +152,7 @@ static void mouse_in_message_handler(uint8_t device_id, const uint8_t *data) (void)data; // print only first 4 bytes, since every mouse should have at least these four set. // Report descriptors are not read by driver for now, so we do not know what each byte means - LOG_PRINTF("MOUSE EVENT %02X %02X %02X %02X \r\n", data[0], data[1], data[2], data[3]); + LOG_PRINTF("MOUSE EVENT %02X %02X %02X %02X \n", data[0], data[1], data[2], data[3]); } static const hid_mouse_config_t mouse_config = { @@ -170,7 +170,7 @@ int main(void) #ifdef USART_DEBUG usart_init(USART6, 921600); #endif - LOG_PRINTF("\r\n\r\n\r\n\r\n\r\n###################\r\nInit\r\n"); + LOG_PRINTF("\n\n\n\n\n###################\nInit\n"); /** * device driver initialization @@ -193,7 +193,7 @@ int main(void) usbh_init(usbh_lld_stm32f4_drivers, device_drivers); gpio_clear(GPIOD, GPIO13); - LOG_PRINTF("USB init complete\r\n"); + LOG_PRINTF("USB init complete\n"); LOG_FLUSH(); diff --git a/src/usart_helpers.c b/src/usart_helpers.c index 31a7556..4469b44 100644 --- a/src/usart_helpers.c +++ b/src/usart_helpers.c @@ -180,7 +180,7 @@ void usart_interrupt(void) if ( data != 3 && data != '\r' && data != '\n') { usart_fifo_push(data); } else { - LOG_PRINTF("\r\n>>"); + LOG_PRINTF("\n>>"); } } } @@ -270,7 +270,7 @@ void usart_call_cmd(struct usart_commands * commands) commands[i].callback(&command[command_argindex]); } } - usart_write("\r\n>>",4); + usart_write("\n>>",4); command_len = 0; command_argindex = 0; return; @@ -281,7 +281,7 @@ void usart_call_cmd(struct usart_commands * commands) } command_len = 0; command_argindex = 0; - LOG_PRINTF("INVALID COMMAND\r\n>>"); + LOG_PRINTF("INVALID COMMAND\n>>"); } #endif diff --git a/src/usbh_driver_gp_xbox.c b/src/usbh_driver_gp_xbox.c index a2390bd..f1525c4 100644 --- a/src/usbh_driver_gp_xbox.c +++ b/src/usbh_driver_gp_xbox.c @@ -291,7 +291,7 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data) case USBH_PACKET_CALLBACK_STATUS_OK: gp_xbox->state_next = STATE_READING_REQUEST; gp_xbox->endpoint_in_toggle = 0; - LOG_PRINTF("\r\ngp_xbox CONFIGURED\r\n"); + LOG_PRINTF("\ngp_xbox CONFIGURED\n"); if (gp_xbox_config->notify_connected) { gp_xbox_config->notify_connected(gp_xbox->device_id); } @@ -314,7 +314,7 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data) break; default: { - LOG_PRINTF("Unknown state\r\n"); + LOG_PRINTF("Unknown state\n"); } break; } @@ -339,7 +339,7 @@ static void read_gp_xbox_in(gp_xbox_device_t *gp_xbox) gp_xbox->state_next = STATE_READING_COMPLETE; usbh_read(gp_xbox->usbh_device, &packet); - // LOG_PRINTF("@gp_xbox EP1 | \r\n"); + // LOG_PRINTF("@gp_xbox EP1 | \n"); } /** @@ -386,7 +386,7 @@ static void poll(void *drvdata, uint32_t time_curr_us) static void remove(void *drvdata) { - LOG_PRINTF("Removing xbox\r\n"); + LOG_PRINTF("Removing xbox\n"); gp_xbox_device_t *gp_xbox = (gp_xbox_device_t *)drvdata; if (gp_xbox_config->notify_disconnected) { diff --git a/src/usbh_driver_hid_mouse.c b/src/usbh_driver_hid_mouse.c index 2afa084..dc6ab84 100644 --- a/src/usbh_driver_hid_mouse.c +++ b/src/usbh_driver_hid_mouse.c @@ -182,7 +182,7 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data) case USBH_PACKET_CALLBACK_STATUS_OK: mouse->state_next = STATE_READING_REQUEST; mouse->endpoint_in_toggle = 0; - LOG_PRINTF("\r\nMOUSE CONFIGURED\r\n"); + LOG_PRINTF("\nMOUSE CONFIGURED\n"); break; case USBH_PACKET_CALLBACK_STATUS_ERRSIZ: @@ -219,7 +219,7 @@ static void read_mouse_in(void *drvdata) mouse->state_next = STATE_READING_COMPLETE; usbh_read(mouse->usbh_device, &packet); - // LOG_PRINTF("@MOUSE EP1 | \r\n"); + // LOG_PRINTF("@MOUSE EP1 | \n"); } diff --git a/src/usbh_driver_hub.c b/src/usbh_driver_hub.c index ffc3dda..266cd71 100644 --- a/src/usbh_driver_hub.c +++ b/src/usbh_driver_hub.c @@ -106,7 +106,7 @@ static bool analyze_descriptor(void *drvdata, void *descriptor) hub->endpoint_in_maxpacketsize = ep->wMaxPacketSize; } } - LOG_PRINTF("ENDPOINT DESCRIPTOR FOUND\r\n"); + LOG_PRINTF("ENDPOINT DESCRIPTOR FOUND\n"); } break; @@ -117,15 +117,15 @@ static bool analyze_descriptor(void *drvdata, void *descriptor) if ( desc->head.bNbrPorts <= USBH_HUB_MAX_DEVICES) { hub->ports_num = desc->head.bNbrPorts; } else { - LOG_PRINTF("INCREASE NUMBER OF ENABLED PORTS\r\n"); + LOG_PRINTF("INCREASE NUMBER OF ENABLED PORTS\n"); hub->ports_num = USBH_HUB_MAX_DEVICES; } - LOG_PRINTF("HUB DESCRIPTOR FOUND \r\n"); + LOG_PRINTF("HUB DESCRIPTOR FOUND \n"); } break; default: - LOG_PRINTF("TYPE: %02X \r\n",desc_type); + LOG_PRINTF("TYPE: %02X \n",desc_type); break; } @@ -143,7 +143,7 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data) //~ usbh_device_t *dev = arg; hub_device_t *hub = (hub_device_t *)dev->drvdata; - LOG_PRINTF("\r\nHUB->STATE = %d\r\n", hub->state); + LOG_PRINTF("\nHUB->STATE = %d\n", hub->state); switch (hub->state) { case 26: switch (cb_data.status) { @@ -157,7 +157,7 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data) } int8_t port = 0; - LOG_PRINTF("psc:%d\r\n",psc); + LOG_PRINTF("psc:%d\n",psc); // Driver error... port not found if (!psc) { // Continue reading status change endpoint @@ -197,7 +197,7 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data) hub->state = 31; hub->current_port = port; - LOG_PRINTF("\r\n\r\nPORT FOUND: %d\r\n", port); + LOG_PRINTF("\n\nPORT FOUND: %d\n", port); device_xfer_control_write(&setup_data, sizeof(setup_data), event, dev); } break; @@ -212,7 +212,7 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data) // In case of EAGAIN error, retry read on status endpoint hub->state = 25; - LOG_PRINTF("HUB: Retrying...\r\n"); + LOG_PRINTF("HUB: Retrying...\n"); break; } break; @@ -242,7 +242,7 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data) if (hub->ports_num) { hub->index = 0; hub->state = 6; - LOG_PRINTF("No need to get HUB DESC\r\n"); + LOG_PRINTF("No need to get HUB DESC\n"); event(dev, cb_data); } else { hub->endpoint_in_toggle = 0; @@ -258,7 +258,7 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data) hub->state++; device_xfer_control_write(&setup_data, sizeof(setup_data), event, dev); - LOG_PRINTF("DO Need to get HUB DESC\r\n"); + LOG_PRINTF("DO Need to get HUB DESC\n"); } break; @@ -325,7 +325,7 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data) case USBH_PACKET_CALLBACK_STATUS_ERRSIZ: { - LOG_PRINTF("->\t\t\t\t\t ERRSIZ: deschub\r\n"); + LOG_PRINTF("->\t\t\t\t\t ERRSIZ: deschub\n"); struct usb_hub_descriptor*hub_descriptor = (struct usb_hub_descriptor *)hub->buffer; @@ -335,7 +335,7 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data) if ( hub_descriptor->head.bNbrPorts <= USBH_HUB_MAX_DEVICES) { hub->ports_num = hub_descriptor->head.bNbrPorts; } else { - LOG_PRINTF("INCREASE NUMBER OF ENABLED PORTS\r\n"); + LOG_PRINTF("INCREASE NUMBER OF ENABLED PORTS\n"); hub->ports_num = USBH_HUB_MAX_DEVICES; } hub->state++; @@ -378,7 +378,7 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data) // Delay Based on hub descriptor field bPwr2PwrGood // delay_ms_busy_loop(200); - LOG_PRINTF("\r\nHUB CONFIGURED & PORTS POWERED\r\n"); + LOG_PRINTF("\nHUB CONFIGURED & PORTS POWERED\n"); cb_data.status = USBH_PACKET_CALLBACK_STATUS_OK; event(dev, cb_data); @@ -553,7 +553,7 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data) // Check, whether device is in connected state if (!hub->device[port]) { if (!usbh_enum_available() || hub->busy) { - LOG_PRINTF("\r\n\t\t\tCannot enumerate %d %d\r\n", !usbh_enum_available(), hub->busy); + LOG_PRINTF("\n\t\t\tCannot enumerate %d %d\n", !usbh_enum_available(), hub->busy); hub->state = 25; break; } @@ -587,11 +587,11 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data) LOG_PRINTF("RESET"); device_xfer_control_write(&setup_data, sizeof(setup_data), event, dev); } else { - LOG_PRINTF("another STC %d\r\n", stc); + LOG_PRINTF("another STC %d\n", stc); } } else { hub->state = 25; - LOG_PRINTF("HUB status change\r\n"); + LOG_PRINTF("HUB status change\n"); } } break; @@ -630,7 +630,7 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data) device_xfer_control_write(&setup_data, sizeof(setup_data), event, dev); } } else { - LOG_PRINTF("\t\t\t\tDISCONNECT EVENT\r\n"); + LOG_PRINTF("\t\t\t\tDISCONNECT EVENT\n"); if (hub->device[port]->drv && hub->device[port]->drvdata) { hub->device[port]->drv->remove(hub->device[port]->drvdata); } @@ -661,7 +661,7 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data) switch (cb_data.status) { case USBH_PACKET_CALLBACK_STATUS_OK: { - LOG_PRINTF("\r\nPOLL\r\n"); + LOG_PRINTF("\nPOLL\n"); int8_t port = hub->current_port; uint16_t sts = hub->hub_and_port_status[port].sts; @@ -670,7 +670,7 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data) hub->device[port] = usbh_get_free_device(dev); if (!hub->device[port]) { - LOG_PRINTF("\r\nFATAL ERROR\r\n"); + LOG_PRINTF("\nFATAL ERROR\n"); return;// DEAD END } if ((sts & (1<<(HUB_FEATURE_PORT_LOWSPEED))) && @@ -700,7 +700,7 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data) } else { - LOG_PRINTF("%s:%d Do not know what to do, when device is disabled after reset\r\n", __FILE__, __LINE__); + LOG_PRINTF("%s:%d Do not know what to do, when device is disabled after reset\n", __FILE__, __LINE__); hub->state = 25; return; } @@ -718,7 +718,7 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data) } break; default: - LOG_PRINTF("UNHANDLED EVENT %d\r\n",hub->state); + LOG_PRINTF("UNHANDLED EVENT %d\n",hub->state); break; } } @@ -741,7 +741,7 @@ static void read_ep1(void *drvdata) hub->state = 26; usbh_read(hub->device[0], &packet); - LOG_PRINTF("@hub %d/EP1 | \r\n", hub->device[0]->address); + LOG_PRINTF("@hub %d/EP1 | \n", hub->device[0]->address); } @@ -762,14 +762,14 @@ static void poll(void *drvdata, uint32_t time_curr_us) if (usbh_enum_available()) { read_ep1(hub); } else { - LOG_PRINTF("enum not available\r\n"); + LOG_PRINTF("enum not available\n"); } } break; case 1: { - LOG_PRINTF("CFGVAL: %d\r\n", hub->buffer[0]); + LOG_PRINTF("CFGVAL: %d\n", hub->buffer[0]); struct usb_setup_data setup_data; setup_data.bmRequestType = 0b00000000; @@ -787,7 +787,7 @@ static void poll(void *drvdata, uint32_t time_curr_us) if (hub->time_curr_us - hub->timestamp_us > 500000) { int8_t port = hub->current_port; LOG_PRINTF("PORT: %d", port); - LOG_PRINTF("\r\nNEW device at address: %d\r\n", hub->device[port]->address); + LOG_PRINTF("\nNEW device at address: %d\n", hub->device[port]->address); hub->device[port]->lld = hub->device[0]->lld; device_enumeration_start(hub->device[port]); @@ -832,7 +832,7 @@ static void remove(void *drvdata) if (hub->device[i]) { if (hub->device[i]->drv && hub->device[i]->drvdata) { if (hub->device[i]->drv->remove != remove) { - LOG_PRINTF("\t\t\t\tHUB REMOVE %d\r\n",hub->device[i]->address); + LOG_PRINTF("\t\t\t\tHUB REMOVE %d\n",hub->device[i]->address); hub->device[i]->drv->remove(hub->device[i]->drvdata); } } diff --git a/src/usbh_hubbed.c b/src/usbh_hubbed.c index 0ebaf1c..833e5a3 100644 --- a/src/usbh_hubbed.c +++ b/src/usbh_hubbed.c @@ -117,7 +117,7 @@ static void device_register(void *descriptors, uint16_t descriptors_len, usbh_de switch (desc_type) { case USB_DT_INTERFACE: { - LOG_PRINTF("INTERFACE_DESCRIPTOR\r\n"); + LOG_PRINTF("INTERFACE_DESCRIPTOR\n"); struct usb_interface_descriptor *iface = (void*)&buf[i]; device_info.ifaceClass = iface->bInterfaceClass; device_info.ifaceSubClass = iface->bInterfaceSubClass; @@ -138,7 +138,7 @@ static void device_register(void *descriptors, uint16_t descriptors_len, usbh_de } if (desc_len == 0) { - LOG_PRINTF("PROBLEM WITH PARSE %d\r\n",i); + LOG_PRINTF("PROBLEM WITH PARSE %d\n",i); return; } i += desc_len; @@ -154,13 +154,13 @@ static void device_register(void *descriptors, uint16_t descriptors_len, usbh_de void *drvdata = dev->drvdata; LOG_PRINTF("[%d]",buf[i+1]); if (dev->drv->analyze_descriptor(drvdata, &buf[i])) { - LOG_PRINTF("Device Initialized\r\n"); + LOG_PRINTF("Device Initialized\n"); return; } i += desc_len; } } - LOG_PRINTF("Device NOT Initialized\r\n"); + LOG_PRINTF("Device NOT Initialized\n"); } void usbh_init(const void *drivers_lld[], const usbh_dev_driver_t * const device_drivers[]) @@ -175,7 +175,7 @@ void usbh_init(const void *drivers_lld[], const usbh_dev_driver_t * const device // TODO: init structures uint32_t k = 0; while (usbh_data.lld_drivers[k]) { - LOG_PRINTF("DRIVER %d\r\n", k); + LOG_PRINTF("DRIVER %d\n", k); usbh_device_t * usbh_device = ((usbh_generic_data_t *)(usbh_data.lld_drivers[k])->driver_data)->usbh_device; @@ -214,7 +214,7 @@ void device_xfer_control_write(void *data, uint16_t datalen, usbh_packet_callbac packet.toggle = &dev->toggle0; usbh_write(dev, &packet); - LOG_PRINTF("WR@device...%d | \r\n", dev->address); + LOG_PRINTF("WR@device...%d | \n", dev->address); } void device_xfer_control_read(void *data, uint16_t datalen, usbh_packet_callback_t callback, usbh_device_t *dev) @@ -233,7 +233,7 @@ void device_xfer_control_read(void *data, uint16_t datalen, usbh_packet_callback packet.toggle = &dev->toggle0; usbh_read(dev, &packet); - LOG_PRINTF("RD@device...%d | \r\n", dev->address); + LOG_PRINTF("RD@device...%d | \n", dev->address); } @@ -254,14 +254,14 @@ usbh_device_t *usbh_get_free_device(const usbh_device_t *dev) usbh_device_t *usbh_device = lld_data->usbh_device; uint8_t i; - LOG_PRINTF("DEV ADDRESS%d\r\n", dev->address); + LOG_PRINTF("DEV ADDRESS%d\n", dev->address); for (i = 0; i < USBH_MAX_DEVICES; i++) { if (usbh_device[i].address < 0) { LOG_PRINTF("\t\t\t\t\tFOUND: %d", i); usbh_device[i].address = i+1; return &usbh_device[i]; } else { - LOG_PRINTF("address: %d\r\n\r\n\r\n", usbh_device[i].address); + LOG_PRINTF("address: %d\n\n\n", usbh_device[i].address); } } @@ -285,7 +285,7 @@ static void device_enumerate(usbh_device_t *dev, usbh_packet_callback_data_t cb_ usbh_generic_data_t *lld_data = lld->driver_data; uint8_t *usbh_buffer = lld_data->usbh_buffer; uint8_t state_start = dev->state; // Detection of hang -// LOG_PRINTF("\r\nSTATE: %d\r\n", state); +// LOG_PRINTF("\nSTATE: %d\n", state); switch (dev->state) { case 1: { @@ -311,7 +311,7 @@ static void device_enumerate(usbh_device_t *dev, usbh_packet_callback_data_t cb_ case USBH_PACKET_CALLBACK_STATUS_OK: if (dev->address == 0) { dev->address = usbh_data.address_temporary; - LOG_PRINTF("ADDR: %d\r\n", dev->address); + LOG_PRINTF("ADDR: %d\n", dev->address); } struct usb_setup_data setup_data; @@ -501,7 +501,7 @@ static void device_enumerate(usbh_device_t *dev, usbh_packet_callback_data_t cb_ { struct usb_config_descriptor *cdt = (struct usb_config_descriptor *)&usbh_buffer[USB_DT_DEVICE_SIZE]; - LOG_PRINTF("TOTAL_LENGTH: %d\r\n", cdt->wTotalLength); + LOG_PRINTF("TOTAL_LENGTH: %d\n", cdt->wTotalLength); device_register(usbh_buffer, cdt->wTotalLength + USB_DT_DEVICE_SIZE, dev); dev->state++; @@ -526,7 +526,7 @@ static void device_enumerate(usbh_device_t *dev, usbh_packet_callback_data_t cb_ } if (state_start == dev->state) { - LOG_PRINTF("\r\n !HANG %d\r\n", state_start); + LOG_PRINTF("\n !HANG %d\n", state_start); } } @@ -547,7 +547,7 @@ void device_enumeration_start(usbh_device_t *dev) usbh_data.address_temporary = address; - LOG_PRINTF("\r\n\r\n\r\n ENUMERATION OF DEVICE@%d STARTED \r\n\r\n", address); + LOG_PRINTF("\n\n\n ENUMERATION OF DEVICE@%d STARTED \n\n", address); struct usb_setup_data setup_data; @@ -579,7 +579,7 @@ void usbh_poll(uint32_t time_curr_us) switch (poll_status) { case USBH_POLL_STATUS_DEVICE_CONNECTED: // New device found - LOG_PRINTF("\r\nDEVICE FOUND\r\n"); + LOG_PRINTF("\nDEVICE FOUND\n"); usbh_device[0].lld = usbh_data.lld_drivers[k]; usbh_device[0].speed = usbh_data.lld_drivers[k]->root_speed(lld_data); usbh_device[0].address = 1; diff --git a/src/usbh_lld_stm32f4.c b/src/usbh_lld_stm32f4.c index 429e57e..817df2e 100644 --- a/src/usbh_lld_stm32f4.c +++ b/src/usbh_lld_stm32f4.c @@ -195,7 +195,7 @@ static void read(void *drvdata, usbh_packet_t *packet) int8_t channel = get_free_channel(dev); if (channel == -1) { // BIG PROBLEM - LOG_PRINTF("FATAL ERROR IN, NO CHANNEL LEFT \r\n"); + LOG_PRINTF("FATAL ERROR IN, NO CHANNEL LEFT \n"); usbh_packet_callback_data_t cb_data; cb_data.status = USBH_PACKET_CALLBACK_STATUS_EFATAL; cb_data.transferred_length = 0; @@ -243,7 +243,7 @@ static void write(void *drvdata, const usbh_packet_t *packet) if (channel == -1) { // BIG PROBLEM - LOG_PRINTF("FATAL ERROR OUT, NO CHANNEL LEFT \r\n"); + LOG_PRINTF("FATAL ERROR OUT, NO CHANNEL LEFT \n"); usbh_packet_callback_data_t cb_data; cb_data.status = USBH_PACKET_CALLBACK_STATUS_EFATAL; cb_data.transferred_length = 0; @@ -309,7 +309,7 @@ static void write(void *drvdata, const usbh_packet_t *packet) *fifo++ = *buf32++; } } - LOG_PRINTF("->WRITE %08X\r\n", REBASE_CH(OTG_HCCHAR, channel)); + LOG_PRINTF("->WRITE %08X\n", REBASE_CH(OTG_HCCHAR, channel)); } static void rxflvl_handle(void *drvdata) @@ -350,7 +350,7 @@ static void rxflvl_handle(void *drvdata) } else if ((rxstsp&OTG_GRXSTSP_PKTSTS_MASK) == OTG_GRXSTSP_PKTSTS_IN_COMP) { #ifdef USART_DEBUG uint32_t i; - LOG_PRINTF("\r\nDATA: "); + LOG_PRINTF("\nDATA: "); for (i = 0; i < channels[channel].data_index; i++) { uint8_t *data = channels[channel].packet.data; LOG_PRINTF("%02X ", data[i]); @@ -393,7 +393,7 @@ static enum USBH_POLL_STATUS poll_run(usbh_lld_stm32f4_driver_data_t *dev) REBASE(OTG_HFIR) = (REBASE(OTG_HFIR) & ~OTG_HFIR_FRIVL_MASK) | 48000; if ((REBASE(OTG_HCFG) & OTG_HCFG_FSLSPCS_MASK) != OTG_HCFG_FSLSPCS_48MHz) { REBASE(OTG_HCFG) = (REBASE(OTG_HCFG) & ~OTG_HCFG_FSLSPCS_MASK) | OTG_HCFG_FSLSPCS_48MHz; - LOG_PRINTF("\r\n Reset Full-Speed \r\n"); + LOG_PRINTF("\n Reset Full-Speed \n"); } channels_init(dev); dev->dpstate = DEVICE_POLL_STATE_DEVRST; @@ -403,7 +403,7 @@ static enum USBH_POLL_STATUS poll_run(usbh_lld_stm32f4_driver_data_t *dev) REBASE(OTG_HFIR) = (REBASE(OTG_HFIR) & ~OTG_HFIR_FRIVL_MASK) | 6000; if ((REBASE(OTG_HCFG) & OTG_HCFG_FSLSPCS_MASK) != OTG_HCFG_FSLSPCS_6MHz) { REBASE(OTG_HCFG) = (REBASE(OTG_HCFG) & ~OTG_HCFG_FSLSPCS_MASK) | OTG_HCFG_FSLSPCS_6MHz; - LOG_PRINTF("\r\n Reset Low-Speed \r\n"); + LOG_PRINTF("\n Reset Low-Speed \n"); } channels_init(dev); @@ -825,7 +825,7 @@ static void poll_init(usbh_lld_stm32f4_driver_data_t *dev) // Uncomment to enable Interrupt generation REBASE(OTG_GAHBCFG) |= OTG_GAHBCFG_GINT; - LOG_PRINTF("INIT COMPLETE\r\n"); + LOG_PRINTF("INIT COMPLETE\n"); // Finish dev->state = DEVICE_STATE_RUN; @@ -838,7 +838,7 @@ static void poll_init(usbh_lld_stm32f4_driver_data_t *dev) if (done) { dev->poll_sequence++; dev->timestamp_us = dev->time_curr_us; - LOG_PRINTF("\t\t POLL SEQUENCE %d\r\n", dev->poll_sequence); + LOG_PRINTF("\t\t POLL SEQUENCE %d\n", dev->poll_sequence); } } @@ -852,7 +852,7 @@ static void poll_reset(usbh_lld_stm32f4_driver_data_t *dev) LOG_PRINTF("RESET"); } else { - LOG_PRINTF("waiting %d < %d\r\n",dev->time_curr_us, dev->timestamp_us); + LOG_PRINTF("waiting %d < %d\n",dev->time_curr_us, dev->timestamp_us); } } @@ -927,7 +927,7 @@ static void free_channel(void *drvdata, uint8_t channel) if (REBASE_CH(OTG_HCCHAR, channel) & OTG_HCCHAR_CHENA) { REBASE_CH(OTG_HCCHAR, channel) |= OTG_HCCHAR_CHDIS; REBASE_CH(OTG_HCINT, channel) = ~0; - LOG_PRINTF("\r\nDisabling channel %d\r\n", channel); + LOG_PRINTF("\nDisabling channel %d\n", channel); } else { channels[channel].state = CHANNEL_STATE_FREE; } @@ -983,9 +983,9 @@ void print_channels(const void *lld) usbh_lld_stm32f4_driver_data_t *dev = ((usbh_driver_t *)lld)->driver_data; channel_t *channels = dev->channels; int32_t i; - LOG_PRINTF("\r\nCHANNELS: \r\n"); + LOG_PRINTF("\nCHANNELS: \n"); for (i = 0;i < dev->num_channels;i++) { - LOG_PRINTF("%4d %4d %4d %08X\r\n", channels[i].state, channels[i].packet.address, channels[i].packet.datalen, MMIO32(dev->base + OTG_HCINT(i))); + LOG_PRINTF("%4d %4d %4d %08X\n", channels[i].state, channels[i].packet.address, channels[i].packet.datalen, MMIO32(dev->base + OTG_HCINT(i))); } } #endif -- cgit