Hi there,
I'm currently building a LED Matrix which is multiplexed. I want to achieve this by calling an ISR every x ms and send the data inside the ISR via SPI. When I do this it doesn't work, because it fails getting a result from spi_device_get_trans_result
Can I even use spi_device_transmit inside an ISR? If not how can I achieve a "timed" update call instead?
Thanks in advance.
Call spi_device_transmit inside ISR
-
- Posts: 9761
- Joined: Thu Nov 26, 2015 4:08 am
Re: Call spi_device_transmit inside ISR
There are quite few functions you can call safely from an ISR... but the FreeRTOS functions that end in FromISR are always safe. Suggest you use this to start off the transfer: have a thread that waits on a semaphore or task notification and then starts the next transfer, and in the ISR use xSemaphoreGiveFromISR or vTaskNotifyGiveFromISR to kick off the next transfer.
Also: you may be interested in this: viewtopic.php?f=17&t=3188
Also: you may be interested in this: viewtopic.php?f=17&t=3188
Re: Call spi_device_transmit inside ISR
Thanks for your answer, that really helps me. I will look into the freertos functions.
Who is online
Users browsing this forum: mensbufo and 127 guests