aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Control/control.c
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2019-01-31 11:40:34 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2019-01-31 11:40:34 +0200
commit1dcf48d11246dcc69ca28dbb345cb53b12b7d7de (patch)
treebf38ebeb633468f1d80ee208701fbe43720c720c /Software/Embedded_SW/Embedded/Modules/Control/control.c
parent59fee3a258ff15567d21021b661f27d0a6958f8c (diff)
parentbf69a053dcec41d2a38ea63d5e0cb10453190136 (diff)
downloadTango-1dcf48d11246dcc69ca28dbb345cb53b12b7d7de.tar.gz
Tango-1dcf48d11246dcc69ca28dbb345cb53b12b7d7de.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Control/control.c')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/control.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c
index fc843b78b..984db7329 100644
--- a/Software/Embedded_SW/Embedded/Modules/Control/control.c
+++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c
@@ -215,7 +215,10 @@ uint32_t AddControlCallback( ControlCBFunction Callback, CTRL_TIMING_ENUM CtrlF
}
}
if (deviceId == 0xFF)
+ {
+ LOG_ERROR(deviceId, "Add Callback failed");
return 0xFF;
+ }
key = GateMutex_enter(gateControlDB);
ControlArray[deviceId].ControlTiming = CtrlFrequency;
ControlArray[deviceId].ControlCallbackPtr = Callback;
@@ -261,7 +264,7 @@ int RemoveControlCallback(uint32_t deviceId , ControlCBFunction Callback)
uint32_t millisecondCounter = 0;
void OneMilliSecondControlInterrupt(UArg arg0)
{
- ControlMessageStruc Message;
+ ControlMessageStruc ControlMessage;
//uint32_t TenmillisecondCounter = 0;
ROM_IntMasterDisable();
@@ -280,16 +283,16 @@ void OneMilliSecondControlInterrupt(UArg arg0)
}
//send message to the control task
- Message.messageId = OneMillisec;
- Message.tick = millisecondCounter++;
- Message.msglen = sizeof(ControlMessageStruc);
+ ControlMessage.messageId = OneMillisec;
+ ControlMessage.tick = millisecondCounter++;
+ ControlMessage.msglen = sizeof(ControlMessageStruc);
if (ControlMsgQ != NULL)
- Mailbox_post(ControlMsgQ , &Message, BIOS_NO_WAIT);
+ Mailbox_post(ControlMsgQ , &ControlMessage, BIOS_NO_WAIT);
//if (TenmillisecondCounter)
{
- //Message.tick = TenmillisecondCounter;
+ //ControlMessage.tick = TenmillisecondCounter;
if (TenControlMsgQ != NULL)
- Mailbox_post(TenControlMsgQ , &Message, BIOS_NO_WAIT);
+ Mailbox_post(TenControlMsgQ , &ControlMessage, BIOS_NO_WAIT);
}
if (millisecondCounter == 1000000000)
millisecondCounter = 0;
@@ -402,7 +405,7 @@ uint32_t ControlLowLoop(uint32_t tick)
******************************************************************************/
void controlTask(UArg arg0, UArg arg1)
{
- ControlMessageStruc Message;
+ ControlMessageStruc ControlMessage;
//char str[60];
//uint16_t length;
//Clock_setTimeout(HostKAClock, 1000);
@@ -411,11 +414,11 @@ void controlTask(UArg arg0, UArg arg1)
while(1)
{
- Mailbox_pend(ControlMsgQ , &Message, BIOS_WAIT_FOREVER);
- switch (Message.messageId)
+ Mailbox_pend(ControlMsgQ , &ControlMessage, BIOS_WAIT_FOREVER);
+ switch (ControlMessage.messageId)
{
case OneMillisec:
- ControlLoop(Message.tick);
+ ControlLoop(ControlMessage.tick);
break;
default:
break;
@@ -429,7 +432,7 @@ void controlTask(UArg arg0, UArg arg1)
******************************************************************************/
void controlLowTask(UArg arg0, UArg arg1)
{
- ControlMessageStruc Message;
+ ControlMessageStruc ControlLowMessage;
//char str[60];
//uint16_t length;
//Clock_setTimeout(HostKAClock, 1000);
@@ -438,11 +441,11 @@ void controlLowTask(UArg arg0, UArg arg1)
while(1)
{
- Mailbox_pend(TenControlMsgQ , &Message, BIOS_WAIT_FOREVER);
- switch (Message.messageId)
+ Mailbox_pend(TenControlMsgQ , &ControlLowMessage, BIOS_WAIT_FOREVER);
+ switch (ControlLowMessage.messageId)
{
case OneMillisec:
- ControlLowLoop(Message.tick);
+ ControlLowLoop(ControlLowMessage.tick);
break;
default:
break;