# This fixes components/esp_ringbuf/linker.lf to allow us to put non-ISR ringbuf functions in flash.

# Requires that both RINGBUF_PLACE_FUNCTIONS_INTO_FLASH and RINGBUF_PLACE_ISR_FUNCTIONS_INTO_FLASH
# are set to "n" (which is the default), otherwise this would result in duplicate section config
# when resolving the linker fragments.

# The effect of this file is to leave the ISR functions in RAM (which we require), but apply a fixed
# version of RINGBUF_PLACE_FUNCTIONS_INTO_FLASH=y (leaving out prvGetFreeSize and prvGetCurMaxSizeByteBuf)
# See https://github.com/espressif/esp-idf/issues/13378

[mapping:esp_ringbuf_fix]
archive: libesp_ringbuf.a
entries:
    # This is exactly the list of functions from RINGBUF_PLACE_FUNCTIONS_INTO_FLASH=y,
    # but with prvGetFreeSize and prvGetCurMaxSizeByteBuf removed.
    ringbuf: prvGetCurMaxSizeNoSplit (default)
    ringbuf: prvGetCurMaxSizeAllowSplit (default)
    ringbuf: prvInitializeNewRingbuffer (default)
    ringbuf: prvReceiveGeneric (default)
    ringbuf: vRingbufferDelete (default)
    ringbuf: vRingbufferGetInfo (default)
    ringbuf: vRingbufferReturnItem (default)
    ringbuf: xRingbufferAddToQueueSetRead (default)
    ringbuf: xRingbufferCanRead (default)
    ringbuf: xRingbufferCreate (default)
    ringbuf: xRingbufferCreateStatic (default)
    ringbuf: xRingbufferCreateNoSplit (default)
    ringbuf: xRingbufferReceive (default)
    ringbuf: xRingbufferReceiveSplit (default)
    ringbuf: xRingbufferReceiveUpTo (default)
    ringbuf: xRingbufferRemoveFromQueueSetRead (default)
    ringbuf: xRingbufferSend (default)
    ringbuf: xRingbufferSendAcquire (default)
    ringbuf: xRingbufferSendComplete (default)
    ringbuf: xRingbufferPrintInfo (default)
    ringbuf: xRingbufferGetMaxItemSize (default)
    ringbuf: xRingbufferGetCurFreeSize (default)

    # Everything else will have the default rule already applied (i.e. noflash_text).
