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
18
namespace
cdc::ui
{
19
27
struct
PsramCjsonScope
{
28
static
void
*
alloc
(std::size_t sz) {
29
return
heap_caps_malloc(sz, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
30
}
31
PsramCjsonScope
() {
32
cJSON_Hooks hooks{
alloc
, std::free};
33
cJSON_InitHooks(&hooks);
34
}
35
~PsramCjsonScope
() { cJSON_InitHooks(
nullptr
); }
36
};
37
38
}
// namespace cdc::ui
cdc::ui
Centralized key-code constants for cdc_views.
Definition
IModule.h:8
cdc::ui::PsramCjsonScope::PsramCjsonScope
PsramCjsonScope()
Definition
PsramCjson.h:31
cdc::ui::PsramCjsonScope::~PsramCjsonScope
~PsramCjsonScope()
Definition
PsramCjson.h:35
cdc::ui::PsramCjsonScope::alloc
static void * alloc(std::size_t sz)
Definition
PsramCjson.h:28
components
cdc_ui
include
cdc_ui
PsramCjson.h
Generated by
1.16.1