tests/syntax/configuration/configuration.txt
author Andrey Skvortsov <andrej.skvortzov@gmail.com>
Fri, 06 May 2016 11:38:35 +0300
changeset 1007 afb3974f8fb3
parent 109 3af0b849b9c6
permissions -rwxr-xr-x
fix warning about overflow if matiec is running on 64-bit platform,
but the generated C code will cross-compiled for 32-bit platform

For example:
./build/config.c:29:39: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
unsigned long greatest_tick_count__ = 18446744073709551611UL; /*tick*/
^
compilation terminated due to -Wfatal-errors.
cc1: all warnings being treated as errors



PROGRAM foo
VAR_INPUT
  single, interval, priority : BOOL;
END_VAR
  LD single
  LD interval
  LD priority
END_PROGRAM


PROGRAM priority
VAR_INPUT
  bar : BOOL;
END_VAR
  LD bar
END_PROGRAM


PROGRAM single
VAR_INPUT
  bar : BOOL;
END_VAR
  LD bar
END_PROGRAM


PROGRAM interval
VAR_INPUT
  bar : BOOL;
END_VAR
  LD bar
END_PROGRAM





CONFIGURATION config1
 TASK fast(PRIORITY := 4);
 PROGRAM P1 WITH fast:
       FOO(single := TRUE, interval := TRUE, priority := TRUE);
END_CONFIGURATION


CONFIGURATION config2
 TASK fast(SINGLE := 3, PRIORITY := 4);
 PROGRAM P1 WITH fast:
       FOO(single := TRUE, interval := TRUE, priority := TRUE);
END_CONFIGURATION


CONFIGURATION config3
 TASK fast(INTERVAL := T#1s, PRIORITY := 4);
 PROGRAM P1 WITH fast:
       FOO(single := TRUE, interval := TRUE, priority := TRUE);
END_CONFIGURATION


CONFIGURATION config4
 TASK fast(SINGLE := 3, INTERVAL := T#1s, PRIORITY := 4);
 PROGRAM P1 WITH fast:
       FOO(single := TRUE, interval := TRUE, priority := TRUE);
END_CONFIGURATION