diff --git a/bacnet-stack/ports/pic18f6720/BACnet-Server.mcw b/bacnet-stack/ports/pic18f6720/BACnet-Server.mcw index 679e31fb..e1221fac 100644 Binary files a/bacnet-stack/ports/pic18f6720/BACnet-Server.mcw and b/bacnet-stack/ports/pic18f6720/BACnet-Server.mcw differ diff --git a/bacnet-stack/ports/pic18f6720/dlmstp.c b/bacnet-stack/ports/pic18f6720/dlmstp.c index d9cefce9..433f15ed 100644 --- a/bacnet-stack/ports/pic18f6720/dlmstp.c +++ b/bacnet-stack/ports/pic18f6720/dlmstp.c @@ -77,31 +77,6 @@ void dlmstp_init( RS485_Initialize(); MSTP_Port.InputBuffer = &Receive_Buffer.pdu[0]; MSTP_Init(&MSTP_Port); - /* FIXME: implement your data storage */ - data = 64; /* I2C_Read_Byte( - EEPROM_DEVICE_ADDRESS, - EEPROM_MSTP_MAC_ADDR); */ - if (data <= 127) - MSTP_Port.This_Station = data; - else - dlmstp_set_my_address(DEFAULT_MAC_ADDRESS); - /* FIXME: implement your data storage */ - data = 127; /* I2C_Read_Byte( - EEPROM_DEVICE_ADDRESS, - EEPROM_MSTP_MAX_MASTER_ADDR); */ - if ((data <= 127) && (data >= MSTP_Port.This_Station)) - MSTP_Port.Nmax_master = data; - else - dlmstp_set_max_master(DEFAULT_MAX_MASTER); - /* FIXME: implement your data storage */ - data = 1; - /* I2C_Read_Byte( - EEPROM_DEVICE_ADDRESS, - EEPROM_MSTP_MAX_INFO_FRAMES_ADDR); */ - if (data >= 1) - MSTP_Port.Nmax_info_frames = data; - else - dlmstp_set_max_info_frames(DEFAULT_MAX_INFO_FRAMES); } void dlmstp_cleanup( diff --git a/bacnet-stack/ports/pic18f6720/main.c b/bacnet-stack/ports/pic18f6720/main.c index 49ad0c3d..ed9ea0f5 100644 --- a/bacnet-stack/ports/pic18f6720/main.c +++ b/bacnet-stack/ports/pic18f6720/main.c @@ -231,7 +231,6 @@ void Initialize_Variables( ENABLE_TIMER4_INT(); /* interrupts must be enabled before we read our inputs */ Global_Int(INT_ENABLED); - dlmstp_init(); /* Start our time from now */ Milliseconds = 0; } @@ -259,6 +258,12 @@ void main( RCONbits.NOT_RI = 1; Hardware_Initialize(); Initialize_Variables(); + /* initialize BACnet Data Link Layer */ + dlmstp_set_my_address(42); + dlmstp_set_max_info_frames(1); + dlmstp_set_max_master(127); + RS485_Set_Baud_Rate(38400); + dlmstp_init(); /* Handle anything that needs to be done on powerup */ /* Greet the BACnet world! */ Send_I_Am(&Handler_Transmit_Buffer[0]); diff --git a/bacnet-stack/ports/pic18f6720/mstp.c b/bacnet-stack/ports/pic18f6720/mstp.c index 1509d15f..0e184c00 100644 --- a/bacnet-stack/ports/pic18f6720/mstp.c +++ b/bacnet-stack/ports/pic18f6720/mstp.c @@ -697,11 +697,7 @@ bool MSTP_Master_Node_FSM( mstp_port->FrameCount = mstp_port->Nmax_info_frames; mstp_port->master_state = MSTP_MASTER_STATE_DONE_WITH_TOKEN; transition_now = true; - } else if (mstp_port->SilenceTimer > Tusage_delay) { - /* if we missed our timing deadline, another token will be sent */ - mstp_port->master_state = MSTP_MASTER_STATE_IDLE; } else { - /* don't send it if we are too late in getting out */ uint8_t destination = mstp_port->TxBuffer[3]; RS485_Send_Frame(mstp_port, (uint8_t *) & mstp_port->TxBuffer[0], mstp_port->TxLength);