diff --git a/Makefile.platform.sample b/Makefile.platform.sample index 2e1221cb7..5ff0c4748 100644 --- a/Makefile.platform.sample +++ b/Makefile.platform.sample @@ -27,6 +27,10 @@ PLATFORM=PM3RDV4 # Only available with PLATFORM=PM3GENERIC #LED_ORDER=PM3EASY +# Uncomment a line below to change default USART baud rate +# defaults to 115200 used by HC-05 in Blueshark +#USART_BAUD_RATE=19200 + # Uncomment the lines below in order to make a 256KB image # and comment out the lines above diff --git a/common_arm/Makefile.hal b/common_arm/Makefile.hal index f9bb9065e..e317ea247 100644 --- a/common_arm/Makefile.hal +++ b/common_arm/Makefile.hal @@ -252,6 +252,10 @@ endif # WITH_FPC_USART_* needs WITH_FPC_USART : ifneq (,$(findstring WITH_FPC_USART_,$(PLATFORM_DEFS))) PLATFORM_DEFS += -DWITH_FPC_USART + ifeq ($(USART_BAUD_RATE),) + USART_BAUD_RATE=115200 + endif + PLATFORM_DEFS += -DUSART_BAUD_RATE=$(USART_BAUD_RATE) endif PLATFORM_DEFS_INFO = $(strip $(filter-out STANDALONE%, $(subst -DWITH_,,$(PLATFORM_DEFS)))) diff --git a/include/usart_defs.h b/include/usart_defs.h index 501f66464..84d6ff17c 100644 --- a/include/usart_defs.h +++ b/include/usart_defs.h @@ -16,8 +16,9 @@ #ifndef __USART_DEFS_H #define __USART_DEFS_H -//#define USART_BAUD_RATE 9600 +#ifndef USART_BAUD_RATE #define USART_BAUD_RATE 115200 +#endif // BT HC-06 physical layer runs at 128kbps // so it's possible to gain a little bit by using 230400 // with some risk to overflow its internal buffers: