Thu, 07 Jun 2018 14:04:45 +0300Use the same retain implementation for Win32 targets
Andrey Skvortsov <andrej.skvortzov@gmail.com> [Thu, 07 Jun 2018 14:04:45 +0300] rev 2174
Use the same retain implementation for Win32 targets

Currently plc_Win32_main_retain.c is exact copy of
plc_Linux_main_retain.c, because it's not possible to use symbol
links.

It'd be nice in the future to have possibility to modify targets.code.

Thu, 07 Jun 2018 13:45:35 +0300Add retain basic implementation on GNU/Linux
Andrey Skvortsov <andrej.skvortzov@gmail.com> [Thu, 07 Jun 2018 13:45:35 +0300] rev 2173
Add retain basic implementation on GNU/Linux

Retain is saved in file and backup of this file is done every time.
File isn't saved on every PLC cycle to avoid high I/O load.
By default, retain is saved every second and on PLC stop/shutdown.
It's possible to override retain flush period by using CFLAGS option
in project's settings. For example, for 0.5 seconds period
use "-DFILE_RETAIN_SAVE_PERIOD_S=0.5".

Fri, 01 Jun 2018 15:46:17 +0300Add helper function GetRetainSize()
Andrey Skvortsov <andrej.skvortzov@gmail.com> [Fri, 01 Jun 2018 15:46:17 +0300] rev 2172
Add helper function GetRetainSize()

it will be useful for retain implementations.

Fri, 01 Jun 2018 12:21:37 +0300use CLOCK_MONOTONIC instead of CLOCK_REALTIME for timer setup
Andrey Skvortsov <andrej.skvortzov@gmail.com> [Fri, 01 Jun 2018 12:21:37 +0300] rev 2171
use CLOCK_MONOTONIC instead of CLOCK_REALTIME for timer setup

CLOCK_REALTIME is a wall clock, that could change back and forth (user
changes system time, winter/summer time, NTP corrections and so on).
For real-time application CLOCK_MONOTONIC should be used, it doesn't
have such jumps.

Thu, 31 May 2018 13:07:10 +0300Add function example to first_steps example
Surkov Sergey <surkovsv93@gmail.com> [Thu, 31 May 2018 13:07:10 +0300] rev 2170
Add function example to first_steps example

It'll be used in documentation to show how to create function in
Beremiz.

Fri, 25 May 2018 18:37:59 +0300fix type introduced by f33942053466 (fix pylint warning "(undefined-loop-variable) Using possibly undefined loop variable 'X'")
Andrey Skvortsov <andrej.skvortzov@gmail.com> [Fri, 25 May 2018 18:37:59 +0300] rev 2169
fix type introduced by f33942053466 (fix pylint warning "(undefined-loop-variable) Using possibly undefined loop variable 'X'")

Fri, 25 May 2018 18:34:05 +0300Build by default with optimization level -O2 for GCC
Andrey Skvortsov <andrej.skvortzov@gmail.com> [Fri, 25 May 2018 18:34:05 +0300] rev 2168
Build by default with optimization level -O2 for GCC

before -O0 was used by default, that caused pretty bad performance.

Amd64, i6700k, 4200MHz, GNU/Linux (non-RT kernel), gcc 7.2.0

-------------------------------------
Optimization | EN/ENO |no EN/ENO |
-------------------------------------
default | 11 | 9.5 |
-O3 | 3.9 | 5.2 |
-O2 | 4 | 4.8 |
-Os | 4.1 | 3.5 |
-Ofast | 3.9 | 5.2 |
-------------------------------------

ARM, BBB Cortex-A8, 600Mhz, GNU/Linux, gcc 4.6.3

-------------------------------------
Optimization | EN/ENO |no EN/ENO |
-------------------------------------
default | 273 | 226 |
-O3 | 141.8 | 106.2 |
-O2 | 142 | 107 |
-Os | 152.5 | 112.2 |
-Ofast | 141.7 | 106.2 |
-------------------------------------

For embedded systems with size constaints (like Cortex-Mx, AVR and so
on) I usually use -Os. It gets pretty good results. For
GNU/Linux-based systems -O2 is usually a good choice, as you see the
test results.