Instruction manual

Renesas USB MCU and USB ASSP USB Basic Host and Peripheral firmware
R01AN0512EJ0210 Rev.2.10 Page 148 of 157
Apr 1, 2013
9. How to register in non-OS/RTOS
9.1 How to register in non-OS
The following settings are required to register class drivers and applications in non-OS.
For details on schedulers used by non-OS, refer to chapter 6. Non-OS Scheduler.
1. Scheduler settings
2. Task information settings
3. Task registrations in scheduler
4. Task calls
(1). Setup of scheduler
Set the following items in USB-BASIC-FW r_usb_cKernelid.h file.
#define USB_IDMAX Maximum number*1 of task IDs
#define USB_TABLEMAX Maximum number of messages storable in the priority table for each task priority
#define USB_BLKMAX Maximum number of information tables used to send messages from each task
*1: For the maximum number setting, add 1 to the highest ID number among the tasks to be used.
(2). Setup of task information
For each additional task, add the task ID, mailbox ID, memory pool ID and task priority to the USB-BASIC-F/W
r_usb_ckernelid.h file.
Keep the following points in mind when setting these items.
Assign consecutive ID numbers to the tasks, and do not assign the same ID to more than one task.
Set the same value assigned to task ID for mailbox ID and memory pool ID.
Set the task priority of added class drivers and applications to a value lower than that of PCD.
The following settings are examples for vendor class drivers of the sample program.
#define USB_PVENDOR_TSK USB_TID_6 Task ID
#define USB_PVENDOR_MBX USB_PVENDOR_TSK Mailbox ID
#define USB_PVENDOR_MPL USB_PVENDOR_TSK Memory pool ID
(3). Task registration to a scheduler
R_usb_cstd_SetTaskPri() is used to set task ID priorities in the scheduler.
Set the task ID in the 1
st
argument of R_usb_cstd_SetTaskPri() and the task priority in the 2
nd
argument.