From 0af2ea25f0df045d6d45ae0487c6d5022490a4c4 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Wed, 15 May 2019 13:26:34 +0200 Subject: Lustre v4 example --- .../heater_control_heater_control_loop.c | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 test/monniaux/lustrev4_lv6-en-2cgc_heater_control/heater_control_heater_control_loop.c (limited to 'test/monniaux/lustrev4_lv6-en-2cgc_heater_control/heater_control_heater_control_loop.c') diff --git a/test/monniaux/lustrev4_lv6-en-2cgc_heater_control/heater_control_heater_control_loop.c b/test/monniaux/lustrev4_lv6-en-2cgc_heater_control/heater_control_heater_control_loop.c new file mode 100644 index 00000000..e4037e5a --- /dev/null +++ b/test/monniaux/lustrev4_lv6-en-2cgc_heater_control/heater_control_heater_control_loop.c @@ -0,0 +1,55 @@ +/* This file was generated by lv6 version master.737 (2727a7744111c84f7984634d2bd3ad6f7c6c7ff9). */ +/* lv6 -en -2cgc heater_control.lus -n heater_control */ +/* on vanoise the 15/05/2019 at 13:20:10 */ + +#include +#include +#include +#include "../dm_random.c" +#include "heater_control_heater_control.h" + +/* MACROS DEFINITIONS ****************/ +#ifndef TT +#define TT "1" +#endif +#ifndef FF +#define FF "0" +#endif +#ifndef BB +#define BB "bottom" +#endif +#ifdef CKCHECK +/* set this macro for testing output clocks */ +#endif + +/* Standard Input procedures **************/ +_real _get_real(char* n){ + return (dm_random_uint32()%70000U) * 1E-3 -20.0; +} +/* Standard Output procedures **************/ +void _put_bool(char* n, _boolean b){ + printf("%s: %d\n", n, b); +} +/* Main procedure *************************/ +int main(){ + _real T; + _real T1; + _real T2; + _real T3; + _boolean Heat_on; + heater_control_heater_control_ctx_type ctx_struct; + heater_control_heater_control_ctx_type* ctx = &ctx_struct; + heater_control_heater_control_ctx_init(ctx); + + /* Main loop */ + for(int step=0; step<1000; step++){ + T = _get_real("T"); + T1 = _get_real("T1"); + T2 = _get_real("T2"); + T3 = _get_real("T3"); + heater_control_heater_control_step(T,T1,T2,T3,&Heat_on,ctx); + _put_bool("Heat_on", Heat_on); + } + return 1; + +} -- cgit