User`s manual
Copyright © Quantum Leaps, LLC. All Rights Reserved.
QDK™
Renesas RX with HEW
state-machine.com/rx
NOTE: The extended QK scheduler is used, instead of the regular scheduler, to save and restore the
FPSW
register. The following macros
QK_EXT_SAVE()
/
QK_EXT_RESTORE()
specify how to save
and restore the extended context of the
FPSW
.
(14) The RX Accumulator register is restored.
(15) The
QK_EXT_SAVE()
macro specifies the process of saving the extended context, which in the case
of the RX processor is the FPSW register.
(16) The Renesas built-in function
get_fpsw()
resolves to a single instruction “
MVFC Rn
”.
(17) The
QK_EXT_RESTORE()
macro specifies the process of restoring the extended context, which in the
case of the RX processor is the FPSW register.
(18) The Renesas built-in function
set_fpsw()
resolves to a single instruction “
MVTC Rn
”.
5.4 The Board Support Package for the QK Port
The BSP for the QK version is located in the file
bsp.c
in the directory
qpc\examples\rx\qk\renesas\dpp-qk-yrdkrx62n\
. The BSP for QK is mostly similar to the “Vanilla”
kernel discussed before. This section describes only the differences between the two kernels.
5.4.1 Interrupt Service Routines (ISRs) for the preemptive QK kernel
As mentioned earlier, the Renesas compiler enables the user to write ISRs as interrupt functions in C/C+
+. These compiler-generated ISRs are perfectly adequate for the preemptive kernel
Listing 12: Tick timer ISR for QK in intprg.c
(1) #include "vect.h"
#pragma section IntPRG
. . .
(2) void Excep_CMTU0_CMT0(void) {
(3) QK_ISR_ENTRY(); /* inform the QK kernel about entering the ISR */
#ifdef Q_SPY
l_tickTime_ += l_tickPeriod_; /* account for the clock rollover */
#endif
QF_TICK(&l_tickISR); /* process all armed time events */
(4) QK_ISR_EXIT(); /* inform the QK kernel about exiting the ISR */
}
(1) The header file
vect.h
provides declarations of all possible interrupt functions.
(2) The ISR must be one of the
#pragma interrupt
functions declared in the
vect.h
header file.
(3) The macro
QK_ISR_ENTRY()
informs the QK kernel that the ISR has been entered. It must be
called before invoking any QP services in the ISR body.
(4) The macro
QK_ISR_EXIT()
informs the QK kernel that the ISR is about to be exited. It must be
called at the very end of the ISR body.
NOTE: The macros
QK_ISR_ENTRY()
and
QK_ISR_EXIT()
save and restore the RX Accumlator
register, respectively.
25 of 32










