Instruction manual

Renesas USB MCU and USB ASSP USB Basic Host and Peripheral firmware
R01AN0512EJ0210 Rev.2.10 Page 135 of 157
Apr 1, 2013
7. non-OS Scheduler
7.1 Overview
The non-OS scheduler executes task scheduling according to task priority. The following are non-OS task scheduler
features.
A scheduler function manages requests generated by the tasks and interrupt etc according to the relative
priority of the tasks.
When multiple requests are generated by tasks with the same priority, they are executed using a FIFO
configuration.
call-back functions are used for responses to tasks indicating the end of a request, so the customer need
only install appropriate class drivers for the system and there is no need to modify the scheduler itself.
7.2 non-OS Scheduler Macro
Table 7.1 shows the scheduler macro that user uses.
Table 7.1 Scheduler macro
Scheduler macro Registration function Description
R_USB_SND_MSG R_usb_cstd_SndMsg Specifies Task ID and transmits message
R_USB_ISND_MSG R_usb_cstd_iSndMsg Specifies Task ID from interrupt and transmits message.
R_USB_WAI_MSG R_usb_cstd_WaiMsg
Runs USB_SND_MSG after running the scheduler the
specified number of times.
R_USB_RCV_MSG R_usb_cstd_RecMsg Checks if received message is in specified mailbox.
R_USB_TRCV_MSG R_usb_cstd_RecMsg Checks if received message is in specified mailbox.
R_USB_PGET_BLK R_usb_cstd_PgetBlk Secures an area for storing a message.
R_USB_REL_BLK R_usb_cstd_RelBlk Releases an area for storing a message.
7.2.1 non-OS Scheduler API Function
Table 7.2 shows the list of API function for non-OS scheduler.
Table 7.2 List of non-OS scheduler API function
API function Description
R_usb_cstd_SndMsg() Sends processing requests to the priority table.
R_usb_cstd_iSndMsg() Sends processing requests from interrupts to the priority table.
R_usb_cstd_RecMsg() Checks if an execution request was issued.
R_usb_cstd_PgetBlk() Allocates an area for storing a request information table.
R_usb_cstd_RelBlk() Releases an area used for storing a request information table.
R_usb_cstd_Scheduler() Manages requests generated by the tasks.
R_usb_cstd_SetTaskPri() Set Task Priority.
R_usb_cstd_CheckSchedule() Checks whether or not processing is scheduled.