added build number tagging

This commit is contained in:
Eric Evenchick 2015-01-28 11:38:05 -05:00
parent 9e8ea404d9
commit 4de4954d5e
3 changed files with 12 additions and 2 deletions

View File

@ -12,4 +12,4 @@ before_script:
- echo $PATH
- @echo 'Installed gcc-arm-none-eabi.'
script: make
script: make BUILD_NUMBER=%{build_number}

View File

@ -8,6 +8,7 @@
# user configuration:
#######################################
BUILD_NUMBER ?= 0
# SOURCES: list of sources in the user application
SOURCES = main.c usbd_conf.c usbd_cdc_if.c usb_device.c usbd_desc.c stm32f0xx_hal_msp.c stm32f0xx_it.c system_stm32f0xx.c can.c slcan.c
@ -23,6 +24,7 @@ LD_SCRIPT = STM32F042C6_FLASH.ld
# USER_DEFS user defined macros
USER_DEFS = -D HSI48_VALUE=48000000 -D HSE_VALUE=16000000
USER_DEFS += -D CANTACT_BUILD_NUMBER=$(BUILD_NUMBER)
# USER_INCLUDES: user defined includes
USER_INCLUDES =

View File

@ -56,7 +56,15 @@
/** @defgroup USBD_DESC_Private_Defines
* @{
*/
#define CANTACT_SW_VER "v0.1"
#define STRINGIZE_(x) #x
#define STRINGIZE(x) STRINGIZE_(x)
#if CANTACT_BUILD_NUMBER == 0
#define CANTACT_SW_VER "dev"
#else
#define CANTACT_SW_VER "b" STRINGIZE(CANTACT_BUILD_NUMBER)
#endif
#define USBD_VID 0xad50
#define USBD_LANGID_STRING 1033
#define USBD_MANUFACTURER_STRING "CANtact"