tests/BACnet/bacnet_0@bacnet/bacnet_slave
author Andrey Skvortsov <andrej.skvortzov@gmail.com>
Sun, 06 Jan 2019 03:11:39 +0300
changeset 2501 eba2bbb2dd9a
parent 2254 3145dcffc6ed
permissions -rw-r--r--
Make online debug optional

It could be useful for very small targets like Atmega (Arduino) and
for target bring-up there developer want to have running PLC program,
but has not implemented runtime communication yet.


TARGET_DEBUG_AND_RETAIN_DISABLE - completely disable debug and retain
functionality. Previously named TARGET_DEBUG_DISABLE.

TARGET_ONLINE_DEBUG_DISABLE - can be used to enable retain
functionality (no define TARGET_DEBUG_AND_RETAIN_DISABLE is used), but disable
online debug with corresponding RAM/FLASH overhead.

TARGET_LOGGING_DISABLE - disables logging functionality from runtime and PLC program

TARGET_EXT_SYNC_DISABLE - disables PLC program synchronization with
external events. For example, it could be used to synchronize several
PLCs that control motors for different axes.

By default all these options are off.

To test generate program for Generic target, put following files in
project files directory and run build.sh after generating PLC program.
This is very easy to integrate into makefile (Generic target).

[------------- build.sh --------------------------]
files=$(find $PWD/../build -iname '*.c' | grep -v POUS.c)
arm-none-eabi-gcc \
-DTARGET_DEBUG_AND_RETAIN_DISABLE \
-DTARGET_ONLINE_DEBUG_DISABLE \
-DTARGET_LOGGING_DISABLE \
-DTARGET_EXT_SYNC_DISABLE \
-flto -ffunction-sections -fdata-sections -I../../../../matiec/lib/C \
$files \
main.c \
-Wl,--Map=./program.map,--cref \
-nodefaultlibs --specs=nano.specs -Wl,--static -Wl,--gc-section -Wl,--start-group -lc -lm -lnosys -lgcc -Wl,--end-group
[------------------------------------------------]

[------------- main.c --------------------------]
#ifndef TARGET_DEBUG_AND_RETAIN_DISABLE
void Retain(void){}
void InValidateRetainBuffer(void){}
void ValidateRetainBuffer(void){}
#endif

extern void __run(void);
int main(void)
{
for(;;) {
__run();
// sleep common_ticktime__ ns
// add common_ticktime__ ns to __CURRENT_TIME
}
return 0;
}
[------------------------------------------------]
(dp0
S'BV_Obj'
p1
(lp2
sS'AV_Obj'
p3
(lp4
(dp5
S'loc'
p6
S'MD0_2'
p7
sS'Description'
p8
S''
p9
sS'Unit ID'
p10
I19
sS'Object Identifier'
p11
I0
sS'Ctype'
p12
S'float'
p13
sS'BACnetObjTypeID'
p14
I2
sS'Settable'
p15
S'Y'
p16
sS'Engineering Units'
p17
V(Energy) kilowatt-hours (19)
p18
sS'Object Name'
p19
VEnergyCounter
p20
sasS'AO_Obj'
p21
(lp22
(dp23
g6
S'QD0_1'
p24
sg8
V
p25
sS'Unit ID'
p26
I62
sS'Object Identifier'
p27
V0
p28
sg12
g13
sg14
I1
sg15
g16
sS'Object Name'
p29
VTemperatureSetPoint
p30
sS'Engineering Units'
p31
V(Temperature) degrees-celsius (62)
p32
sasS'MSI_Obj'
p33
(lp34
sS'BO_Obj'
p35
(lp36
(dp37
g6
S'QX0_4'
p38
sg8
g9
sS'Object Identifier'
p39
I2
sg12
S'uint8_t'
p40
sg14
I4
sg15
g16
sS'Object Name'
p41
VBlockClimateControl
p42
sasS'MSO_Obj'
p43
(lp44
sS'EDEfile_parm'
p45
(dp46
S'next_EDE_file_version'
p47
I1
ssS'BI_Obj'
p48
(lp49
(dp50
g6
S'IX0_3'
p51
sg8
g9
sS'Object Identifier'
p52
I0
sg12
g40
sg14
I3
sg15
S'N'
p53
sS'Object Name'
p54
VHeater
p55
sa(dp56
g6
g51
sg8
g9
sg52
I1
sg12
g40
sg14
I3
sg15
g53
sg54
VCooler
p57
sasS'AI_Obj'
p58
(lp59
(dp60
g6
S'ID0_0'
p61
sg8
VCurrent termperature in Beremiz lab
p62
sS'Unit ID'
p63
I62
sS'Object Identifier'
p64
I0
sg12
g13
sg14
I0
sg15
g53
sS'Engineering Units'
p65
V(Temperature) degrees-celsius (62)
p66
sS'Object Name'
p67
VTemperature
p68
sa(dp69
g6
g61
sg8
VCurrent humidity in Beremiz lab
p70
sg63
I29
sg64
I1
sg12
g13
sg14
I0
sg15
g53
sg67
VHumidity
p71
sg65
V(Humidity) percent-relative-humidity (29)
p72
sasS'MSV_Obj'
p73
(lp74
s.