# CARD_SetCacheFlushThreshold

## Syntax

  `#include <nitro/card.h>`
  `void CARD_SetCacheFlushThreshold(u32 icache, u32 dcache);`

## Arguments

icache | The threshold value for invalidating the Instruction Cache
dcache | The threshold value for invalidating the Data Cache

## Return Values

None.

## Description

Sets the threshold value for switching the method used to invalidate the cache when DMA transfer is required inside the library.

If a small cache area is being invalidated, the `IC_InvalidateRange` and `DC_FlushRange` functions should be used to perform partial invalidations. However, this takes too much time on buffers larger than a certain size, so it is more effective to use the `IC_InvalidateAll` and `DC_FlushAll` functions to invalidate the entire cache. You can use this function to change the threshold value that defines when to switch the method used to invalidate the cache.

When the CARD library is performing DMA transfers, it partially invalidates the cache if the transfer size is smaller than the value set here. Otherwise, it invalidates the entire cache. The default threshold value for `icache` is `0x400` (1 KB). The default for `dcache` is `0x2400` (9 KB). As a rule of thumb, these are good thresholds for most normal programs, but you are free to change the values if you think that the program structure and scenes warrant more appropriate values.

## See Also

`CARD_GetCacheFlushThreshold`

## Revision History

2008/12/05 Changed the default values.
2007/05/16 Initial version.

CONFIDENTIAL