User`s manual

Copyright © Quantum Leaps, LLC. All Rights Reserved.
QDK™
Renesas RX with HEW
state-machine.com/rx
4 Non-Preemptive “Vanilla” Port
The “Vanilla” port shows how to use the QP frameworks on an RX-based system with the non-preemptive
“Vanilla” kernel. In this version you’re using the cooperative kernel built-into the QF framework and you're
not using the QK component.
NOTE: The source code for the QP port to the cooperative “Vanilla” kernel is generic and should not
need to change for different members of the Renesas 32-Bit MCU RX Family (RX200, RX600, etc.).
4.1 The qep_port.h Header File
The QEP header file for the RX port is located in
qpc\ports\rx\vanilla\renesas\qep_port.h
. Listing
4 shows the
qep_port.h header
file.
Listing 4:
qep_port.h
header file for the non-preemptive QP configuration and Renesas compiler
(1) #include <stdint.h> /* exact-width integers, WG14/N843 C99, 7.18.1.1 */
#include "qep.h" /* QEP platform-independent public interface */
(1) The Renesas Compiler provides the C99-standard exact-width integer types in the standard
<stdint.h>
header file.
4.2 The qf_port.h Header File
The QF port header file for the RX family is located in
qpc\ports\rx\vanilla\renesas\qf_port.h
.
This file specifies the configuration constants for QF (see Chapter 8 in [PsiCC2]) as well as the
unconditional interrupt disabling/enabling and the critical section policy.
The most important porting decision you need to make in the
qf_port.h
header file is the critical section
policy. The RX family of MCUs allows using the simplest “unconditional interrupt unlocking” policy (see
Section 7.3.2 of [PSiCC2]), because RX
Listing 5: qf_port.h header file for the non-preemptive QP configuration and Renesas compiler
/* The maximum number of active objects in the application */
(1) #define QF_MAX_ACTIVE 63
/* The maximum number of event pools in the application */
(2) #define QF_MAX_EPOOL 6
/* QF interrupt disabling/enabling */
(3) #define QF_INT_DISABLE() clr_psw_i()
(4) #define QF_INT_ENABLE() set_psw_i()
/* QF critical section entry/exit */
(5) /* QF_CRIT_STAT_TYPE not defined: unconditional interrupt unlocking, NOTE01 */
(6) #define QF_CRIT_ENTRY(dummy) QF_INT_DISABLE()
(7) #define QF_CRIT_EXIT(dummy) QF_INT_ENABLE()
/* QF ISR entry/exit, also see NOTE01 */
(8) #define QF_ISR_ENTRY() QF_INT_ENABLE()
(9) #define QF_ISR_EXIT() QF_INT_DISABLE()
17 of 32