aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Control/control.c
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2018-04-22 13:58:32 +0300
committerShlomo Hecht <shlomo@twine-s.com>2018-04-22 13:58:32 +0300
commit540272c93c7d0b4a12ea797c996f2c9ddf2a5bbb (patch)
treec77ea96deed628c118bb235bc16150846c165d49 /Software/Embedded_SW/Embedded/Modules/Control/control.c
parent4df1724226c0d0941b970dbe71b1476e3c3e9902 (diff)
downloadTango-540272c93c7d0b4a12ea797c996f2c9ddf2a5bbb.tar.gz
Tango-540272c93c7d0b4a12ea797c996f2c9ddf2a5bbb.zip
1. IfIndex in control interface 2. container.c moved to communication
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Control/control.c')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/control.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c
index 28b4afb8d..0a4a8b791 100644
--- a/Software/Embedded_SW/Embedded/Modules/Control/control.c
+++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c
@@ -65,6 +65,7 @@ typedef struct
bool ControlActive;
uint32_t Parameter1;
uint32_t Parameter2;
+ uint32_t IfIndex;
DataReadCBFunction ControlDataReadPtr;
ControlCBFunction ControlCallbackPtr;
CTRL_TIMING_ENUM ControlTiming;
@@ -169,7 +170,7 @@ void ControlStart(void)
* both these callbacks can be removed. if a new call is arriving, it invalidates the previous one (no dual control or data)
*
***************************************************************************************************************************************************/
-uint32_t AddControlCallback( ControlCBFunction Callback, CTRL_TIMING_ENUM CtrlFrequency, DataReadCBFunction DriverfPtr, uint32_t Parameter1, uint32_t Parameter2 )
+uint32_t AddControlCallback( ControlCBFunction Callback, CTRL_TIMING_ENUM CtrlFrequency, DataReadCBFunction DriverfPtr, uint32_t IfIndex, uint32_t Parameter1, uint32_t Parameter2 )
{
assert(Callback);
assert(DriverfPtr);
@@ -194,6 +195,7 @@ uint32_t AddControlCallback( ControlCBFunction Callback, CTRL_TIMING_ENUM CtrlF
ControlArray[deviceId].ControlDataReadPtr = DriverfPtr;
ControlArray[deviceId].Parameter1 = Parameter1;
ControlArray[deviceId].Parameter2 = Parameter2;
+ ControlArray[deviceId].IfIndex = IfIndex;
GateMutex_leave(gateControlDB, key);
return deviceId;
@@ -223,7 +225,6 @@ int RemoveControlCallback(uint32_t deviceId , ControlCBFunction Callback)
void OneMilliSecondControlInterrupt(UArg arg0)
{
ControlMessageStruc Message;
- bool retcode = false;
ROM_IntMasterDisable();
if (ControlRestart == true)
{
@@ -237,7 +238,7 @@ void OneMilliSecondControlInterrupt(UArg arg0)
Message.tick = UsersysTickGet();
Message.msglen = sizeof(ControlMessageStruc);
if (ControlMsgQ != NULL)
- retcode = Mailbox_post(ControlMsgQ , &Message, BIOS_NO_WAIT);
+ Mailbox_post(ControlMsgQ , &Message, BIOS_NO_WAIT);
ROM_TimerIntClear(Control_timerBase, TIMER_TIMA_TIMEOUT); // Clear the timer interrupt
//
@@ -266,27 +267,27 @@ uint32_t ControlLoop(uint32_t tick)
{
case eOneMillisecond:
ControlDatalog[Device_i] = ControlArray[Device_i].ControlDataReadPtr( ControlArray[Device_i].Parameter1,ControlArray[Device_i].Parameter2);
- ControlArray[Device_i].ControlCallbackPtr(Device_i, ControlDatalog[Device_i]);
+ ControlArray[Device_i].ControlCallbackPtr(ControlArray[Device_i].IfIndex, ControlDatalog[Device_i]);
break;
case eTenMilliSecond:
if (Ten_msTick)
{
ControlDatalog[Device_i] = ControlArray[Device_i].ControlDataReadPtr( ControlArray[Device_i].Parameter1,ControlArray[Device_i].Parameter2);
- ControlArray[Device_i].ControlCallbackPtr(Device_i, ControlDatalog[Device_i]);
+ ControlArray[Device_i].ControlCallbackPtr(ControlArray[Device_i].IfIndex, ControlDatalog[Device_i]);
}
break;
case eHunderdMillisecond:
if (Hundred_msTick)
{
ControlDatalog[Device_i] = ControlArray[Device_i].ControlDataReadPtr( ControlArray[Device_i].Parameter1,ControlArray[Device_i].Parameter2);
- ControlArray[Device_i].ControlCallbackPtr(Device_i, ControlDatalog[Device_i]);
+ ControlArray[Device_i].ControlCallbackPtr(ControlArray[Device_i].IfIndex, ControlDatalog[Device_i]);
}
break;
case eOneSecond:
if (Onesecond_Tick)
{
ControlDatalog[Device_i] = ControlArray[Device_i].ControlDataReadPtr( ControlArray[Device_i].Parameter1,ControlArray[Device_i].Parameter2);
- ControlArray[Device_i].ControlCallbackPtr(Device_i, ControlDatalog[Device_i]);
+ ControlArray[Device_i].ControlCallbackPtr(ControlArray[Device_i].IfIndex, ControlDatalog[Device_i]);
}
break;
default: