From f72612aed2b9ec147b5e60a53c9e13b94aa71cdb Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Wed, 15 May 2019 16:44:04 +0200 Subject: compiled with Lustre v4 --- .../heater_control_loop.c | 64 ++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 test/monniaux/lustrev4_lv4_heater_control/heater_control_loop.c (limited to 'test/monniaux/lustrev4_lv4_heater_control/heater_control_loop.c') diff --git a/test/monniaux/lustrev4_lv4_heater_control/heater_control_loop.c b/test/monniaux/lustrev4_lv4_heater_control/heater_control_loop.c new file mode 100644 index 00000000..06bad418 --- /dev/null +++ b/test/monniaux/lustrev4_lv4_heater_control/heater_control_loop.c @@ -0,0 +1,64 @@ +/******** +* ec2c version 0.67 +* c main file generated for node : heater_control +* to be used with : heater_control.c +* and : heater_control.h +* context method = HEAP +* ext call method = PROCEDURES +********/ +#include +#include +#include +#include "../clock.h" +#include "../dm_random.c" +#include "heater_control.h" + +/* Print a promt ? ************************/ +static int ISATTY; +/* MACROS DEFINITIONS ****************/ +#ifndef TT +#define TT "true" +#endif +#ifndef FF +#define FF "false" +#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); +} +/* Output procedures **********************/ +void heater_control_O_Heat_on(void* cdata, _boolean _V) { + // _put_bool("Heat_on", _V); +} +/* Main procedure *************************/ +int main(){ + + /* Context allocation */ + struct heater_control_ctx* ctx = heater_control_new_ctx(NULL); + /* Main loop */ + clock_prepare(); + clock_start(); + heater_control_reset(ctx); + for(int count=0; count<1000; count++){ + heater_control_I_T(ctx, _get_real("T")); + heater_control_I_T1(ctx, _get_real("T1")); + heater_control_I_T2(ctx, _get_real("T2")); + heater_control_I_T3(ctx, _get_real("T3")); + heater_control_step(ctx); + + } + clock_stop(); + print_total_clock(); + return 0; +} -- cgit