Bugfix/bacnet real endian simplify (#89)
* Remove dependence on endian define * Make use of existing big_endian function if BACNET_BIG_ENDIAN is not defined * Add efficient endian macro option if available Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
@@ -256,7 +256,6 @@
|
||||
<name>CCDefines</name>
|
||||
<state>BACDL_MSTP=1</state>
|
||||
<state>MAX_APDU=50</state>
|
||||
<state>BIG_ENDIAN=0</state>
|
||||
<state>MAX_TSM_TRANSACTIONS=0</state>
|
||||
<state>BACAPP_REAL</state>
|
||||
<state>BACAPP_UNSIGNED</state>
|
||||
@@ -1318,7 +1317,6 @@
|
||||
<state>NDEBUG</state>
|
||||
<state>BACDL_MSTP</state>
|
||||
<state>MAX_APDU=50</state>
|
||||
<state>BIG_ENDIAN=0</state>
|
||||
<state>MAX_TSM_TRANSACTIONS=0</state>
|
||||
<state>BACAPP_REAL</state>
|
||||
<state>BACAPP_UNSIGNED</state>
|
||||
|
||||
+24
-25
@@ -1,9 +1,9 @@
|
||||
This port was done with the Atmel ATmega168 using two tools:
|
||||
1. The WinAVR compiler avr-gcc (GCC) 4.1.2 (WinAVR 20070525)
|
||||
and tools from <http://winavr.sourceforge.net/>, hints and
|
||||
sample code from <http://www.avrfreaks.net/> and
|
||||
and tools from <http://winavr.sourceforge.net/>, hints and
|
||||
sample code from <http://www.avrfreaks.net/> and
|
||||
<http://savannah.gnu.org/projects/avr-libc/>.
|
||||
"avr-binutils, avr-gcc, and avr-libc form the heart of the
|
||||
"avr-binutils, avr-gcc, and avr-libc form the heart of the
|
||||
Free Software toolchain for the Atmel AVR microcontrollers."
|
||||
2. AVR Studio from Atmel <http://atmel.com/>
|
||||
|
||||
@@ -29,16 +29,16 @@ server. dlmstp is the datalink layer for MS/TP over RS-485.
|
||||
I used the makefile from the command line on Windows:
|
||||
C:\code\bacnet-stack\ports\atmega168> make clean all
|
||||
|
||||
CStack check for GCC is included in the device object as property 512.
|
||||
CStack check for GCC is included in the device object as property 512.
|
||||
The compile shows 648 bytes of RAM used, and the ATmega168 has 1024 bytes
|
||||
of RAM, leaving 376 for the CStack. Property 512 index 0 returns 376 from
|
||||
a ReadProperty request. My understanding is that the remaining unallocated
|
||||
RAM is used for the CStack. Keep this in mind when developing.
|
||||
After some ReadProperty and WriteProperty requests, the CStack shows
|
||||
159 CStack bytes free, meaning that 216 bytes of CStack are used.
|
||||
Note that the value 0xC5 (197) was used to paint the CStack.
|
||||
RAM is used for the CStack. Keep this in mind when developing.
|
||||
After some ReadProperty and WriteProperty requests, the CStack shows
|
||||
159 CStack bytes free, meaning that 216 bytes of CStack are used.
|
||||
Note that the value 0xC5 (197) was used to paint the CStack.
|
||||
|
||||
I also used the bacnet.aps project file in AVR Studio to
|
||||
I also used the bacnet.aps project file in AVR Studio to
|
||||
make the project and simulate it, but have not kept it updated (FIXME).
|
||||
|
||||
Compiler settings for IAR Embedded Workbench (FIXME: makefile?):
|
||||
@@ -95,14 +95,13 @@ List
|
||||
Output assembler file (enabled)
|
||||
Preprocessor
|
||||
Ignore standard include paths (not enabled)
|
||||
Include paths:
|
||||
Include paths:
|
||||
$PROJ_DIR$
|
||||
$PROJ_DIR$\..\..\include
|
||||
Preinclude file: (none)
|
||||
Defined symbols:
|
||||
Defined symbols:
|
||||
BACDL_MSTP
|
||||
MAX_APDU=50
|
||||
BIG_ENDIAN=0
|
||||
MAX_TSM_TRANSACTIONS=0
|
||||
BACAPP_REAL
|
||||
BACAPP_UNSIGNED
|
||||
@@ -110,34 +109,34 @@ Preprocessor
|
||||
BACAPP_CHARACTER_STRING
|
||||
BACAPP_OBJECT_ID
|
||||
WRITE_PROPERTY
|
||||
Diagnostics
|
||||
Diagnostics
|
||||
(not enabled)
|
||||
MISRA C
|
||||
(not enabled)
|
||||
Extra Options
|
||||
Use command line options (not enabled)
|
||||
|
||||
Note: The BACnet Stack at Sourceforge source code has to be built
|
||||
with lots of different compilers. The IAR compiler has particularly
|
||||
strong (pedantic) source checking and generates several warnings when
|
||||
compiling the source code. Unfortunately not all warnings can be
|
||||
fixed by modifying the source code. Some warnings have therefore been
|
||||
Note: The BACnet Stack at Sourceforge source code has to be built
|
||||
with lots of different compilers. The IAR compiler has particularly
|
||||
strong (pedantic) source checking and generates several warnings when
|
||||
compiling the source code. Unfortunately not all warnings can be
|
||||
fixed by modifying the source code. Some warnings have therefore been
|
||||
disabled in the project file.
|
||||
Compiler Diagnostics:
|
||||
(Pe550) I initilize all local variables as a best practice.
|
||||
Linker Diagnostics:
|
||||
(w31) The supplied standard libraries expect char parameters to
|
||||
be unsigned (in functions such as strncpy(), etc.). It may
|
||||
(w31) The supplied standard libraries expect char parameters to
|
||||
be unsigned (in functions such as strncpy(), etc.). It may
|
||||
be possible to recompile the libraries with signed plain char's.
|
||||
|
||||
The BACnet Capabilities include WhoIs, I-Am, ReadProperty, and
|
||||
The BACnet Capabilities include WhoIs, I-Am, ReadProperty, and
|
||||
WriteProperty support. The BACnet objects include a Device object,
|
||||
10 Binary Value objects, and 10 Analog Value objects. An LED is
|
||||
10 Binary Value objects, and 10 Analog Value objects. An LED is
|
||||
controlled by Binary Value object instance 0. All required object
|
||||
properties can be retrieved using ReadProperty. The Present_Value
|
||||
property of the Analog Value and Binary Value objects can be
|
||||
written using WriteProperty. The Object_Identifier, Object_Name,
|
||||
Max_Info_Frames, Max_Master, and baud rate (property 9600) of the
|
||||
property of the Analog Value and Binary Value objects can be
|
||||
written using WriteProperty. The Object_Identifier, Object_Name,
|
||||
Max_Info_Frames, Max_Master, and baud rate (property 9600) of the
|
||||
Device object can be written using WriteProperty.
|
||||
|
||||
With full optimization, the statistics on the demo are:
|
||||
|
||||
Reference in New Issue
Block a user