app_specific/include/config.h File Reference

Configuration of the system. More...


#define CFG_OS_MAX_THREADS   16
 Defines maximum number of threads.
 define this for testing overflow in semaphore/mutex
 check lock issues due to preemption disabled or empty ready list
 defines initial state of GIE when switches to the thread
 allows marking .next field in list with special pattern during os_list1_del()
 filling pattern for free items in memory pool
 code that is used to mark deleted list items
 perform a check on semaphore destroy in os_sleep()
 enable location stamp of timer delete, it is useful for determination how timer was deleted (manually or becuse it expired)
 fills unused memory with poison pattern (excl. with CFG_MARK_EMPTY_MEM_POOL)
 marking of empty item with a poison code (excl.CFG_FILL_EMPTY_MEM_POOL )
 new allocated memory from memory pool is filled with zeros (excl. with CFG_MARK_ALLOC_MEM_POOL)
 new allocated memory from memory pool has zero marking (excl. CFG_ZERO_ALLOC_MEM_POOL), only two first bytes.
 enables pointer check in os_mem_pool_free, may detect incorrect pointer or double free
 controls scheduling on ISR exit. When enabled it is done only when requested, otherwise is done every ISR
 enables signalling on DEBUG_PORT identifier of current thread when context is changed
#define CFG_DEBUG_THREAD_MASK   0x03
 mask for thread signalling

Detailed Description

Configuration of the system.

Piotr Romaniuk, (c) ELESOFTROM
1.0 Feb 4, 2011

The file contains definition of the system configuration. Preprocessor symbols that are defined here control compilation of the system code. Some parts and corresponding functionality of the system are compiled conditionally and can be excluded from final release. Also, some byte patterns used for debug support are defined here.

Define Documentation

#define CFG_DEBUG_THREAD_MASK   0x03

mask for thread signalling

Thread identifier (0...15) can be signalled on output pins.
When CFG_DEBUG_PIN_THREADS is defined new thread id is sent to output port and can be observed on logic analyser.
This mask selects which bits are passed to output pins. It may occupy four bits (0...3) of the port or less. By the mask you may define how many bits are illustrated on pins.
mask = 0x03 - only two bits are visible (b0, b1) - four distinguished ids/states
mask = 0x07 - bits b0-b2 - eight ids
mask = 0x0F - all bits b0-b3 - 16 thread ids

short zeros spikes signals that context switch happens in that time.
#define CFG_OS_MAX_THREADS   16

Defines maximum number of threads.

It determines size of tcb table. Set it to number of threads that you use (incl. idle thread). The value must not be larger than 16