mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-09 20:41:14 +00:00
feat(attr): add new macro DMA_ATTR
and WORD_ALIGNED_ATTR
to help dma buffer declaration.
This commit is contained in:

committed by
Michael (Xiao Xufeng)

parent
3bc1a8318b
commit
fcfcab7678
@@ -26,6 +26,12 @@
|
||||
// Forces data into DRAM instead of flash
|
||||
#define DRAM_ATTR __attribute__((section(".dram1")))
|
||||
|
||||
// Forces data to be 4 bytes aligned
|
||||
#define WORD_ALIGNED_ATTR __attribute__((aligned(4)))
|
||||
|
||||
// Forces data to be placed to DMA-capable places
|
||||
#define DMA_ATTR WORD_ALIGNED_ATTR DRAM_ATTR
|
||||
|
||||
// Forces a string into DRAM instead of flash
|
||||
// Use as ets_printf(DRAM_STR("Hello world!\n"));
|
||||
#define DRAM_STR(str) (__extension__({static const DRAM_ATTR char __c[] = (str); (const char *)&__c;}))
|
||||
|
Reference in New Issue
Block a user