Commit 37b9bbb1 authored by Damien George's avatar Damien George

Update Demo_uPy_WithC to pass int and float to MicroPython code.

parent e00d57f2
...@@ -24,6 +24,8 @@ FEATURES ...@@ -24,6 +24,8 @@ FEATURES
a : IN PARAMETER DataView::MyBool { a : IN PARAMETER DataView::MyBool {
Taste::encoding => NATIVE; Taste::encoding => NATIVE;
}; };
PROPERTIES
Taste::Associated_Queue_Size => 1;
END PI_TM; END PI_TM;
SUBPROGRAM IMPLEMENTATION PI_TM.others SUBPROGRAM IMPLEMENTATION PI_TM.others
...@@ -34,6 +36,12 @@ FEATURES ...@@ -34,6 +36,12 @@ FEATURES
a : IN PARAMETER DataView::MyBool { a : IN PARAMETER DataView::MyBool {
Taste::encoding => NATIVE; Taste::encoding => NATIVE;
}; };
b : IN PARAMETER DataView::MyInteger {
Taste::encoding => NATIVE;
};
c : IN PARAMETER DataView::MyReal {
Taste::encoding => NATIVE;
};
END RI_TC; END RI_TC;
SUBPROGRAM IMPLEMENTATION RI_TC.others SUBPROGRAM IMPLEMENTATION RI_TC.others
...@@ -52,6 +60,12 @@ FEATURES ...@@ -52,6 +60,12 @@ FEATURES
a : IN PARAMETER DataView::MyBool { a : IN PARAMETER DataView::MyBool {
Taste::encoding => NATIVE; Taste::encoding => NATIVE;
}; };
b : IN PARAMETER DataView::MyInteger {
Taste::encoding => NATIVE;
};
c : IN PARAMETER DataView::MyReal {
Taste::encoding => NATIVE;
};
END PI_TC; END PI_TC;
SUBPROGRAM IMPLEMENTATION PI_TC.others SUBPROGRAM IMPLEMENTATION PI_TC.others
...@@ -90,6 +104,7 @@ FEATURES ...@@ -90,6 +104,7 @@ FEATURES
PI_TM : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::GND::PI_TM.others { PI_TM : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::GND::PI_TM.others {
Taste::coordinates => "1246 1185"; Taste::coordinates => "1246 1185";
Taste::RCMoperationKind => unprotected; Taste::RCMoperationKind => unprotected;
Taste::RCMperiod => 0 ms;
Taste::Deadline => 0 ms; Taste::Deadline => 0 ms;
Taste::InterfaceName => "TM"; Taste::InterfaceName => "TM";
}; };
......
44a97ceb63adbe8df866dd3740da7d6f InterfaceView.aadl b468036a71fbc1a1e19c30c44c0f055b InterfaceView.aadl
...@@ -3,22 +3,28 @@ ...@@ -3,22 +3,28 @@
#include <stdio.h> #include <stdio.h>
#include "gnd.h" #include "gnd.h"
static asn1SccMyBool state; static asn1SccMyBool stateBool;
static asn1SccMyInteger stateInt;
static asn1SccMyReal stateReal;
void gnd_startup() void gnd_startup()
{ {
/* Write your initialization code here, /* Write your initialization code here,
but do not make any call to a required interface. */ but do not make any call to a required interface. */
printf("gnd_startup\n"); printf("gnd_startup\n");
state = false; stateBool = false;
stateInt = 42;
stateReal = 1.23;
} }
void gnd_PI_CYCLE() void gnd_PI_CYCLE()
{ {
/* Write your code here! */ /* Write your code here! */
printf("gnd_PI_CYCLE --->\n"); printf("gnd_PI_CYCLE --->\n");
gnd_RI_TC(&state); gnd_RI_TC(&stateBool, &stateInt, &stateReal);
state = !state; stateBool = !stateBool;
stateInt = 45 - stateInt;
stateReal = 1.0 / stateReal;
} }
void gnd_PI_TM(const asn1SccMyBool *IN_a) void gnd_PI_TM(const asn1SccMyBool *IN_a)
......
...@@ -17,7 +17,9 @@ void gnd_PI_CYCLE(); ...@@ -17,7 +17,9 @@ void gnd_PI_CYCLE();
void gnd_PI_TM(const asn1SccMyBool *); void gnd_PI_TM(const asn1SccMyBool *);
extern void gnd_RI_TC(const asn1SccMyBool *); extern void gnd_RI_TC(const asn1SccMyBool *,
const asn1SccMyInteger *,
const asn1SccMyReal *);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -11,8 +11,10 @@ def payload_startup(): ...@@ -11,8 +11,10 @@ def payload_startup():
print('payload_startup') print('payload_startup')
micropython.heap_lock() micropython.heap_lock()
def payload_PI_TC(IN_a): def payload_PI_TC(IN_a,
IN_b,
IN_c):
# Write your code here! # Write your code here!
print(' payload_PI_TC', IN_a) print(' payload_PI_TC', IN_a, IN_b, IN_c)
print(' <--/') print(' <--/')
payload_RI_TM(not IN_a) payload_RI_TM(not IN_a)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment