From: Nathael Pajani Date: Thu, 21 Sep 2023 22:23:50 +0000 (+0200) Subject: Adding comment for future RTOS/multitasking integration X-Git-Url: http://git.techno-innov.fr/?a=commitdiff_plain;h=aa882e0e628c456683e22bc761746f859a4cb95c;p=soft%2Flpc122x%2Fcore Adding comment for future RTOS/multitasking integration --- diff --git a/drivers/ssp.c b/drivers/ssp.c index 190ba1d..cdc1007 100644 --- a/drivers/ssp.c +++ b/drivers/ssp.c @@ -18,13 +18,22 @@ * *************************************************************************** */ - +/* + * Note for multitasking and/or real-time OS design : + * Four of the functions in this driver may spend some time waiting for external + * events or other tasks. + * The concerned functions are spi_get_mutex(), spi_transfer_single_frame(), + * spi_transfer_words() and spi_transfer_bytes(). + * These functions should call the scheduler at some point to avoid using more + * time than required or even hang the system. + */ /***************************************************************************** */ /* SSP */ /***************************************************************************** */ -/* SSP/SPI driver for the SSP bus integrated module of the LPC122x. +/* + * SSP/SPI driver for the SSP bus integrated module of the LPC122x. * Refer to LPC122x documentation (UM10441.pdf) for more information. */ @@ -120,8 +129,8 @@ void spi_release_mutex(uint8_t ssp_num) * the device. * Note : the SSP device number is not checked, thus a value above the number of SSP * devices present on the micro-controller may break your programm. - * Double check the value of the ssp_num parameter. The check is made on the call to - * ssp_master_on() or ssp_slave_on(). + * Double check the value of the ssp_num parameter. The check is made only once when + * ssp_master_on() or ssp_slave_on() is called. * This function does not take care of the SPI chip select. */ uint16_t spi_transfer_single_frame(uint8_t ssp_num, uint16_t data)