CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
PsramCjson.h
Go to the documentation of this file.
1
9
10#pragma once
11
12#include "cJSON.h"
13#include "esp_heap_caps.h"
14
15#include <cstddef>
16#include <cstdlib>
17
18namespace cdc::ui {
19
28 static void* alloc(std::size_t sz) {
29 return heap_caps_malloc(sz, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
30 }
32 cJSON_Hooks hooks{alloc, std::free};
33 cJSON_InitHooks(&hooks);
34 }
35 ~PsramCjsonScope() { cJSON_InitHooks(nullptr); }
36};
37
38} // namespace cdc::ui
Centralized key-code constants for cdc_views.
Definition IModule.h:8
static void * alloc(std::size_t sz)
Definition PsramCjson.h:28