diff options
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Control/control.c')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Control/control.c | 33 |
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; |
