aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Control
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2019-01-31 09:30:49 +0200
committerAvi Levkovich <avi@twine-s.com>2019-01-31 09:30:49 +0200
commit6704280804a6d1cebd5ee13050ba18950cdb83ec (patch)
treed6985e901f5bf7e71db3da7bb017a1610e10978e /Software/Embedded_SW/Embedded/Modules/Control
parent4bce971463af706dad054d61e291dcfe1355fc06 (diff)
parente679fb8fe63641c2ba1808f4ef2799f398120235 (diff)
downloadTango-6704280804a6d1cebd5ee13050ba18950cdb83ec.tar.gz
Tango-6704280804a6d1cebd5ee13050ba18950cdb83ec.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Control')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c34
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/control.c33
2 files changed, 35 insertions, 32 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
index 59591769b..01b0948e5 100644
--- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
+++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
@@ -159,7 +159,7 @@ void MillisecStart(void)
void OneMilliSecondMillisecInterrupt(UArg arg0)
{
- MillisecMessageStruc Message;
+ MillisecMessageStruc MillisecMessage;
uint32_t Tenmsec_millisecondCounter = 0;
ROM_IntMasterDisable();
ROM_TimerIntClear(Millisec_timerBase, TIMER_TIMA_TIMEOUT); // Clear the timer interrupt
@@ -178,19 +178,19 @@ void OneMilliSecondMillisecInterrupt(UArg arg0)
Tenmsec_millisecondCounter = msec_millisecondCounter;
}
//send message to the Millisec task
- Message.messageId = OneMillisec;
- Message.tick = msec_millisecondCounter++;
- Message.msglen = sizeof(MillisecMessageStruc);
+ MillisecMessage.messageId = OneMillisec;
+ MillisecMessage.tick = msec_millisecondCounter++;
+ MillisecMessage.msglen = sizeof(MillisecMessageStruc);
if (MillisecMsgQ != NULL)
- Mailbox_post(MillisecMsgQ , &Message, BIOS_NO_WAIT);
+ Mailbox_post(MillisecMsgQ , &MillisecMessage, BIOS_NO_WAIT);
if (Tenmsec_millisecondCounter)
{
- Message.messageId = OneMillisec;
- Message.tick = Tenmsec_millisecondCounter;
- Message.msglen = sizeof(MillisecMessageStruc);
+ MillisecMessage.messageId = OneMillisec;
+ MillisecMessage.tick = Tenmsec_millisecondCounter;
+ MillisecMessage.msglen = sizeof(MillisecMessageStruc);
if (TenMillisecMsgQ != NULL)
- Mailbox_post(TenMillisecMsgQ , &Message, BIOS_NO_WAIT);
+ Mailbox_post(TenMillisecMsgQ , &MillisecMessage, BIOS_NO_WAIT);
}
//
@@ -507,7 +507,7 @@ uint32_t MillisecLowLoop(uint32_t tick)
******************************************************************************/
void MillisecTask(UArg arg0, UArg arg1)
{
- MillisecMessageStruc Message;
+ MillisecMessageStruc MillisecMessage;
//char str[60];
//uint16_t length;
//Clock_setTimeout(HostKAClock, 1000);
@@ -516,11 +516,11 @@ void MillisecTask(UArg arg0, UArg arg1)
Millisecond_Task_Handle = Task_self();
while(1)
{
- Mailbox_pend(MillisecMsgQ , &Message, BIOS_WAIT_FOREVER);
- switch (Message.messageId)
+ Mailbox_pend(MillisecMsgQ , &MillisecMessage, BIOS_WAIT_FOREVER);
+ switch (MillisecMessage.messageId)
{
case OneMillisec:
- MillisecLoop(Message.tick);
+ MillisecLoop(MillisecMessage.tick);
break;
default:
break;
@@ -534,7 +534,7 @@ void MillisecTask(UArg arg0, UArg arg1)
******************************************************************************/
void MillisecLowTask(UArg arg0, UArg arg1)
{
- MillisecMessageStruc Message;
+ MillisecMessageStruc MillisecLowMessage;
//char str[60];
//uint16_t length;
//Clock_setTimeout(HostKAClock, 1000);
@@ -543,11 +543,11 @@ void MillisecLowTask(UArg arg0, UArg arg1)
//Millisecond_Task_Handle = Task_self();
while(1)
{
- Mailbox_pend(TenMillisecMsgQ , &Message, BIOS_WAIT_FOREVER);
- switch (Message.messageId)
+ Mailbox_pend(TenMillisecMsgQ , &MillisecLowMessage, BIOS_WAIT_FOREVER);
+ switch (MillisecLowMessage.messageId)
{
case OneMillisec:
- MillisecLowLoop(Message.tick);
+ MillisecLowLoop(MillisecLowMessage.tick);
break;
default:
break;
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;