Warn against and check for non-DMA-capable pointers being passed to SPI when DMA is used

This commit is contained in:
Jeroen Domburg
2017-05-05 11:55:19 +08:00
parent 530c3ca05c
commit 8af3fe4e84
5 changed files with 29 additions and 0 deletions

View File

@@ -87,4 +87,17 @@ size_t xPortGetMinimumEverFreeHeapSizeCaps( uint32_t caps );
/**
* @brief Convenience function to check if a pointer is DMA-capable.
*
* @param ptr Pointer to check
*
* @return True if DMA-capable, false if not.
*/
static inline bool esp_ptr_dma_capable( const void *ptr )
{
return ( (int)ptr >= 0x3FFAE000 && (int)ptr < 0x40000000 );
}
#endif