house keeping

This commit is contained in:
hathach 2018-07-03 16:40:07 +07:00
parent 5f1bf84941
commit ab9a0aa9bf
4 changed files with 19 additions and 34 deletions

@ -1 +1 @@
Subproject commit 142300ca60d4c08d3d05df77c943e76b4336b21f
Subproject commit ec3227b2202b007da1b76c20394b6f4d774f68b6

View File

@ -118,6 +118,7 @@ C_SOURCE_FILES += $(TUSB_PATH)/portable/nordic/nrf5x/dcd_nrf5x.c
C_SOURCE_FILES += $(TUSB_PATH)/portable/nordic/nrf5x/hal_nrf5x.c
C_SOURCE_FILES += $(TUSB_PATH)/common/tusb_fifo.c
C_SOURCE_FILES += $(TUSB_PATH)/device/usbd.c
C_SOURCE_FILES += $(TUSB_PATH)/device/usbd_desc.c
C_SOURCE_FILES += $(TUSB_PATH)/class/cdc/cdc_device.c
C_SOURCE_FILES += $(TUSB_PATH)/class/msc/msc_device.c
C_SOURCE_FILES += $(TUSB_PATH)/class/custom/custom_device.c

View File

@ -18,7 +18,7 @@
arm_target_debug_interface_type="ADIv5"
arm_target_device_name="nRF52840_xxAA"
arm_target_interface_type="SWD"
c_preprocessor_definitions="NRF52840_XXAA;__nRF_FAMILY;ARM_MATH_CM4;FLASH_PLACEMENT=1;NO_VTOR_CONFIG;BOARD_FEATHER52840;BOOTLOADER_VERSION=0x06000001;MK_DIS_FIRMWARE="S140 6.0.0, 6.0.0";S140;CONFIG_GPIO_AS_PINRESET;BLE_STACK_SUPPORT_REQD;SWI_DISABLE0;SOFTDEVICE_PRESENT;FLOAT_ABI_HARD"
c_preprocessor_definitions="NRF52840_XXAA;__nRF_FAMILY;ARM_MATH_CM4;FLASH_PLACEMENT=1;NO_VTOR_CONFIG;BOARD_PCA10056;BOOTLOADER_VERSION=0x06000001;MK_DIS_FIRMWARE="S140 6.0.0, 6.0.0";S140;CONFIG_GPIO_AS_PINRESET;BLE_STACK_SUPPORT_REQD;SWI_DISABLE0;SOFTDEVICE_PRESENT;FLOAT_ABI_HARD"
c_user_include_directories="../;../usb;$(TusbDir);$(SdDir)/s140/headers;$(SdDir)/s140/headers/nrf52;$(Sdk11Dir)/drivers_nrf/pstorage;$(Sdk11Dir)/ble/common/;$(Sdk11Dir)/ble/ble_services/ble_dfu;$(Sdk11Dir)/ble/ble_services/ble_dis;$(Sdk11Dir)/libraries/bootloader_dfu;$(Sdk11Dir)/libraries/bootloader_dfu/hci_transport;$(Sdk11Dir)/libraries/util;$(SdkDir)/toolchain/cmsis/include;$(SdkDir)/device;$(SdkDir)/toolchain;$(SdkDir)/drivers_nrf/hal;$(SdkDir)/drivers_nrf/systick;$(SdkDir)/drivers_nrf/uart;$(SdkDir)/drivers_nrf/usbd;$(SdkDir)/drivers_nrf/common;$(SdkDir)/drivers_nrf/delay;$(SdkDir)/drivers_nrf/power;$(SdkDir)/drivers_nrf/clock;$(SdkDir)/libraries/util;$(SdkDir)/libraries/timer;$(SdkDir)/libraries/scheduler;$(SdkDir)/libraries/crc16;$(SdkDir)/libraries/util;$(SdkDir)/libraries/hci/config;$(SdkDir)/libraries/uart;$(SdkDir)/libraries/hci;$(SdkDir)/external/fprintf;$(SdkDir)/libraries/strerror;$(SdkDir)/libraries/atomic;$(SdkDir)/libraries/balloc;$(SdkDir)/libraries/experimental_log/src;$(SdkDir)/libraries/experimental_log;$(SdkDir)/libraries/experimental_section_vars;$(SdkDir)/libraries/experimental_memobj"
debug_register_definition_file="$(ProjectDir)/nrf52840_Registers.xml"
debug_target_connection="J-Link"
@ -244,12 +244,12 @@
c_preprocessor_definitions="DEBUG_SIZE_EXPAND" />
</project>
<configuration
Name="Debug Single"
Name="Debug"
c_preprocessor_definitions="DEBUG"
gcc_debugging_level="Level 3"
gcc_optimization_level="None" />
<configuration
Name="Release Single"
Name="Release"
c_preprocessor_definitions="NDEBUG"
gcc_debugging_level="None"
gcc_omit_frame_pointer="Yes"

View File

@ -279,46 +279,30 @@ app_descriptor_configuration_t const desc_configuration =
//--------------------------------------------------------------------+
// STRING DESCRIPTORS
//--------------------------------------------------------------------+
#define STRING_LEN_UNICODE(n) (2 + (2*(n))) // also includes 2 byte header
#define ENDIAN_BE16_FROM( high, low) ENDIAN_BE16(high << 8 | low)
// array of pointer to string descriptors
uint16_t const * const string_desc_arr [] =
{
[0] = (uint16_t []) { // supported language
ENDIAN_BE16_FROM( STRING_LEN_UNICODE(1), TUSB_DESC_STRING ),
0x0409 // English
},
// 0 index is supported language = English
TUD_DESC_STRCONV(0x0409),
[1] = (uint16_t []) { // manufacturer
ENDIAN_BE16_FROM( STRING_LEN_UNICODE(19), TUSB_DESC_STRING),
'A','d','a','f','r','u','i','t',' ','I','n','d','u','s','t','r','i','e','s'
},
// Manufacturer
TUD_DESC_STRCONV('A','d','a','f','r','u','i','t',' ','I','n','d','u','s','t','r','i','e','s'),
[2] = (uint16_t []) { // product
ENDIAN_BE16_FROM( STRING_LEN_UNICODE(18), TUSB_DESC_STRING),
'B','l','u','e','f','r','u','i','t',' ','n','R','F','5','2','8','4','0'
},
// Product
TUD_DESC_STRCONV('B','l','u','e','f','r','u','i','t',' ','n','R','F','5','2','8','4','0'),
[3] = (uint16_t []) { // serials TODO use chip ID
ENDIAN_BE16_FROM( STRING_LEN_UNICODE(4), TUSB_DESC_STRING),
'1', '2', '3', '4' // len = 4
},
// Serials TODO use chip ID
TUD_DESC_STRCONV('1', '2', '3', '4'),
[4] = (uint16_t []) { // CDC Interface
ENDIAN_BE16_FROM( STRING_LEN_UNICODE(16), TUSB_DESC_STRING),
'B','l','u','e','f','r','u','i','t',' ','S','e','r','i','a','l'
},
// CDC Interface
TUD_DESC_STRCONV('B','l','u','e','f','r','u','i','t',' ','S','e','r','i','a','l'),
[5] = (uint16_t []) { // MSC Interface
ENDIAN_BE16_FROM( STRING_LEN_UNICODE(17), TUSB_DESC_STRING),
'B','l','u','e','f','r','u','i','t',' ','S','t','o','r','a','g','e'
},
// MSC Interface
TUD_DESC_STRCONV('B','l','u','e','f','r','u','i','t',' ','S','t','o','r','a','g','e'),
[6] = (uint16_t []) { // Custom Interface
ENDIAN_BE16_FROM( STRING_LEN_UNICODE(16), TUSB_DESC_STRING),
'B','l','u','e','f','r','u','i','t',' ','C','u','s','t','o','m'
}
// Custom Interface
TUD_DESC_STRCONV('B','l','u','e','f','r','u','i','t',' ','C','u','s','t','o','m')
};