Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
fs_json.c File Reference

Macros

#define JSON_COMPRESSION
 

Functions

char * loadJson (cnfsFileIdx_t fIdx, bool spiRam)
 Load a JSON from ROM to RAM. JSONs placed in the assets_image folder before compilation will be automatically flashed to ROM.
 
void freeJson (char *jsonStr)
 Free an allocated JSON string.
 

Macro Definition Documentation

◆ JSON_COMPRESSION

#define JSON_COMPRESSION

Function Documentation

◆ loadJson()

char * loadJson ( cnfsFileIdx_t fIdx,
bool spiRam )

Load a JSON from ROM to RAM. JSONs placed in the assets_image folder before compilation will be automatically flashed to ROM.

Parameters
fIdxThe cnfsFileIdx_t the JSON to load
spiRamtrue to load to SPI RAM, false to load to normal RAM. SPI RAM is more plentiful but slower to access than normal RAM
Returns
A pointer to a null terminated JSON string. May be NULL if the load fails. Must be freed after use

◆ freeJson()

void freeJson ( char * jsonStr)

Free an allocated JSON string.

Parameters
jsonStrthe JSON string to free