This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ARTX166 V2.00 Round Robin and os_dly_wait() incompatibility

Hello,

I believe that the round robin task switching won't perform correctly if any task with a rather high priority waits on a delay less than or equal to OS_ROBINTOUT.

Is this a normal behavior?

It is easy to illustrate this problem, at least on my machine:
- open the round robin example (usually located at ...\keil\C166\AR166\Examples\RoundRobin)
- make sure that OS_ROBINTOUT is defined to 5 in the AR166_Config.c file
- compile and run the example in debug mode
- observe that task 1 and task 2 are both executed from time to time, according to the round robin scheduler. This is normal.
- replace the task 4 by the following code:

void task4 (void) _task_ 4 _priority_ 6
{
  while (1)
  {
    os_dly_wait(5); // 5 or less
    counter4++;
  }
}

- compile and run again
- observe that task 2 is never scheduled to run
- change the os_dly_wait timeout to 6
- compile and run
- observe that now task 2 is scheduled by the round robing scheduler as it should be

Is there an easy way to fix this?

Thanks and regards,

-Stephane


________________________________________

ARTX166 V2.00

IDE-Version:
µVision3 V3.21
Copyright (c) Keil Elektronik GmbH / Keil Software, Inc. 1995 - 2005
Tool Version Numbers:
Toolchain Path: D:\Program Files\Keil\C166\BIN\
EC++ Compiler: EC166.Exe V1.09
C Compiler: C166.Exe V6.02
Assembler: A166.Exe V5.20
Linker/Locator: L166.Exe V5.21
Librarian: LIB166.Exe V4.26
Hex Converter: OH166.Exe V4.7a
CPU DLL: S166.DLL V2.49
Dialog DLL: D167.DLL V2.45
Target DLL: MONITOR\MON166.DLL V2.41
Dialog DLL: D167.DLL V2.45

0