Updated Makefile GCC ARM build for STM32F10x port.
This commit is contained in:
@@ -103,15 +103,18 @@ router-ipv6:
|
||||
$(MAKE) -B -s -C demo router-ipv6
|
||||
|
||||
# Add "ports" to the build, if desired
|
||||
ports: atmega168 bdk-atxx4-mstp at91sam7s
|
||||
ports: atmega168 bdk-atxx4-mstp at91sam7s stm32f10x
|
||||
@echo "Built the ARM7 and AVR ports"
|
||||
|
||||
atmega168: ports/atmega168/Makefile
|
||||
$(MAKE) -s -C ports/atmega168 clean all
|
||||
|
||||
at91sam7s: ports/at91sam7s/makefile
|
||||
at91sam7s: ports/at91sam7s/Makefile
|
||||
$(MAKE) -s -C ports/at91sam7s clean all
|
||||
|
||||
stm32f10x: ports/stm32f10x/Makefile
|
||||
$(MAKE) -s -C ports/stm32f10x clean all
|
||||
|
||||
mstpsnap: ports/linux/mstpsnap.mak
|
||||
$(MAKE) -s -C ports/linux -f mstpsnap.mak clean all
|
||||
|
||||
|
||||
@@ -138,6 +138,9 @@ BACNET_FLAGS += -DBIG_ENDIAN=0
|
||||
BACNET_FLAGS += -DMAX_TSM_TRANSACTIONS=0
|
||||
BACNET_FLAGS += -DMAX_CHARACTER_STRING_BYTES=64
|
||||
BACNET_FLAGS += -DMAX_OCTET_STRING_BYTES=64
|
||||
# if called from root Makefile, PRINT was already defined
|
||||
BACNET_FLAGS += -UPRINT_ENABLED
|
||||
BACNET_FLAGS += -DPRINT_ENABLED=0
|
||||
|
||||
CFLAGS += $(MCU_FLAGS)
|
||||
CFLAGS += $(OPTIMIZE_FLAGS)
|
||||
@@ -153,6 +156,8 @@ CFLAGS += -fno-common
|
||||
CFLAGS += -Wall
|
||||
# don't warn about missing braces since GCC is over-achiever for this
|
||||
CFLAGS += -Wno-missing-braces
|
||||
# don't warn about missing prototypes since STM32 library doesn't have some
|
||||
CFLAGS += -Wno-missing-prototypes
|
||||
|
||||
# -Wa,<options> Pass comma-separated <options> on to the assembler
|
||||
AFLAGS = -Wa,-ahls,-mapcs-32,-adhlns=$(<:.s=.lst)
|
||||
|
||||
@@ -80,6 +80,7 @@ static BACNET_DEVICE_STATUS System_Status = STATUS_OPERATIONAL;
|
||||
static BACNET_CHARACTER_STRING My_Object_Name;
|
||||
static uint32_t Database_Revision;
|
||||
static BACNET_REINITIALIZED_STATE Reinitialize_State = BACNET_REINIT_IDLE;
|
||||
static const char *Reinit_Password = "stm32-challenge";
|
||||
|
||||
/* These three arrays are used by the ReadPropertyMultiple handler */
|
||||
static const int Device_Properties_Required[] = {
|
||||
@@ -362,15 +363,37 @@ bool Device_Reinitialize(
|
||||
{
|
||||
bool status = false;
|
||||
|
||||
if (characterstring_ansi_same(&rd_data->password, "stm32-challenge")) {
|
||||
Reinitialize_State = rd_data->state;
|
||||
/* Note: you could use a mix of state and password to multiple things */
|
||||
if (characterstring_ansi_same(&rd_data->password, Reinit_Password)) {
|
||||
switch (rd_data->state) {
|
||||
case BACNET_REINIT_COLDSTART:
|
||||
case BACNET_REINIT_WARMSTART:
|
||||
dcc_set_status_duration(COMMUNICATION_ENABLE, 0);
|
||||
/* Note: you could use a mix of state
|
||||
and password to multiple things */
|
||||
/* note: you probably want to restart *after* the
|
||||
simple ack has been sent from the return handler
|
||||
so just set a flag from here */
|
||||
status = true;
|
||||
Reinitialize_State = rd_data->state;
|
||||
status = true;
|
||||
break;
|
||||
case BACNET_REINIT_STARTBACKUP:
|
||||
case BACNET_REINIT_ENDBACKUP:
|
||||
case BACNET_REINIT_STARTRESTORE:
|
||||
case BACNET_REINIT_ENDRESTORE:
|
||||
case BACNET_REINIT_ABORTRESTORE:
|
||||
if (dcc_communication_disabled()) {
|
||||
rd_data->error_class = ERROR_CLASS_SERVICES;
|
||||
rd_data->error_code = ERROR_CODE_COMMUNICATION_DISABLED;
|
||||
} else {
|
||||
rd_data->error_class = ERROR_CLASS_SERVICES;
|
||||
rd_data->error_code =
|
||||
ERROR_CODE_OPTIONAL_FUNCTIONALITY_NOT_SUPPORTED;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
rd_data->error_class = ERROR_CLASS_SERVICES;
|
||||
rd_data->error_code = ERROR_CODE_PARAMETER_OUT_OF_RANGE;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
rd_data->error_class = ERROR_CLASS_SECURITY;
|
||||
rd_data->error_code = ERROR_CODE_PASSWORD_FAILURE;
|
||||
|
||||
@@ -46,7 +46,8 @@
|
||||
#include "stm32f10x_tim.h"
|
||||
#include "stm32f10x_usart.h"
|
||||
#include "stm32f10x_wwdg.h"
|
||||
#include "stm32f10x_misc.h" /* High level functions for NVIC and SysTick (add-on to CMSIS functions) */
|
||||
/* High level functions for NVIC and SysTick (add-on to CMSIS functions) */
|
||||
#include "stm32f10x_misc.h"
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user