Updated some ARM and AVR ports projects which needed changes to API for some BACnet objects. Compiled with IAR ARM and AVR compiler.

This commit is contained in:
skarg
2013-05-22 17:44:57 +00:00
parent f52fc092e5
commit 81d69f910d
19 changed files with 2417 additions and 1444 deletions
+19 -18
View File
@@ -31,10 +31,11 @@
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
/*#include "mstp.h" */
#include "bits.h"
/* This file has been customized for use with ATMEGA168 */
#if defined(__AVR_ATmega168__)
#if (defined(__ICCAVR__) && (defined(__ATmega168__))) || \
(defined(__GNUC__) && defined(__AVR_ATmega168__))
/* USART defines for RS-485 port */
#define UCSRB UCSR0B
#define TXEN TXEN0
@@ -152,6 +153,22 @@ bool RS485_Set_Baud_Rate(
return valid;
}
/****************************************************************************
* DESCRIPTION: Enable or disable the transmitter
* RETURN: none
* ALGORITHM: none
* NOTES: none
*****************************************************************************/
void RS485_Transmitter_Enable(
bool enable)
{
if (enable) {
BIT_SET(PORTD, PD2);
} else {
BIT_CLEAR(PORTD, PD2);
}
}
/****************************************************************************
* DESCRIPTION: Waits on the SilenceTimer for 40 bits.
* RETURN: none
@@ -181,22 +198,6 @@ void RS485_Turnaround_Delay(
BIT_SET(UCSR0A, TXC0);
}
/****************************************************************************
* DESCRIPTION: Enable or disable the transmitter
* RETURN: none
* ALGORITHM: none
* NOTES: none
*****************************************************************************/
void RS485_Transmitter_Enable(
bool enable)
{
if (enable) {
BIT_SET(PORTD, PD2);
} else {
BIT_CLEAR(PORTD, PD2);
}
}
/****************************************************************************
* DESCRIPTION: Send some data and wait until it is sent
* RETURN: none