RTEMS | bsps/stm32h7/spi: Add full duplex and interrupt support (!206)
Sebastian Huber (@sebhub)
gitlab at rtems.org
Sun Sep 29 23:23:11 UTC 2024
Sebastian Huber started a new discussion on bsps/arm/stm32h7/spi/spi-support.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/206#note_112693
> +{
> +#ifdef STM32H7_SPI_USE_INTERRUPTS
> + rtems_event_set received_events;
> + rtems_status_code sc;
> + uint32_t timeout_ticks = timeout_ms;
> +
> + timeout_ticks /= rtems_configuration_get_milliseconds_per_tick();
> +
> + sc = rtems_event_receive(
> + EVENT_ERROR | EVENT_COMPLETE,
> + RTEMS_WAIT | RTEMS_EVENT_ANY,
> + timeout_ticks,
> + &received_events
> + );
> + if (sc != RTEMS_SUCCESSFUL) {
> + return 1;
The return values in this driver make no sense to me. The documentation says:
```c
/**
* @brief SPI bus control.
*/
struct spi_bus {
/**
* @brief Transfers SPI messages.
*
* @param[in] bus The bus control.
* @param[in] msgs The messages to transfer.
* @param[in] msg_count The count of messages to transfer. It must be
* positive.
*
* @retval 0 Successful operation.
* @retval negative Negative error number in case of an error.
*/
int (*transfer)(spi_bus *bus, const spi_ioc_transfer *msgs, uint32_t msg_count);
```
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/206#note_112693
You're receiving this email because of your account on gitlab.rtems.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20240929/317b86db/attachment-0001.htm>
More information about the bugs
mailing list