Golem  v0.1.1
Generic Operating system Libraries for Embedded Multitasking
 All Data Structures Files Functions Variables Pages
example_glm_conf.c
/*
* Specify the register size to be used on the platform. Valid values are:
* CORE_8BIT
* CORE_16BIT
* CORE_32BIT
* CORE_64BIT
*
* Golem is configured for a 32-bit system below.
*/
#define CORE_32BIT
/*
* Specify the maximum frequency (in Hz) with which your platform will run.
* For a 80MHz processor this would be as stated below.
*/
#define CORE_FREQ_HZ_MAX 80000000L
/*
* Specify the frequency (in Hz) with which Golem's tick function is called
* by (most probably) some timer interrupt routine. Below it is configured
* at 1kHz.
*
* CORE_TICK_FREQ_HZ defines the resolution of both Golem's scheduler and
* alarm functionality. So for this example, the alarm (see glm_alarm.h) is
* set to a 1ms resolution. Likewise, the minimum scheduling slot (see
* glm_scheduler.h) is set to 1ms.
*/
#define CORE_TICK_FREQ_HZ 1000
/*
* Specify which function can be called by Golem in order to obtain the
* present timer value. With this timer value Golem's multitasking
* scheduler can perform with sub-tick precision - in other words; better
* than CORE_TICK_FREQ_HZ.
*
* If this functionality is not needed or not available on your platform,
* please comment-out the line.
*
* Below it is configured for calling a non-Golem function named
* core_subtick_read() which should return the timer value as a uint_base_t
* (see: glm_intbase.h).
*
* Note that the CORE_SUBTICK_FUNC must compensate its return value if the
* processor speed changes from the specified CORE_FREQ_HZ_MAX at run-time.
*/
#define CORE_SUBTICK_FUNC core_subtick_read
/*
* The size of each scheduling slot is measured in ticks
* and as such it us defined by CORE_TICK_FREQ_HZ. Below
* it is configured to a 1/CORE_TICK_FREQ_HZ = 1ms slot.
*/
#define SCHEDULER_SLOT_SIZE_TICKS 1
/*
* If during a scheduling slot there is time left, the scheduler will enter
* an IDLE-state. The scheduler can be configured to run the specified
* functions when entering or leaving this IDLE-state respectively. Leave
* commented if not used.
*
* One suggested use is power-saving by throttling down the core frequency
* during the IDLE-state. Note that one must obey the core tick configured
* by CORE_TICK_FREQ_HZ. Golem also assumes CORE_FREQ_HZ_MAX is true when
* it converts the subtick value into a time (if CORE_SUBTICK_FUNC is used)
* regardless of any CPU-throttling. Therefore, if using CORE_SUBTICK_FUNC,
* compensate for throttled processor speed.
*
* It is adviced to keep the execution time of these functions short in
* order to reduce their impact on the scheduling system. Use wisely in
* combination with a good SCHEDULER_IDLE_FUNC_RUNTH_PERC setting.
*/
#define SCHEDULER_IDLE_ENTER_FUNC sleep
#define SCHEDULER_IDLE_LEAVE_FUNC wakeup
/*
* The SCHEDULER_IDLE_ENTER_FUNC and SCHEDULER_IDLE_LEAVE_FUNC execution
* time may screw up the scheduling when they cross the slot boundary. Both
* functions are only called when there's enough time left in IDLE-state.
*
* The configuration below states that the IDLE-functions are called only
* if the IDLE-time is more than 5% of the slot's time.
*/
#define SCHEDULER_IDLE_FUNC_RUNTH_PERC 5