clean up BLEDIS firmware version

This commit is contained in:
hathach 2019-04-24 17:13:41 +07:00
parent b3b9e089f4
commit 5eac387b5a
No known key found for this signature in database
GPG Key ID: 2FA891220FBFD581
3 changed files with 9 additions and 21 deletions

View File

@ -29,9 +29,6 @@ LD_FILE = $(SRC_PATH)/linker/$(SD_NAME)_v$(SD_VER1).ld
MERGED_FNAME = $(OUTPUT_FILENAME)_$(SD_NAME)_$(SD_VERSION)
MK_DIS_FIRMWARE = "$(SD_NAME) $(SD_VERSION)"
GIT_VERSION = $(shell git describe --dirty --always --tags)
GIT_SUBMODULE_VERSIONS = $(shell git submodule status | cut -d' ' -f3,4 | paste -s -d" " -)
@ -225,7 +222,6 @@ IPATH += $(SDK_PATH)/drivers_nrf/delay
IPATH += $(SD_API_PATH)/include
IPATH += $(SD_API_PATH)/include/nrf52
INC_PATHS = $(addprefix -I,$(IPATH))
#******************************************************************************
@ -255,10 +251,10 @@ CFLAGS += -DBLE_STACK_SUPPORT_REQD
CFLAGS += -DSWI_DISABLE0
CFLAGS += -DSOFTDEVICE_PRESENT
CFLAGS += -DFLOAT_ABI_HARD
CFLAGS += -DMK_DIS_FIRMWARE='$(MK_DIS_FIRMWARE)'
CFLAGS += -DDFU_APP_DATA_RESERVED=7*4096
CFLAGS += -DUF2_VERSION='"$(GIT_VERSION) $(GIT_SUBMODULE_VERSIONS) $(SD_NAME) $(SD_VERSION)"'
CFLAGS += -DBLEDIS_FW_VERSION='"$(GIT_VERSION) $(SD_NAME) $(SD_VERSION)"'
ifneq ($(IS_52832),)
CFLAGS += -DNRF52

View File

@ -996,18 +996,7 @@ static void services_init(void)
ascii_to_utf8(&dis_init.manufact_name_str, BLEDIS_MANUFACTURER);
ascii_to_utf8(&dis_init.model_num_str, BLEDIS_MODEL);
uint32_t const sd_id = SD_ID_GET(MBR_SIZE);
uint32_t const sd_version = SD_VERSION_GET(MBR_SIZE);
uint32_t const ver1 = sd_version / 1000000;
uint32_t const ver2 = (sd_version % 1000000)/1000;
uint32_t const ver3 = sd_version % 1000;
char fw_str[30+1];
sprintf(fw_str, "s%ld %ld.%ld.%ld r%ld", sd_id, ver1, ver2, ver3, MK_BOOTLOADER_VERSION & 0xFFUL);
ascii_to_utf8(&dis_init.fw_rev_str, fw_str);
ascii_to_utf8(&dis_init.fw_rev_str, BLEDIS_FW_VERSION);
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&dis_init.dis_attr_md.read_perm);
BLE_GAP_CONN_SEC_MODE_SET_NO_ACCESS(&dis_init.dis_attr_md.write_perm);

View File

@ -19,7 +19,7 @@
arm_target_device_name="nRF52840_xxAA"
arm_target_interface_type="SWD"
build_treat_warnings_as_errors="Yes"
c_preprocessor_definitions="__nRF_FAMILY;ARM_MATH_CM4;FLASH_PLACEMENT=1;NO_VTOR_CONFIG;MK_BOOTLOADER_VERSION=0x06010000;CONFIG_GPIO_AS_PINRESET;BLE_STACK_SUPPORT_REQD;SWI_DISABLE0;SOFTDEVICE_PRESENT;FLOAT_ABI_HARD;CFG_TUSB_DEBUG=2;UF2_VERSION="Segger""
c_preprocessor_definitions="__nRF_FAMILY;ARM_MATH_CM4;FLASH_PLACEMENT=1;NO_VTOR_CONFIG;MK_BOOTLOADER_VERSION=0x06010000;CONFIG_GPIO_AS_PINRESET;CONFIG_NFCT_PINS_AS_GPIOS;BLE_STACK_SUPPORT_REQD;SWI_DISABLE0;SOFTDEVICE_PRESENT;FLOAT_ABI_HARD;CFG_TUSB_DEBUG=2;UF2_VERSION="Segger";BLEDIS_FW_VERSION="Segger""
c_user_include_directories="../;../usb;../boards;../cmsis/include;$(tusbDir);$(nrfxDir);$(nrfxDir)/mdk;$(nrfxDir)/hal;$(nrfxDir)/drivers/include;$(sdDir)/include;$(sdDir)/include/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"
@ -375,17 +375,20 @@
</folder>
<configuration
Name="Feather52840"
c_preprocessor_definitions="NRF52840_XXAA;MK_DIS_FIRMWARE=&quot;s140 6.1.1 r0&quot;;S140;BOARD_FEATHER_NRF52840_EXPRESS;BOARD_HEADER_FILE=&quot;feather_nrf52840_express.h&quot;"
c_preprocessor_definitions="NRF52840_XXAA;S140"
c_user_include_directories=".;../boards/feather_nrf52840_express"
gcc_optimization_level="Debug"
linker_memory_map_file="nRF52840_xxAA_MemoryMap.xml" />
<configuration
Name="Feather52832"
c_preprocessor_definitions="NRF52832_XXAA;MK_DIS_FIRMWARE=&quot;s132 6.1.1 r0&quot;;S132;BOARD_FEATHER_NRF52832;BOARD_HEADER_FILE=&quot;feather_nrf52832.h&quot;"
c_preprocessor_definitions="NRF52832_XXAA;S132"
c_user_include_directories=".;../boards/feather_nrf52832"
gcc_optimization_level="Debug"
linker_memory_map_file="nRF52832_xxAA_MemoryMap.xml" />
<configuration
Name="PCA10056"
c_preprocessor_definitions="NRF52840_XXAA;MK_DIS_FIRMWARE=&quot;s140 6.1.1 r0&quot;;S140;BOARD_PCA10056;BOARD_HEADER_FILE=&quot;pca10056.h&quot;"
c_preprocessor_definitions="NRF52840_XXAA;S140"
c_user_include_directories=".;../boards/pca10056"
gcc_optimization_level="Debug"
linker_memory_map_file="nRF52840_xxAA_MemoryMap.xml" />
</project>