diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-05-29 18:50:18 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-05-29 18:50:18 +0300 |
| commit | 5e67333d1231c2020e8d4ea062fc74418be9f3e5 (patch) | |
| tree | 75d735a24fa7d61fb64f05236565eaad5852c71b /Software/Embedded_SW/Embedded/Modules/Control | |
| parent | af37a01f04bb30d1163762034a9896f0417209a4 (diff) | |
| download | Tango-5e67333d1231c2020e8d4ea062fc74418be9f3e5.tar.gz Tango-5e67333d1231c2020e8d4ea062fc74418be9f3e5.zip | |
State machine and job handling. motor speed/position is not clean
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Control')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Control/control.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c index 40eee95c8..a0ba50078 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/control.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c @@ -55,7 +55,7 @@ #include "MillisecTask.h" /******************** Definitions ********************************************/ #define INVALID_MSG_ID 0xFFFF -#define MAX_TANGO_CONTROL_DEVICES 200 +#define MAX_TANGO_CONTROL_DEVICES 80 /******************** STRUCTURES AND ENUMs ********************************************/ @@ -221,7 +221,7 @@ int RemoveControlCallback(uint32_t deviceId , ControlCBFunction Callback) } - +uint32_t millisecondCounter = 0; void OneMilliSecondControlInterrupt(UArg arg0) { ControlMessageStruc Message; @@ -235,11 +235,12 @@ void OneMilliSecondControlInterrupt(UArg arg0) //send message to the control task Message.messageId = OneMillisec; - Message.tick = UsersysTickGet(); + Message.tick = millisecondCounter++; Message.msglen = sizeof(ControlMessageStruc); if (ControlMsgQ != NULL) Mailbox_post(ControlMsgQ , &Message, BIOS_NO_WAIT); - + if (millisecondCounter == 1000000000) + millisecondCounter = 0; ROM_TimerIntClear(Control_timerBase, TIMER_TIMA_TIMEOUT); // Clear the timer interrupt // // Enable all interrupts. @@ -258,7 +259,7 @@ uint32_t ControlLoop(uint32_t tick) Ten_msTick = (tick%eTenMilliSecond == 0) ?true:false; Hundred_msTick = (tick%eHundredMillisecond == 0) ?true:false; Onesecond_Tick = (tick%eOneSecond == 0) ?true:false; - Tick98 = (tick%eHundredMillisecond == 98) ?true:false; + Tick98 = (tick%eHundredMillisecond == 99) ?true:false; Tick998 = (tick%eOneSecond == 998) ?true:false; for (Device_i = 0; Device_i < MAX_TANGO_CONTROL_DEVICES;Device_i++) |
