
This command can be used to manually alter the scheduling frequency of the internal RTOS, that is, the time interval when the current task is stopped and another task gets the processor. SCHED requires one or two arguments.
The default frequency of the scheduler is 50Hz, which means that every task is allowed to run 20ms before it is stopped and another task is activated. The RTOS switches tasks in a round-robin manner all tasks get the same time slice.
The first argument is the frequency in Hz of the scheduler. Frequencies from 1 Hz to 27 kHz and the magic value 0 are allowed. If 0 is given, time-controlled task switching is switched off and the RTOS uses cooperative multitasking. If only the first argument exists, the new frequency is applied immediately after the current running task's time quantum is exhausted. The scheduler keeps this frequency until the module is powered off or another SCHED command is invoked.
The second argument, if given, must be the word "FIX". If this argument exists, the scheduler is not immediately re-configured but rather the frequency is stored into Flash memory and effective on next reboot.
ERR_OK (0) if command was accepted.
ERR_ARGUMENT (4) if command was rejected due to wrong input
SCHED 0 FIX
This sets the configuration entry in Flash memory to "use coorerative multitasking"
This command can be used to query the scheduler settings. SCHED? does not need any arguments. The output is like this:
200 200
The first number is actual scheduling frequency in Hz.
The second number is the stored scheduling frequency that will be used when the module starts.