From 540272c93c7d0b4a12ea797c996f2c9ddf2a5bbb Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Sun, 22 Apr 2018 13:58:32 +0300 Subject: 1. IfIndex in control interface 2. container.c moved to communication --- Software/Embedded_SW/Embedded/Modules/Control/control.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Control/control.c') 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: -- cgit v1.3.1