From f9200fcc7dfb80d250dc7489d6e5b1d4445941fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Thu, 15 Mar 2018 23:11:40 +0100 Subject: [PATCH] some fixes for cfg button --- .../Class/MSC_CDC/usbd_msc_cdc.c | 10 +++++----- platform/lock_jumper.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/USB/STM32_USB_Device_Library/Class/MSC_CDC/usbd_msc_cdc.c b/USB/STM32_USB_Device_Library/Class/MSC_CDC/usbd_msc_cdc.c index 6b76552..033f5f5 100644 --- a/USB/STM32_USB_Device_Library/Class/MSC_CDC/usbd_msc_cdc.c +++ b/USB/STM32_USB_Device_Library/Class/MSC_CDC/usbd_msc_cdc.c @@ -25,8 +25,8 @@ __ALIGN_BEGIN uint8_t USBD_MSC_CDC_CfgFSDesc[USBD_MSC_CDC_CONFIG_DESC_SIZ] __AL 3, /* bNumInterfaces - 1 MSC + 2 composite CDC ACM */ 0x01, /* bConfigurationValue: */ 0, /* iConfiguration: - string descriptor */ - 0xC0, /* bmAttributes: - self powered */ - 150, /* MaxPower 300 mA */ + 0x80, /* bmAttributes: - bus powered */ + 250, /* MaxPower 500 mA */ /******************** Mass Storage interface ********************/ /*9*/ 0x09, /* bLength: Interface Descriptor size */ @@ -63,7 +63,7 @@ __ALIGN_BEGIN uint8_t USBD_MSC_CDC_CfgFSDesc[USBD_MSC_CDC_CONFIG_DESC_SIZ] __AL 0x02, /* bInterfaceCount */ 0x02, /* bFunctionClass */ // #36 0x02, /* bFunctionSubClass (ACM) */ - 0x01, /* bFunctionProtocol (AT-COMMANDS) */ + 0x01, /* bFunctionProtocol (AT-COMMANDS - we don't implement this but it's a good default) */ 0x05, /* iFunction: string descriptor */ /********************** ACM interface **********************/ @@ -131,7 +131,7 @@ __ALIGN_BEGIN uint8_t USBD_MSC_CDC_CfgFSDesc[USBD_MSC_CDC_CONFIG_DESC_SIZ] __AL USB_DESC_TYPE_ENDPOINT, /* bDescriptorType: Endpoint */ CDC_OUT_EP, /* bEndpointAddress */ 0x02, /* bmAttributes: Bulk */ - LOBYTE(CDC_DATA_FS_MAX_PACKET_SIZE), /* wMaxPacketSize: TODO 8? */ + LOBYTE(CDC_DATA_FS_MAX_PACKET_SIZE), /* wMaxPacketSize */ HIBYTE(CDC_DATA_FS_MAX_PACKET_SIZE), 0x00, /* bInterval: ignore for Bulk transfer */ @@ -140,7 +140,7 @@ __ALIGN_BEGIN uint8_t USBD_MSC_CDC_CfgFSDesc[USBD_MSC_CDC_CONFIG_DESC_SIZ] __AL USB_DESC_TYPE_ENDPOINT, /* bDescriptorType: Endpoint */ CDC_IN_EP, /* bEndpointAddress */ 0x02, /* bmAttributes: Bulk */ - LOBYTE(CDC_DATA_FS_MAX_PACKET_SIZE), /* wMaxPacketSize: TODO 16? */ + LOBYTE(CDC_DATA_FS_MAX_PACKET_SIZE), /* wMaxPacketSize */ HIBYTE(CDC_DATA_FS_MAX_PACKET_SIZE), 0x00 /* bInterval: ignore for Bulk transfer */ }; diff --git a/platform/lock_jumper.c b/platform/lock_jumper.c index 6ea50f4..0d8668f 100644 --- a/platform/lock_jumper.c +++ b/platform/lock_jumper.c @@ -42,7 +42,7 @@ void LockJumper_Init(void) LL_GPIO_SetPinPull(lock_periph, lock_llpin, LL_GPIO_PULL_UP); #endif - SystemSettings.editable = (bool) LL_GPIO_IsInputPinSet(lock_periph, lock_llpin); + SystemSettings.editable = PLAT_LOCK_1CLOSED == LL_GPIO_IsInputPinSet(lock_periph, lock_llpin); dbg("Settings editable? %d", SystemSettings.editable); }