From 7beb6b8ac5fa612ef85aaec713d779296966b20d Mon Sep 17 00:00:00 2001 From: true Date: Wed, 6 Nov 2024 22:04:41 -0800 Subject: [PATCH] minor usb cleanup --- gat_stand_fw/usblib/config/hw_config.c | 10 +++++----- gat_stand_fw/usblib/config/hw_config.h | 6 +++--- gat_stand_fw/usblib/config/usb_prop.c | 6 +++--- gat_stand_fw/usblib/config/usb_pwr.c | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/gat_stand_fw/usblib/config/hw_config.c b/gat_stand_fw/usblib/config/hw_config.c index cdd2242..befecef 100644 --- a/gat_stand_fw/usblib/config/hw_config.c +++ b/gat_stand_fw/usblib/config/hw_config.c @@ -78,9 +78,9 @@ void usb_conf_clksource(void) * * @return None */ -void Enter_LowPowerMode(void) +void usb_enter_LowPowerMode(void) { - printf("usb enter low power mode\r\n"); + printf_usb("usb enter low power mode\r\n"); bDeviceState = SUSPENDED; } @@ -91,10 +91,10 @@ void Enter_LowPowerMode(void) * * @return None */ -void Leave_LowPowerMode(void) +void usb_leave_LowPowerMode(void) { DEVICE_INFO *pInfo = &Device_Info; - printf("usb leave low power mode\r\n"); + printf_usb("usb leave low power mode\r\n"); if (pInfo->Current_Configuration != 0) bDeviceState = CONFIGURED; else @@ -141,7 +141,7 @@ void usb_intr_init(void) * * @return None */ -void USB_Port_Set(FunctionalState NewState, FunctionalState Pin_In_IPU) +void usb_gpio_init(FunctionalState NewState, FunctionalState Pin_In_IPU) { RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE); diff --git a/gat_stand_fw/usblib/config/hw_config.h b/gat_stand_fw/usblib/config/hw_config.h index 8e3d3ef..f6d3bbb 100644 --- a/gat_stand_fw/usblib/config/hw_config.h +++ b/gat_stand_fw/usblib/config/hw_config.h @@ -31,10 +31,10 @@ void usb_conf_clksource(void); void usb_intr_init(void); -void Enter_LowPowerMode(void); -void Leave_LowPowerMode(void); +void usb_enter_LowPowerMode(void); +void usb_leave_LowPowerMode(void); -void USB_Port_Set(FunctionalState NewState, FunctionalState Pin_In_IPU); +void usb_gpio_init(FunctionalState NewState, FunctionalState Pin_In_IPU); diff --git a/gat_stand_fw/usblib/config/usb_prop.c b/gat_stand_fw/usblib/config/usb_prop.c index a10e721..3b75481 100644 --- a/gat_stand_fw/usblib/config/usb_prop.c +++ b/gat_stand_fw/usblib/config/usb_prop.c @@ -194,7 +194,7 @@ void USBD_Status_Out(void) void USBD_init(void) { uint8_t i; - uint32_t timeout; + volatile uint32_t timeout; pInformation->Current_Configuration = 0; PowerOn(); @@ -206,9 +206,9 @@ void USBD_init(void) USB_SIL_Init(); bDeviceState = UNCONNECTED; - USB_Port_Set(DISABLE, DISABLE); + usb_gpio_init(DISABLE, DISABLE); for (timeout = SystemCoreClock >> 5; timeout; timeout--); - USB_Port_Set(ENABLE, ENABLE); + usb_gpio_init(ENABLE, ENABLE); } /******************************************************************************* diff --git a/gat_stand_fw/usblib/config/usb_pwr.c b/gat_stand_fw/usblib/config/usb_pwr.c index 2da7f0e..3e5d268 100644 --- a/gat_stand_fw/usblib/config/usb_pwr.c +++ b/gat_stand_fw/usblib/config/usb_pwr.c @@ -115,7 +115,7 @@ void Suspend(void) wCNTR |= CNTR_LPMODE; _SetCNTR(wCNTR); - Enter_LowPowerMode(); + usb_enter_LowPowerMode(); } /******************************************************************************* @@ -132,7 +132,7 @@ void Resume_Init(void) wCNTR = _GetCNTR(); wCNTR &= (~CNTR_LPMODE); _SetCNTR(wCNTR); - Leave_LowPowerMode(); + usb_leave_LowPowerMode(); _SetCNTR(IMR_MSK); }